You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call NodesManager.initWithContext and thus create NativeProxy in ReanimatedModule constructor (#7206)
## Summary
Currently, we first create `ReanimatedModule` and `NodesManager` in its
constructor. Then, calling `ReanimatedModule.installTurboModule` invokes
`NodesManager.initWithContext` which creates `NativeProxy` and injects
JSI bindings in its constructor. The part I don't like here is that
`NodesManager` stays unconfigured for some time (between constructor and
`initWithContext` calls). Also, there's some time period when
`ReanimatedModule` exists but `NativeProxy` doesn't exist yet, even
though it will be necessary, so why don't we just instantiate it
earlier?
After this change, all three `ReanimatedModule`, `NodesManager` and
`NativeProxy` instances will be created at the same time (but without
injecting JSI bindings). Then, calling `installTurboModule` will
delegate the call to already existing `NativeProxy` which will inject
the bindings at the right time.
## Test plan
Build, launch and reload fabric-example on Android.
0 commit comments