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
Copy file name to clipboardExpand all lines: proposals/0002-Turbo-Modules.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,12 +42,12 @@ When the JavaScript code like `require('NativeModule').DeviceInfoModule` is call
42
42
> [TODO] - A work in process.
43
43
44
44
## Open Questions
45
-
1. How would the C++ object corresponding to the shape of a Native Module know the Java class (for example com.facebook.react.nativemodule.DeviceInfo) that it needs to call. Does this need to be a switch/case or a map in Java/ObjC that is constructed manually? Would this be done using BUCK dependencies?
46
-
2. Today, native modules usually take `ReactApplicationContext` as a parameter when they are constructed, but they can also be constructed in other ways like using a builder, or multiple parameters in the constructor. How would this be enforced?
47
-
3. How would the C++ code gen happen in Open Source, where BUCK is not used?
48
-
4. Since the generated C++ host objects have the same lifetime of the JS scopes they are referred in, what is the API to tell Java/ObjC when these objects are deallocated?
49
-
5. ReactModule options like `OnBatchCompleteListener` and `hasEagerInitialization` will be removed. Are they needed anymore, if yes - whats the alternative ?
50
-
6. This method allows Native Modules to not be singletons. What would this new pattern look like? Would this lead to memory leaks ?
51
-
52
-
## Backward Compatiability
45
+
1. How would the C++ object corresponding to the shape of a Native Module know the Java class (for example com.facebook.react.nativemodule.DeviceInfo) that it needs to call. Does this need to be a switch/case or a map in Java/ObjC that is constructed manually? Would this be done using BUCK dependencies?
46
+
2. Today, native modules usually take `ReactApplicationContext` as a parameter when they are constructed, but they can also be constructed in other ways like using a builder, or multiple parameters in the constructor. How would this be enforced?
47
+
3. How would the C++ code gen happen in Open Source, where BUCK is not used?
48
+
4. Since the generated C++ host objects have the same lifetime of the JS scopes they are referred in, what is the API to tell Java/ObjC when these objects are deallocated?
49
+
5. ReactModule options like `OnBatchCompleteListener` and `hasEagerInitialization` will be removed. Are they needed anymore, if yes - whats the alternative?
50
+
6. This method allows Native Modules to not be singletons. What would this new pattern look like? Would this lead to memory leaks?
51
+
52
+
## Backward Compatibility
53
53
1. It looks like existing native modules do not have to change since they are usually singletons.
0 commit comments