-
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
[ReactNative] Maintain order of bridge calls #2488
Conversation
When bridge calls are made, they should be dispatched to their destination GCD queue in the same order they were made. (It looks like this invariant broke in 336e18d, which caused call order to depend on the iteration of NSMapTable keys) Fixes #1941 (in that bug, createView addUIBlock blocks were sometimes running after other blocks that depend on them) I'm a react-native/iOS/objc newbie, so please excuse any ignorance this commit may well contain :)
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
(looks like travis failed on something unrelated... closing and opening PR to see if it gives him a kick) |
cc @tadeuzagallo (looks like you've written a lot of bridge code!) |
That makes sense. Since every module has its own queue by default, it shouldn't matter in most cases, but a clear example is that all view managers share the same queue. @facebook-github-bot import |
Thanks for importing. If you are an FB employee go to https://our.intern.facebook.com/intern/opensource/github/pull_request/675599992541433/int_phab to review. |
Summary: When bridge calls are made, they should be dispatched to their destination GCD queue in the same order they were made. (It looks like this invariant broke in 336e18d, which caused call order to depend on the iteration of `NSMapTable` keys whenever there are calls to multiple modules that share a queue) Fixes facebook#1941 (in which RCTUIManager createView addUIBlock blocks were sometimes running after other blocks that depended on them) I'm a react-native/iOS/objc newbie, so please excuse any ignorance this commit may well contain :) Closes facebook#2488 Github Author: Ted Suzman <[email protected]>
When bridge calls are made, they should be dispatched to their
destination GCD queue in the same order they were made. (It
looks like this invariant broke in 336e18d, which caused call
order to depend on the iteration of
NSMapTable
keyswhenever there are calls to multiple modules that share a queue)
Fixes #1941 (in which RCTUIManager createView addUIBlock
blocks were sometimes running after other blocks that depended
on them)
I'm a react-native/iOS/objc newbie, so please excuse any
ignorance this commit may well contain :)