-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Keep ReactImageView logging disabled in bridgeless #44578
Conversation
This pull request was exported from Phabricator. Differential Revision: D56970919 |
Base commit: 86dffb3 |
This pull request was exported from Phabricator. Differential Revision: D56970919 |
Summary: In bridgeless mode, when we fix themed react context, this code-path slows rendering (in dev), starting a feedback loop. Best understanding of feedback loop: 1. Some code tries to render an <Image/> component. 2. Fabric preallocates the <Image/> component, assigns a null src to the image. 3. The image component warns that there's no src: [RNLog.w](https://www.internalfb.com/code/fbsource/[8cf3936aee379b1f5fa31cc8f02745ceafa72ff3]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java?lines=603-609). 4. **Prior to the themed react context fix,** RNLog.w() would just noop: this [ThemedReactContext.hasActiveReactInstance()](https://www.internalfb.com/code/fbsource/[19ba3ff63f5342a4ba86e18f2e790c69c6cfc7e1]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/util/RNLog.kt?lines=93-95) returned false. 5. **After the themed react context fix,** RNLog.w() dispatches a [native -> javascript call](https://github.com/facebook/react-native/blob/44f9371f246932215627a7ea01fbedf5c13e3019/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/util/RNLog.kt#L94). This renders a LogBox. 6. LogBox renders a <Image/>, which re-starts this loop. We're not sure what the right long-term solution here is. But, I will follow up! But, until then, it's important that we unblock the ThemedReactContext fix. Changelog: [Internal] Reviewed By: javache Differential Revision: D56970919
This pull request was exported from Phabricator. Differential Revision: D56970919 |
Summary: In bridgeless mode, when we fix themed react context, this code-path slows rendering (in dev), starting a feedback loop. Best understanding of feedback loop: 1. Some code tries to render an <Image/> component. 2. Fabric preallocates the <Image/> component, assigns a null src to the image. 3. The image component warns that there's no src: [RNLog.w](https://www.internalfb.com/code/fbsource/[8cf3936aee379b1f5fa31cc8f02745ceafa72ff3]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java?lines=603-609). 4. **Prior to the themed react context fix,** RNLog.w() would just noop: this [ThemedReactContext.hasActiveReactInstance()](https://www.internalfb.com/code/fbsource/[19ba3ff63f5342a4ba86e18f2e790c69c6cfc7e1]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/util/RNLog.kt?lines=93-95) returned false. 5. **After the themed react context fix,** RNLog.w() dispatches a [native -> javascript call](https://github.com/facebook/react-native/blob/44f9371f246932215627a7ea01fbedf5c13e3019/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/util/RNLog.kt#L94). This renders a LogBox. 6. LogBox renders a <Image/>, which re-starts this loop. We're not sure what the right long-term solution here is. But, I will follow up! But, until then, it's important that we unblock the ThemedReactContext fix. Changelog: [Internal] Reviewed By: javache Differential Revision: D56970919
This pull request was exported from Phabricator. Differential Revision: D56970919 |
This pull request has been merged in d94c4c4. |
This pull request was successfully merged by @RSNara in d94c4c4. When will my fix make it into a release? | How to file a pick request? |
Summary: Pull Request resolved: facebook#44578 In bridgeless mode, when we fix themed react context, this code-path slows rendering (in dev), starting a feedback loop. Best understanding of feedback loop: 1. Some code tries to render an <Image/> component. 2. Fabric preallocates the <Image/> component, assigns a null src to the image. 3. The image component warns that there's no src: [RNLog.w](https://www.internalfb.com/code/fbsource/[8cf3936aee379b1f5fa31cc8f02745ceafa72ff3]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/ReactImageView.java?lines=603-609). 4. **Prior to the themed react context fix,** RNLog.w() would just noop: this [ThemedReactContext.hasActiveReactInstance()](https://www.internalfb.com/code/fbsource/[19ba3ff63f5342a4ba86e18f2e790c69c6cfc7e1]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/util/RNLog.kt?lines=93-95) returned false. 5. **After the themed react context fix,** RNLog.w() dispatches a [native -> javascript call](https://github.com/facebook/react-native/blob/44f9371f246932215627a7ea01fbedf5c13e3019/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/util/RNLog.kt#L94). This renders a LogBox. 6. LogBox renders a <Image/>, which re-starts this loop. We're not sure what the right long-term solution here is. But, I will follow up! But, until then, it's important that we unblock the ThemedReactContext fix. Changelog: [Internal] Reviewed By: javache Differential Revision: D56970919 fbshipit-source-id: 26f0cf0acaf6647ded26e6c816483b9ea3e4f4c2
Summary:
In bridgeless mode, when we fix themed react context, this code-path slows rendering (in dev), starting a feedback loop.
Best understanding of feedback loop:
We're not sure what the right long-term solution here is. But, I will follow up! But, until then, it's important that we unblock the ThemedReactContext fix.
Changelog: [Internal]
Differential Revision: D56970919