-
Notifications
You must be signed in to change notification settings - Fork 98
feat: populate home screen with AppRegistry entries #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| // loading. However, it seems that by posting a callback, we can | ||
| // defer fetching app keys until everything is done executing. | ||
| reactContext.JSDispatcher().Post([reactContext]() noexcept { | ||
| auto &runtime = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you get here when webdebugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good call. The test app is broken due to an unrelated issue fixed in #493.
With the fix applied, what happens is that we return early with an empty array here:
react-native-test-app/common/AppRegistry.cpp
Lines 22 to 25 in 09fca86
| auto global = runtime.global(); | |
| if (!global.hasProperty(runtime, kFbBatchedBridgeId)) { | |
| return result; | |
| } |
I'm hesitant to implement a fallback for this, especially when web debugging might go away soon. Unless you have any suggestions, I'm going to leave this as is.
b8d52b6 to
d00c982
Compare
|
Could we send the list of components over the bridge instead? (to include android) |
We could, but that requires changes to the JS. I'm not sure how we can achieve that without requiring users to add an extra import or similar. |
d00c982 to
fae8b9f
Compare
| } | ||
|
|
||
| let components = manifest.components | ||
| onComponentsRegistered(components, enable: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is a list of componetns in the manifest, wouldn't you want to call this with enable: true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property is for deciding whether the menu item should be enabled. Since the bridge hasn't been initialized yet, we should prevent them from being clicked. They get enabled when it is:
| strongSelf.reactMenu.items.forEach { $0.isEnabled = true } |
|
🎉 This PR is included in version 0.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
When
componentsis missing or empty inapp.json, we attempt to populate the home screen with entries found in theAppRegistry.Resolves #189.
Platforms affected
Test plan
yarnin example foldercomponentsfromapp.json:Remaining work