Closed
Description
RCTBridgeModuleClasses
currently scans all(!) of the classes available at runtime to find which are modules. I believe a more explicit approach where modules are loaded only when needed is better for a couple of reasons:
- No need to loop through all iOS classes
- Fewer side effects from implicitly invoking
+[load]
and+[initialize]
on otherwise-unused classes - Modules can be loaded on the JavaScript thread instead of the main thread -- some of the aforementioned side-effect methods in unused classes expect to run on the main thread
- Modules can be lazily loaded as needed