-
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
Enable RuntimeScheduler in old architecture #37523
Conversation
Base commit: 1a1e399 |
@sammy-SC has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was exported from Phabricator. Differential Revision: D46078324 |
Summary: ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Pull Request resolved: #37523 Differential Revision: D46078324 Pulled By: sammy-SC fbshipit-source-id: adbe9254fc4a55f7a6a5540ca0e44f26c7ccb45c
78885a3
to
de290e0
Compare
This pull request was successfully merged by @sammy-SC in de290e0. When will my fix make it into a release? | Upcoming Releases |
Summary: ## Changelog: <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Pull Request resolved: #37523 Test Plan: Run RNTester with Paper and make sure native scheduler is used. Differential Revision: D46078324 Pulled By: sammy-SC fbshipit-source-id: 0ba3d3096639986734a433ec8aae8564c70a2e66
de290e0
to
19c2596
Compare
This pull request was exported from Phabricator. Differential Revision: D46078324 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D46078324 |
Summary: ## Changelog: [IOS] [FIXED] - unexpected useEffects flushing semantics Pull Request resolved: #37523 Test Plan: Run RNTester with Paper and make sure native scheduler is used. Differential Revision: D46078324 Pulled By: sammy-SC fbshipit-source-id: 1790b4f42c0df428e26da482d0c895c20741cdbd
19c2596
to
9481858
Compare
This pull request was exported from Phabricator. Differential Revision: D46078324 |
Summary: ## Changelog: [IOS] [FIXED] - unexpected useEffects flushing semantics Pull Request resolved: #37523 Test Plan: Run RNTester with Paper and make sure native scheduler is used. Differential Revision: D46078324 Pulled By: sammy-SC fbshipit-source-id: 6cee070312034c5606799049a798b3b5659d03f3
f5e26cd
to
f59723e
Compare
@sammy-SC has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@sammy-SC has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: ## Changelog: [IOS] [FIXED] - unexpected useEffects flushing semantics Pull Request resolved: #37523 Test Plan: Run RNTester with old architecture and make sure RuntimeScheduler is used. Reviewed By: cipolleschi Differential Revision: D46078324 Pulled By: sammy-SC fbshipit-source-id: 2448f9578114dba9c4c855acd1f61e7468cd8f37
98acec6
to
8927517
Compare
This pull request was exported from Phabricator. Differential Revision: D46078324 |
1 similar comment
This pull request was exported from Phabricator. Differential Revision: D46078324 |
Summary: ## Changelog: [IOS] [FIXED] - unexpected useEffects flushing semantics Pull Request resolved: #37523 Test Plan: Run RNTester with old architecture and make sure RuntimeScheduler is used. Reviewed By: cipolleschi Differential Revision: D46078324 Pulled By: sammy-SC fbshipit-source-id: 89095e8aede025bbeaeb02196ee52de301c8fd05
8927517
to
7a0868a
Compare
This pull request was exported from Phabricator. Differential Revision: D46078324 |
Summary: ## Changelog: [IOS] [FIXED] - unexpected useEffects flushing semantics Pull Request resolved: #37523 Test Plan: Run RNTester with old architecture and make sure RuntimeScheduler is used. Differential Revision: D46078324 Pulled By: sammy-SC fbshipit-source-id: 98cdb0b588f4e30e4585f3f09d8633dfc2bb4e70
7a0868a
to
1342130
Compare
Summary: ## Changelog: [IOS] [FIXED] - unexpected useEffects flushing semantics Pull Request resolved: #37523 Test Plan: Run RNTester with old architecture and make sure RuntimeScheduler is used. Differential Revision: D46078324 Pulled By: sammy-SC fbshipit-source-id: 6b3dccb9aaf4e3e3beaf723098359a83be23ae5c
1342130
to
0c10fc8
Compare
This pull request was exported from Phabricator. Differential Revision: D46078324 |
Summary: [IOS] [FIXED] - unexpected useEffects flushing semantics Pull Request resolved: #37523 Test Plan: Run RNTester with old architecture and make sure RuntimeScheduler is used. Reviewed By: cipolleschi Differential Revision: D46078324 Pulled By: sammy-SC fbshipit-source-id: 5f18cbe60e6c9c753c373f175ba413b79288a928
This pull request has been reverted by 88eef42. |
Summary: [IOS] [FIXED] - unexpected useEffects flushing semantics Pull Request resolved: facebook#37523 Test Plan: Run RNTester with old architecture and make sure RuntimeScheduler is used. Reviewed By: cipolleschi Differential Revision: D46078324 Pulled By: sammy-SC fbshipit-source-id: 5f18cbe60e6c9c753c373f175ba413b79288a928
## Summary This PR bumps react-native to 0.72.0-rc.5 and slightly changes initialization path on iOS (Paper) due to recent changes in the framework (facebook/react-native#37523). Fixes #4521. Continues #3005. On iOS, Reanimated needs to overwrite two React internal modules: * `RCTUIManager` → `REAUIManager` to intercept `manageChildren` calls in order to observe React tree changes ([here](https://github.com/software-mansion/react-native-reanimated/blob/main/ios/LayoutReanimation/REAUIManager.mm)) * `RCTEventDispatcher` → `REAEventDispatcher` to intercept events in the native code while still on the UI thread ([here](https://github.com/software-mansion/react-native-reanimated/blob/663ee74925cafa4a1a802f4722466dc02cb1760f/ios/REAEventDispatcher.m#L9-L10)) The rest of the initialization (injecting JSI bindings) can be safely done in `installTurboModule` method, as we already do on Android and iOS/Fabric. Previously, this was done using categories (see [`UIResponder+Reanimated.mm`](https://github.com/software-mansion/react-native-reanimated/blob/663ee74925cafa4a1a802f4722466dc02cb1760f/ios/native/UIResponder%2BReanimated.mm#L19-L30)), in particular by overwriting `jsExecutorFactoryForBridge:` method which is called during initialization. However, since 0.72.0-rc.4, this method is already implemented in `RCTAppDelegate` so the trick does no longer work, making the app fail with the following error "[Reanimated] The native part of Reanimated doesn't seem to be initialized". In this PR, I've used a category to overwrite another method `extraModulesForBridge` which swizzles the implementation of `jsExecutorFactoryForBridge` method and runs `REAInitializer` before the original call. As suggested by @kmagiera, alternatively we could just swizzle the methods of `RCTUIManager` and `RCTEventDispatcher`. ## TODO - [x] Restore support for 0.71 and below with #ifdefs ## Test plan <!-- Provide a minimal but complete code snippet that can be used to test out this change along with instructions how to run it and a description of the expected behavior. -->
Summary:
Changelog:
[IOS] [FIXED] - unexpected useEffects flushing semantics
Test Plan:
Run RNTester with old architecture and make sure RuntimeScheduler is used.