Use registerLazyCallableModule to register HMRClient
Summary: Right now we use `BatchedBridge.registerLazyCallableModule` for all JS modules except for `HMRClient`, which uses `registerCallableModule` instead (takes the module itself instead of a function that returns it). I'm standardizing on `registerLazyCallableModule` so that it will be easier to swap out the implementation later for bridgeless mode. The only reason I could think why we wouldn't want to do this is if we're relying on some side effect of `require('HMRClient')` when setting up JS, but there don't seem to be any side effects in that module that I can see. Changelog: [Internal] Reviewed By: rickhanlonii Differential Revision: D18798870 fbshipit-source-id: a5c950bdbfd998bb12e4843ee28ece08a26c84bf
This commit is contained in:
Родитель
37d8440a8e
Коммит
de6aa10bdd
|
@ -50,13 +50,11 @@ if (!global.RN$Bridgeless) {
|
|||
);
|
||||
|
||||
if (__DEV__ && !global.__RCTProfileIsProfiling) {
|
||||
BatchedBridge.registerCallableModule(
|
||||
'HMRClient',
|
||||
BatchedBridge.registerLazyCallableModule('HMRClient', () =>
|
||||
require('../Utilities/HMRClient'),
|
||||
);
|
||||
} else {
|
||||
BatchedBridge.registerCallableModule(
|
||||
'HMRClient',
|
||||
BatchedBridge.registerLazyCallableModule('HMRClient', () =>
|
||||
require('../Utilities/HMRClientProdShim'),
|
||||
);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче