Skip to content
Permalink
Browse files

Delete old bridge

Reviewed By: astreet

Differential Revision: D3510660

fbshipit-source-id: 031b9dcf19dd4e6677a6c9417917930bcbbe3219
  • Loading branch information...
cjhopman authored and Facebook Github Bot 3 committed Aug 3, 2016
1 parent 5617d41 commit 1a690d56748eb4b6bf3a8c525ea761d3e3c9aea6
Showing with 95 additions and 7,235 deletions.
  1. +1 −0 ReactAndroid/src/androidTest/java/com/facebook/react/testing/BUCK
  2. +0 −1 ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactAppTestActivity.java
  3. +12 −5 ReactAndroid/src/androidTest/java/com/facebook/react/testing/ReactTestHelper.java
  4. +15 −42 ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java
  5. +0 −942 ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManagerImpl.java
  6. +0 −568 ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java
  7. +0 −93 ReactAndroid/src/main/java/com/facebook/react/bridge/JSBundleLoader.java
  8. +0 −34 ReactAndroid/src/main/java/com/facebook/react/bridge/JSCJavaScriptExecutor.java
  9. +0 −17 ReactAndroid/src/main/java/com/facebook/react/bridge/JSExecutionException.java
  10. +0 −28 ReactAndroid/src/main/java/com/facebook/react/bridge/JavaScriptExecutor.java
  11. +0 −235 ReactAndroid/src/main/java/com/facebook/react/bridge/NativeModuleRegistry.java
  12. +0 −66 ReactAndroid/src/main/java/com/facebook/react/bridge/ProxyJavaScriptExecutor.java
  13. +1 −85 ReactAndroid/src/main/java/com/facebook/react/bridge/ReactBridge.java
  14. +0 −25 ReactAndroid/src/main/java/com/facebook/react/bridge/ReactCallback.java
  15. +0 −76 ReactAndroid/src/main/java/com/facebook/react/bridge/webworkers/WebWorkers.java
  16. +0 −33 ReactAndroid/src/main/jni/react/Android.mk
  17. +0 −78 ReactAndroid/src/main/jni/react/BUCK
  18. +0 −256 ReactAndroid/src/main/jni/react/Bridge.cpp
  19. +0 −162 ReactAndroid/src/main/jni/react/Bridge.h
  20. +0 −80 ReactAndroid/src/main/jni/react/Executor.h
  21. +0 −54 ReactAndroid/src/main/jni/react/ExecutorToken.h
  22. +0 −25 ReactAndroid/src/main/jni/react/ExecutorTokenFactory.h
  23. +0 −709 ReactAndroid/src/main/jni/react/JSCExecutor.cpp
  24. +0 −168 ReactAndroid/src/main/jni/react/JSCExecutor.h
  25. +0 −59 ReactAndroid/src/main/jni/react/JSCHelpers.cpp
  26. +0 −47 ReactAndroid/src/main/jni/react/JSCHelpers.h
  27. +0 −84 ReactAndroid/src/main/jni/react/JSCLegacyProfiler.cpp
  28. +0 −15 ReactAndroid/src/main/jni/react/JSCLegacyProfiler.h
  29. +0 −48 ReactAndroid/src/main/jni/react/JSCMemory.cpp
  30. +0 −11 ReactAndroid/src/main/jni/react/JSCMemory.h
  31. +0 −65 ReactAndroid/src/main/jni/react/JSCPerfStats.cpp
  32. +0 −12 ReactAndroid/src/main/jni/react/JSCPerfStats.h
  33. +0 −478 ReactAndroid/src/main/jni/react/JSCTracing.cpp
  34. +0 −11 ReactAndroid/src/main/jni/react/JSCTracing.h
  35. +0 −35 ReactAndroid/src/main/jni/react/JSModulesUnbundle.h
  36. +0 −39 ReactAndroid/src/main/jni/react/MessageQueueThread.h
  37. +0 −74 ReactAndroid/src/main/jni/react/MethodCall.cpp
  38. +0 −29 ReactAndroid/src/main/jni/react/MethodCall.h
  39. +0 −30 ReactAndroid/src/main/jni/react/Platform.cpp
  40. +0 −52 ReactAndroid/src/main/jni/react/Platform.h
  41. +0 −147 ReactAndroid/src/main/jni/react/Value.cpp
  42. +0 −228 ReactAndroid/src/main/jni/react/Value.h
  43. +3 −16 ReactAndroid/src/main/jni/react/jni/Android.mk
  44. +8 −54 ReactAndroid/src/main/jni/react/jni/BUCK
  45. +7 −0 ReactAndroid/src/main/jni/react/jni/Dummy.cpp
  46. +0 −20 ReactAndroid/src/main/jni/react/jni/JExecutorToken.cpp
  47. +0 −59 ReactAndroid/src/main/jni/react/jni/JExecutorToken.h
  48. +0 −24 ReactAndroid/src/main/jni/react/jni/JExecutorTokenFactory.h
  49. +0 −44 ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.cpp
  50. +0 −58 ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.h
  51. +0 −44 ReactAndroid/src/main/jni/react/jni/JNativeRunnable.h
  52. +0 −244 ReactAndroid/src/main/jni/react/jni/JSCPerfLogging.cpp
  53. +0 −11 ReactAndroid/src/main/jni/react/jni/JSCPerfLogging.h
  54. +0 −93 ReactAndroid/src/main/jni/react/jni/JSLoader.cpp
  55. +0 −30 ReactAndroid/src/main/jni/react/jni/JSLoader.h
  56. +0 −36 ReactAndroid/src/main/jni/react/jni/JSLogging.cpp
  57. +0 −15 ReactAndroid/src/main/jni/react/jni/JSLogging.h
  58. +0 −83 ReactAndroid/src/main/jni/react/jni/JniJSModulesUnbundle.cpp
  59. +0 −31 ReactAndroid/src/main/jni/react/jni/JniJSModulesUnbundle.h
  60. +0 −516 ReactAndroid/src/main/jni/react/jni/OnLoad.cpp
  61. +0 −19 ReactAndroid/src/main/jni/react/jni/OnLoad.h
  62. +0 −91 ReactAndroid/src/main/jni/react/jni/ProxyExecutor.cpp
  63. +0 −57 ReactAndroid/src/main/jni/react/jni/ProxyExecutor.h
  64. +0 −50 ReactAndroid/src/main/jni/react/jni/WebWorkers.h
  65. +0 −12 ReactAndroid/src/main/jni/react/noncopyable.h
  66. +0 −21 ReactAndroid/src/main/jni/react/perftests/BUCK
  67. +0 −65 ReactAndroid/src/main/jni/react/perftests/OnLoad.cpp
  68. +48 −3 ReactAndroid/src/main/jni/xreact/perftests/OnLoad.cpp
  69. +0 −293 ReactAndroid/src/test/java/com/facebook/react/bridge/NativeModuleRegistryTest.java
@@ -13,6 +13,7 @@ android_library(
react_native_dep('third-party/java/testing-support-lib:runner'),
react_native_target('java/com/facebook/react/bridge:bridge'),
react_native_target('java/com/facebook/react/common:common'),
react_native_target('java/com/facebook/react/cxxbridge:bridge'),
react_native_target('java/com/facebook/react/devsupport:devsupport'),
react_native_target('java/com/facebook/react/modules/core:core'),
react_native_target('java/com/facebook/react/modules/debug:debug'),
@@ -25,7 +25,6 @@
import com.facebook.react.LifecycleState;
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactRootView;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.react.uimanager.UIImplementationProvider;
@@ -20,13 +20,14 @@

import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.CatalystInstance;
import com.facebook.react.bridge.CatalystInstanceImpl;
import com.facebook.react.bridge.JSBundleLoader;
import com.facebook.react.bridge.JSCJavaScriptExecutor;
import com.facebook.react.cxxbridge.CatalystInstanceImpl;
import com.facebook.react.cxxbridge.JSBundleLoader;
import com.facebook.react.cxxbridge.NativeModuleRegistry;
import com.facebook.react.cxxbridge.JSCJavaScriptExecutor;
import com.facebook.react.cxxbridge.JavaScriptExecutor;
import com.facebook.react.bridge.JavaScriptModuleRegistry;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.NativeModuleCallExceptionHandler;
import com.facebook.react.bridge.NativeModuleRegistry;
import com.facebook.react.bridge.WritableNativeMap;
import com.facebook.react.bridge.queue.ReactQueueConfigurationSpec;

@@ -61,9 +62,15 @@ public ReactInstanceEasyBuilder addJSModule(Class moduleInterfaceClass) {

@Override
public CatalystInstance build() {
JavaScriptExecutor executor = null;
try {
executor = new JSCJavaScriptExecutor.Factory(new WritableNativeMap()).create();
} catch (Exception e) {
throw new RuntimeException(e);
}
return new CatalystInstanceImpl.Builder()
.setReactQueueConfigurationSpec(ReactQueueConfigurationSpec.createDefault())
.setJSExecutor(new JSCJavaScriptExecutor(new WritableNativeMap()))
.setJSExecutor(executor)
.setRegistry(mNativeModuleRegistryBuilder.build())
.setJSModuleRegistry(mJSModuleRegistryBuilder.build())
.setJSBundleLoader(JSBundleLoader.createFileLoader(
@@ -202,7 +202,6 @@ public static Builder builder() {
protected @Nullable Activity mCurrentActivity;
protected @Nullable DefaultHardwareBackBtnHandler mDefaultHardwareBackBtnHandler;
protected @Nullable RedBoxHandler mRedBoxHandler;
protected boolean mUseOldBridge;

protected Builder() {
}
@@ -330,11 +329,6 @@ public Builder setRedBoxHandler(@Nullable RedBoxHandler redBoxHandler) {
return this;
}

public Builder setUseOldBridge(boolean enable) {
mUseOldBridge = enable;
return this;
}

/**
* Instantiates a new {@link ReactInstanceManagerImpl}.
* Before calling {@code build}, the following must be called:
@@ -350,10 +344,6 @@ public ReactInstanceManager build() {
mApplication,
"Application property has not been set with this builder");

Assertions.assertCondition(
mJSBundleLoader == null || !mUseOldBridge,
"JSBundleLoader can't be used with the old bridge");

Assertions.assertCondition(
mUseDeveloperSupport || mJSBundleFile != null || mJSBundleLoader != null,
"JS Bundle File has to be provided when dev support is disabled");
@@ -367,38 +357,21 @@ public ReactInstanceManager build() {
mUIImplementationProvider = new UIImplementationProvider();
}

if (mUseOldBridge) {
return new ReactInstanceManagerImpl(
mApplication,
mCurrentActivity,
mDefaultHardwareBackBtnHandler,
mJSBundleFile,
mJSMainModuleName,
mPackages,
mUseDeveloperSupport,
mBridgeIdleDebugListener,
Assertions.assertNotNull(mInitialLifecycleState, "Initial lifecycle state was not set"),
mUIImplementationProvider,
mNativeModuleCallExceptionHandler,
mJSCConfig,
mRedBoxHandler);
} else {
return new XReactInstanceManagerImpl(
mApplication,
mCurrentActivity,
mDefaultHardwareBackBtnHandler,
(mJSBundleLoader == null && mJSBundleFile != null) ?
JSBundleLoader.createFileLoader(mApplication, mJSBundleFile) : mJSBundleLoader,
mJSMainModuleName,
mPackages,
mUseDeveloperSupport,
mBridgeIdleDebugListener,
Assertions.assertNotNull(mInitialLifecycleState, "Initial lifecycle state was not set"),
mUIImplementationProvider,
mNativeModuleCallExceptionHandler,
mJSCConfig,
mRedBoxHandler);
}
return new XReactInstanceManagerImpl(
mApplication,
mCurrentActivity,
mDefaultHardwareBackBtnHandler,
(mJSBundleLoader == null && mJSBundleFile != null) ?
JSBundleLoader.createFileLoader(mApplication, mJSBundleFile) : mJSBundleLoader,
mJSMainModuleName,
mPackages,
mUseDeveloperSupport,
mBridgeIdleDebugListener,
Assertions.assertNotNull(mInitialLifecycleState, "Initial lifecycle state was not set"),
mUIImplementationProvider,
mNativeModuleCallExceptionHandler,
mJSCConfig,
mRedBoxHandler);
}
}
}
Oops, something went wrong.

0 comments on commit 1a690d5

Please sign in to comment.
You can’t perform that action at this time.