Add ability to lazy load Native Java Modules

Summary: Utilizes the build time annotation processor ReactModuleSpecProcessor that creates ReactModuleInfos for modules annotated with ReactModule and listed in the ReactModuleList annotation of LazyReactPackages. This way we don't have to instantiate the native modules to get the name, canOverrideExistingModule, and supportsWebWorkers values of the native modules. In the NativeModuleRegistry, we either store these ReactModuleInfos inside of a ModuleHolder or if we can't get the ReactModuleInfo for a specific module we instantiate that module to get the values (as we previously did) to store in a LegacyModuleInfo.

Reviewed By: astreet

Differential Revision: D3796561

fbshipit-source-id: f8fb9b4993f59b51ce595eb2f2c3425129b28ce5
This commit is contained in:
Aaron Chiu
2016-09-23 15:48:54 -07:00
committed by Facebook Github Bot 3
parent 1f9b765f81
commit 797ca6c219
16 changed files with 498 additions and 118 deletions

View File

@@ -11,9 +11,9 @@ package com.facebook.react.bridge;
import java.util.Collection;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
import com.facebook.react.common.annotations.VisibleForTesting;
import com.facebook.proguard.annotations.DoNotStrip;
/**
* A higher level API on top of the asynchronous JSC bridge. This provides an