f207cfddf3
Summary: In the top js errors there are 2 mids related to segment fetching: - requireForFacebook.js:unknownModuleError (https://www.internalfb.com/logview/details/facebook_android_javascripterrors/ba11461526aff8a6842401b35b02f5a4), 11.64 K vs. 524 - asyncRequire.js:verifySegment (https://www.internalfb.com/logview/details/facebook_android_javascripterrors/5452ba893b8d9ba8e97e070cf6976b65) 5.39 K vs. 180 Both errors will result in surface not loading. A lot of traces have logs similar with the following: ```11-01 19:57:51.166 27735 7626 W fb4a.BridgelessReact: registerSegment(segmentId = "1090", path = "/data/data/com.facebook.katana/app_overtheair/resources/412137089/414433453/hbc-seg-1090__DELIM__main.jsbundle") 11-01 19:57:51.167 27735 7445 I ReactNativeJS: Module 39122 in segment 0 doesn not exist moduleDefiner 11-01 19:57:51.171 27735 7445 E ReactNativeJS: Error: Requiring unknown module "39122"., js build: 414433453 11-01 19:57:51.175 27735 7445 E ReactNativeJS: Error: Segment meta module is not setup properly. Details: segmentId = 1090, metaModule === undefined 11-01 19:57:51.175 27735 7445 E ReactNativeJS: 11-01 19:57:51.175 27735 7445 E ReactNativeJS: This error is located at: ``` RegisterSegment lives through 3 threads while in bridge there are only 2 threads involved (native & JS): - Native thread, log printed (fb4a.BridgelessReact: registerSegment...) - Background thread: no log, added in this diff (Finish registerSegment...) - JS thread: logs not printed, should print logs here: https://www.internalfb.com/code/fbsource/[60521987354ed1ef9a0d10bafc60db3c25302ab4]/xplat/ReactNative/venice/ReactInstance.cpp?lines=308-330 Since the JS thread logs aren't printed and there are segment errors right after calling registerSegemnt, I think registerSegment is not done. It could be caused by: - ReactInstance being null, I added logs in background thread to verify (Finish registerSegment...) since dispatching to background thread relies on non-nullable ReactInstance. - Work on JS thread hasn't been executed when trying to use/verify the segment. I added atomic method ```registerSegmentAtomic``` to make sure JS thread is blocked until segment is fully registered. ```registerSegmentAtomic``` will be tested behind gating added in D40917444. Changelog: [Android][Changed] - Add feature flag enableAtomicRegisterSegment Reviewed By: RSNara Differential Revision: D40921759 fbshipit-source-id: 84221aa81f0c549f931a4847b154187299639ef4 |
||
---|---|---|
.bundle | ||
.circleci | ||
.github | ||
IntegrationTests | ||
Libraries | ||
React | ||
ReactAndroid | ||
ReactCommon | ||
docs | ||
flow | ||
flow-typed/npm | ||
gradle | ||
jest | ||
keystores | ||
local-cli | ||
packages | ||
repo-config | ||
scripts | ||
sdks/hermes-engine | ||
template | ||
third-party-podspecs | ||
tools | ||
types | ||
.buckconfig | ||
.buckjavaargs | ||
.clang-format | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.flowconfig | ||
.flowconfig.android | ||
.gitignore | ||
.node-version | ||
.prettierrc | ||
.ruby-version | ||
BUCK | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
ECOSYSTEM.md | ||
Gemfile | ||
Gemfile.lock | ||
LICENSE | ||
LICENSE-docs | ||
README.md | ||
React-Core.podspec | ||
React.podspec | ||
build.gradle.kts | ||
cli.js | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
index.js | ||
interface.js | ||
jest-preset.js | ||
jest.config.js | ||
metro.config.js | ||
package.json | ||
react-native.config.js | ||
react.gradle | ||
rn-get-polyfills.js | ||
runXcodeTests.sh | ||
settings.gradle.kts | ||
template.config.js | ||
yarn.lock |
README.md
React Native
Learn once, write anywhere:
Build mobile apps with React.
Getting Started · Learn the Basics · Showcase · Contribute · Community · Support
React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform.
- Declarative. React makes it painless to create interactive UIs. Declarative views make your code more predictable and easier to debug.
- Component-Based. Build encapsulated components that manage their state, then compose them to make complex UIs.
- Developer Velocity. See local changes in seconds. Changes to JavaScript code can be live reloaded without rebuilding the native app.
- Portability. Reuse code across iOS, Android, and other platforms.
React Native is developed and supported by many companies and individual core contributors. Find out more in our ecosystem overview.
Contents
- Requirements
- Building your first React Native app
- Documentation
- Upgrading
- How to Contribute
- Code of Conduct
- License
📋 Requirements
React Native apps may target iOS 12.4 and Android 5.0 (API 21) or newer. You may use Windows, macOS, or Linux as your development operating system, though building and running iOS apps is limited to macOS. Tools like Expo can be used to work around this.
🎉 Building your first React Native app
Follow the Getting Started guide. The recommended way to install React Native depends on your project. Here you can find short guides for the most common scenarios:
📖 Documentation
The full documentation for React Native can be found on our website.
The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the React documentation.
The source for the React Native documentation and website is hosted on a separate repo, @facebook/react-native-website.
🚀 Upgrading
Upgrading to new versions of React Native may give you access to more APIs, views, developer tools, and other goodies. See the Upgrading Guide for instructions.
React Native releases are discussed in this discussion repo.
👏 How to Contribute
The main purpose of this repository is to continue evolving React Native core. We want to make contributing to this project as easy and transparent as possible, and we are grateful to the community for contributing bug fixes and improvements. Read below to learn how you can take part in improving React Native.
Code of Conduct
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
Contributing Guide
Read our Contributing Guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to React Native.
Open Source Roadmap
You can learn more about our vision for React Native in the Roadmap.
Good First Issues
We have a list of good first issues that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process.
Discussions
Larger discussions and proposals are discussed in @react-native-community/discussions-and-proposals.
📄 License
React Native is MIT licensed, as found in the LICENSE file.
React Native documentation is Creative Commons licensed, as found in the LICENSE-docs file.