Skip to content

Efficiently load RCTBridgeModule classes and allow lazy, background-thread initialization #69

@ide

Description

@ide

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions