It appears currently impossible to create an RCTBridge instance that specifies an exclusive list of native modules to load. All native modules are registered program-wide via the accompanying macros and loaded every time, unconditionally. This is quite different from the Android implementation where we have total control over everything that gets loaded.
Details
The usecase is loading JS that should run in a restrictive, sandboxed environment with only a small subset of modules loaded which are carefully specified up front. Currently, on iOS, it is only possible to specific additional modules, but not the complete and exclusive list as far as I can tell.
Introduction
It appears currently impossible to create an RCTBridge instance that specifies an exclusive list of native modules to load. All native modules are registered program-wide via the accompanying macros and loaded every time, unconditionally. This is quite different from the Android implementation where we have total control over everything that gets loaded.
Details
The usecase is loading JS that should run in a restrictive, sandboxed environment with only a small subset of modules loaded which are carefully specified up front. Currently, on iOS, it is only possible to specific additional modules, but not the complete and exclusive list as far as I can tell.
Discussion points