docstring_tokens
stringlengths
18
16.9k
code_tokens
stringlengths
75
1.81M
html_url
stringlengths
74
116
file_name
stringlengths
3
311
keep keep keep keep replace keep keep keep keep keep
<mask> null, <mask> null); <mask> <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> <mask> assertChildrenAreExactly( <mask> hierarchy.nativeRootView, <mask> expectedViewAt0, <mask> expectedViewAt1, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> null, <mask> JavaOnlyArray.of(1)); <mask> <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> <mask> assertChildrenAreExactly( <mask> hierarchy.nativeRootView, <mask> expectedViewAt0, <mask> expectedViewAt1, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> JavaOnlyArray.of(4), <mask> null); <mask> <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> <mask> View newView = hierarchy.nativeRootView.getChildAt(4); <mask> assertThat(newView.getLeft()).isEqualTo(10); <mask> assertThat(newView.getTop()).isEqualTo(20); <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks();
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> null, <mask> JavaOnlyArray.of(4)); <mask> <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> <mask> assertThat(hierarchy.nativeRootView.getChildCount()).isEqualTo(4); <mask> } <mask> <mask> @Test </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks();
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> hierarchy.view0, <mask> ReactViewManager.REACT_CLASS, <mask> JavaOnlyMap.of("left", 10.0, "top", 20.0, "width", 30.0, "height", 40.0)); <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> assertThat(view0.getLeft()).isGreaterThan(2); <mask> <mask> // verify that the layout doesn't get updated when we update style property not affecting the <mask> // position (e.g., background-color) <mask> view0.layout(1, 2, 3, 4); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis) && </s> add !YGNodeIsStyleDimDefined(currentRelativeChild, crossAxis, availableInnerCrossDim) && </s> add // If this getRunLoop is used, current() will not work. std::function<void()> getUnregisteredRunLoop(); </s> remove // * The 'wrap' property supports only 'nowrap' (which is the default) or // 'wrap'. The // rarely-used 'wrap-reverse' is not supported. // * Rather than allowing arbitrary combinations of flexGrow, flexShrink and // flexBasis, this algorithm supports only the three most common // combinations: // flex: 0 is equiavlent to flex: 0 0 auto // flex: n (where n is a positive value) is equivalent to flex: n 1 auto // If POSITIVE_FLEX_IS_AUTO is 0, then it is equivalent to flex: n 0 0 // This is faster because the content doesn't need to be measured, but // it's // less flexible because the basis is always 0 and can't be overriden // with // the width/height attributes. // flex: -1 (or any negative value) is equivalent to flex: 0 1 auto // * Margins cannot be specified as 'auto'. They must be specified in terms of // pixel // values, and the default value is 0. // * Values of width, maxWidth, minWidth, height, maxHeight and minHeight must // be // specified as pixel values, not as percentages. // * There is no support for calculation of dimensions based on intrinsic // aspect ratios // (e.g. images). </s> add </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> hierarchy.view0, <mask> ReactViewManager.REACT_CLASS, <mask> JavaOnlyMap.of("backgroundColor", Color.RED)); <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> assertThat(view0.getLeft()).isEqualTo(1); <mask> } <mask> <mask> private static class AnimationStub extends Animation { <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove private static final String PROP_DECOMPOSED_MATRIX = "decomposedMatrix"; </s> add </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> add private ReadableMap mHeaders; </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks();
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> uiManagerModule.addAnimation(hierarchy.rootView, 1000, callbackMock); <mask> uiManagerModule.removeAnimation(hierarchy.rootView, 1000); <mask> <mask> uiManagerModule.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> <mask> verify(callbackMock, times(1)).invoke(false); <mask> verify(mockAnimation).run(); <mask> verify(mockAnimation).cancel(); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks();
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> uiManager.replaceExistingNonRootView(hierarchy.view2, newViewTag); <mask> <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> <mask> assertThat(hierarchy.nativeRootView.getChildCount()).isEqualTo(4); <mask> assertThat(hierarchy.nativeRootView.getChildAt(2)).isInstanceOf(ReactViewGroup.class); <mask> ReactViewGroup view = (ReactViewGroup) hierarchy.nativeRootView.getChildAt(2); <mask> assertThat(view.getBackgroundColor()).isEqualTo(Color.RED); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks();
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> addChild(uiManager, containerTag, containerTag + 2, 0); <mask> addChild(uiManager, containerTag, containerTag + 3, 1); <mask> <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> <mask> assertThat(rootView.getChildCount()).isEqualTo(2); <mask> assertThat(((ViewGroup) rootView.getChildAt(0)).getChildCount()).isEqualTo(2); <mask> <mask> uiManager.removeSubviewsFromContainerWithID(containerTag); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove std::runtime_error("Error calling function: " + moduleId + ":" + methodId)); </s> add std::runtime_error("Error calling " + moduleId + "." + methodId)); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks();
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> uiManager.removeSubviewsFromContainerWithID(containerTag); <mask> <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> <mask> assertThat(rootView.getChildCount()).isEqualTo(2); <mask> assertThat(((ViewGroup) rootView.getChildAt(0)).getChildCount()).isEqualTo(0); <mask> } <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks();
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> JavaOnlyArray.of(0), <mask> null); <mask> <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> <mask> return rootView; <mask> } <mask> <mask> private TestMoveDeleteHierarchy createMoveDeleteHierarchy(UIManagerModule uiManager) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks();
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> addChild(uiManager, hierarchy.viewWithChildren1, hierarchy.childView0, 0); <mask> addChild(uiManager, hierarchy.viewWithChildren1, hierarchy.childView1, 1); <mask> <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> <mask> return hierarchy; <mask> } <mask> <mask> private void addChild(UIManagerModule uiManager, int parentTag, int childTag, int index) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove private StackFrame(String file, String method, int line, int column) { </s> add private StackFrameImpl(String file, String method, int line, int column) { </s> remove private StackFrame(String file, String fileName, String method, int line, int column) { </s> add private StackFrameImpl(String file, String fileName, String method, int line, int column) { </s> remove ((ReactContext) getContext()).runOnNativeModulesQueueThread( new Runnable() { </s> add ReactContext reactContext = (ReactContext) getContext(); reactContext.runOnNativeModulesQueueThread( new GuardedRunnable(reactContext) { </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> add private @Nullable ReactViewBackgroundDrawable mReactBackgroundDrawable;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> childView1 = rootView + 6; <mask> } <mask> } <mask> <mask> private void executePendingChoreographerCallbacks() { <mask> ArrayList<Choreographer.FrameCallback> callbacks = <mask> new ArrayList<>(mPendingChoreographerCallbacks); <mask> mPendingChoreographerCallbacks.clear(); <mask> for (Choreographer.FrameCallback frameCallback : callbacks) { <mask> frameCallback.doFrame(0); <mask> } <mask> } <mask> <mask> private UIManagerModule getUIManagerModule() { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove for (Choreographer.FrameCallback frameCallback : callbacks) { </s> add for (ChoreographerCompat.FrameCallback frameCallback : callbacks) { </s> remove private void executePendingChoreographerCallbacks() { ArrayList<Choreographer.FrameCallback> callbacks = new ArrayList<>(mPendingChoreographerCallbacks); mPendingChoreographerCallbacks.clear(); for (Choreographer.FrameCallback frameCallback : callbacks) { </s> add private void executePendingFrameCallbacks() { ArrayList<ChoreographerCompat.FrameCallback> callbacks = new ArrayList<>(mPendingFrameCallbacks); mPendingFrameCallbacks.clear(); for (ChoreographerCompat.FrameCallback frameCallback : callbacks) { </s> remove ArrayList<Choreographer.FrameCallback> callbacks = </s> add ArrayList<ChoreographerCompat.FrameCallback> callbacks = </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove private static synchronized void unregisterHeapCapture(JSCHeapCapture dumper) { sRegisteredDumpers.remove(dumper); } public static synchronized void captureHeap(String path, final CaptureCallback callback) { final LinkedList<File> captureFiles = new LinkedList<>(); final LinkedList<CaptureException> captureFailures = new LinkedList<>(); if (sRegisteredDumpers.isEmpty()) { captureFailures.add(new CaptureException("No JSC registered")); callback.onComplete(captureFiles, captureFailures); return; } int disambiguate = 0; File f = new File(path + "/capture" + Integer.toString(disambiguate) + ".json"); while (f.delete()) { disambiguate++; f = new File(path + "/capture" + Integer.toString(disambiguate) + ".json"); } final int numRegisteredDumpers = sRegisteredDumpers.size(); disambiguate = 0; for (JSCHeapCapture dumper : sRegisteredDumpers) { File file = new File(path + "/capture" + Integer.toString(disambiguate) + ".json"); dumper.captureHeapHelper(file, new PerCaptureCallback() { @Override public void onSuccess(File capture) { captureFiles.add(capture); if (captureFiles.size() + captureFailures.size() == numRegisteredDumpers) { callback.onComplete(captureFiles, captureFailures); } } @Override public void onFailure(CaptureException cause) { captureFailures.add(cause); if (captureFiles.size() + captureFailures.size() == numRegisteredDumpers) { callback.onComplete(captureFiles, captureFailures); } } }); } } </s> add private @Nullable CaptureCallback mCaptureInProgress; </s> remove private ArrayList<Choreographer.FrameCallback> mPendingChoreographerCallbacks; </s> add private ArrayList<ChoreographerCompat.FrameCallback> mPendingFrameCallbacks;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/uimanager/UIManagerModuleTest.java
replace keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep
<mask> include_defs('//ReactAndroid/DEFS') <mask> <mask> rn_robolectric_test( <mask> name = 'views', <mask> # Please change the contact to the oncall of your team <mask> contacts = ['[email protected]'], <mask> # TODO Disabled temporarily until Yoga linking is fixed t14964130 <mask> # srcs = glob(['**/*.java']), <mask> srcs = glob(['image/*.java']), <mask> deps = [ <mask> YOGA_TARGET, <mask> react_native_dep('libraries/fbcore/src/test/java/com/facebook/powermock:powermock'), <mask> react_native_dep('libraries/fresco/fresco-react-native:fresco-drawee'), <mask> react_native_dep('libraries/fresco/fresco-react-native:fresco-react-native'), <mask> react_native_dep('libraries/fresco/fresco-react-native:imagepipeline'), <mask> react_native_dep('third-party/java/fest:fest'), <mask> react_native_dep('third-party/java/jsr-305:jsr-305'), <mask> react_native_dep('third-party/java/junit:junit'), <mask> react_native_dep('third-party/java/mockito:mockito'), <mask> react_native_dep('third-party/java/okhttp:okhttp3'), <mask> react_native_dep('third-party/java/okio:okio'), <mask> react_native_dep('third-party/java/robolectric3/robolectric:robolectric'), <mask> react_native_target('java/com/facebook/react:react'), <mask> react_native_target('java/com/facebook/react/bridge:bridge'), <mask> react_native_target('java/com/facebook/react/common:common'), <mask> react_native_target('java/com/facebook/react/touch:touch'), <mask> react_native_target('java/com/facebook/react/uimanager:uimanager'), <mask> react_native_target('java/com/facebook/react/uimanager/annotations:annotations'), <mask> react_native_target('java/com/facebook/react/views/image:image'), <mask> react_native_target('java/com/facebook/react/views/slider:slider'), <mask> react_native_target('java/com/facebook/react/views/text:text'), <mask> react_native_target('java/com/facebook/react/views/textinput:textinput'), <mask> react_native_target('java/com/facebook/react/views/view:view'), <mask> react_native_tests_target('java/com/facebook/react/bridge:testhelpers'), <mask> ], <mask> ) </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/BUCK
keep keep keep keep replace keep keep keep keep keep
<mask> import android.text.TextUtils; <mask> import android.text.style.AbsoluteSizeSpan; <mask> import android.text.style.StrikethroughSpan; <mask> import android.text.style.UnderlineSpan; <mask> import android.view.Choreographer; <mask> import android.widget.TextView; <mask> <mask> import com.facebook.react.ReactRootView; <mask> import com.facebook.react.bridge.Arguments; <mask> import com.facebook.react.bridge.JavaOnlyArray; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove import android.view.Choreographer; </s> add </s> remove import android.view.Choreographer; </s> add </s> remove import android.view.Choreographer; </s> add </s> remove import android.view.Choreographer; </s> add </s> remove import com.facebook.react.devsupport.DevSupportManager; import com.facebook.react.uimanager.ReactChoreographer; </s> add import com.facebook.react.devsupport.interfaces.DevSupportManager; </s> remove import com.facebook.react.uimanager.ReactChoreographer; import com.facebook.react.uimanager.UIImplementation; </s> add import com.facebook.react.modules.core.ChoreographerCompat; import com.facebook.react.modules.core.ReactChoreographer;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/text/ReactTextTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> import com.facebook.react.bridge.JavaOnlyArray; <mask> import com.facebook.react.bridge.JavaOnlyMap; <mask> import com.facebook.react.bridge.ReactApplicationContext; <mask> import com.facebook.react.bridge.ReactTestHelper; <mask> import com.facebook.react.uimanager.ReactChoreographer; <mask> import com.facebook.react.uimanager.UIImplementationProvider; <mask> import com.facebook.react.uimanager.UIManagerModule; <mask> import com.facebook.react.uimanager.ViewManager; <mask> import com.facebook.react.uimanager.ViewProps; <mask> import com.facebook.react.views.view.ReactViewBackgroundDrawable; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove import com.facebook.react.uimanager.ReactChoreographer; import com.facebook.react.uimanager.UIImplementation; </s> add import com.facebook.react.modules.core.ChoreographerCompat; import com.facebook.react.modules.core.ReactChoreographer; </s> add import com.facebook.react.modules.core.ChoreographerCompat; import com.facebook.react.modules.core.ReactChoreographer; </s> remove import com.facebook.react.devsupport.DevSupportManager; import com.facebook.react.uimanager.ReactChoreographer; </s> add import com.facebook.react.devsupport.interfaces.DevSupportManager; </s> remove import android.view.Choreographer; </s> add </s> add import com.facebook.react.modules.fresco.ReactNetworkImageRequest; </s> add import com.facebook.react.uimanager.PixelUtil; import com.facebook.react.uimanager.Spacing; import com.facebook.react.uimanager.ViewProps;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/text/ReactTextTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> @Rule <mask> public PowerMockRule rule = new PowerMockRule(); <mask> <mask> private ArrayList<Choreographer.FrameCallback> mPendingChoreographerCallbacks; <mask> <mask> @Before <mask> public void setUp() { <mask> PowerMockito.mockStatic(Arguments.class, ReactChoreographer.class); <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove private ArrayList<Choreographer.FrameCallback> mPendingChoreographerCallbacks; </s> add private ArrayList<ChoreographerCompat.FrameCallback> mPendingChoreographerCallbacks; </s> remove private ArrayList<Choreographer.FrameCallback> mPendingChoreographerCallbacks; </s> add private ArrayList<ChoreographerCompat.FrameCallback> mPendingFrameCallbacks; </s> remove ReactChoreographer choreographerMock = mock(ReactChoreographer.class); </s> add ReactChoreographer uiDriverMock = mock(ReactChoreographer.class); </s> remove private void executePendingChoreographerCallbacks() { ArrayList<Choreographer.FrameCallback> callbacks = new ArrayList<>(mPendingChoreographerCallbacks); mPendingChoreographerCallbacks.clear(); for (Choreographer.FrameCallback frameCallback : callbacks) { </s> add private void executePendingFrameCallbacks() { ArrayList<ChoreographerCompat.FrameCallback> callbacks = new ArrayList<>(mPendingFrameCallbacks); mPendingFrameCallbacks.clear(); for (ChoreographerCompat.FrameCallback frameCallback : callbacks) { </s> remove for (Choreographer.FrameCallback frameCallback : callbacks) { </s> add for (ChoreographerCompat.FrameCallback frameCallback : callbacks) { </s> remove new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { return new JavaOnlyArray(); } }); </s> add new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { return new JavaOnlyArray(); } });
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/text/ReactTextTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> @Before <mask> public void setUp() { <mask> PowerMockito.mockStatic(Arguments.class, ReactChoreographer.class); <mask> <mask> ReactChoreographer choreographerMock = mock(ReactChoreographer.class); <mask> PowerMockito.when(Arguments.createMap()).thenAnswer(new Answer<Object>() { <mask> @Override <mask> public Object answer(InvocationOnMock invocation) throws Throwable { <mask> return new JavaOnlyMap(); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { return new JavaOnlyArray(); } }); </s> add new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { return new JavaOnlyArray(); } }); </s> remove PowerMockito.when(ReactChoreographer.getInstance()).thenReturn(choreographerMock); </s> add PowerMockito.when(ReactChoreographer.getInstance()).thenReturn(uiDriverMock); </s> remove private ArrayList<Choreographer.FrameCallback> mPendingChoreographerCallbacks; </s> add private ArrayList<ChoreographerCompat.FrameCallback> mPendingChoreographerCallbacks; </s> remove private ArrayList<Choreographer.FrameCallback> mPendingChoreographerCallbacks; </s> add private ArrayList<ChoreographerCompat.FrameCallback> mPendingFrameCallbacks; </s> remove mPendingChoreographerCallbacks = new ArrayList<>(); </s> add mPendingFrameCallbacks = new ArrayList<>(); </s> remove mPendingChoreographerCallbacks = new ArrayList<>(); </s> add mPendingFrameCallbacks = new ArrayList<>();
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/text/ReactTextTest.java
keep replace keep replace keep keep keep
<mask> }); <mask> PowerMockito.when(ReactChoreographer.getInstance()).thenReturn(choreographerMock); <mask> <mask> mPendingChoreographerCallbacks = new ArrayList<>(); <mask> doAnswer(new Answer() { <mask> @Override <mask> public Object answer(InvocationOnMock invocation) throws Throwable { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/text/ReactTextTest.java
keep replace replace keep keep replace keep
<mask> public Object answer(InvocationOnMock invocation) throws Throwable { <mask> mPendingChoreographerCallbacks <mask> .add((Choreographer.FrameCallback) invocation.getArguments()[1]); <mask> return null; <mask> } <mask> }).when(choreographerMock).postFrameCallback( <mask> any(ReactChoreographer.CallbackType.class), </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/text/ReactTextTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> return null; <mask> } <mask> }).when(choreographerMock).postFrameCallback( <mask> any(ReactChoreographer.CallbackType.class), <mask> any(Choreographer.FrameCallback.class)); <mask> } <mask> <mask> @Test <mask> public void testFontSizeApplied() { <mask> UIManagerModule uiManager = getUIManagerModule(); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove any(Choreographer.FrameCallback.class)); </s> add any(ChoreographerCompat.FrameCallback.class)); </s> remove }).when(choreographerMock).postFrameCallback( </s> add }).when(uiDriverMock).postFrameCallback( </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove any(Choreographer.FrameCallback.class)); </s> add any(ChoreographerCompat.FrameCallback.class)); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove .add((Choreographer.FrameCallback) invocation.getArguments()[1]); </s> add .add((ChoreographerCompat.FrameCallback) invocation.getArguments()[1]);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/text/ReactTextTest.java
keep keep keep keep replace keep keep keep replace replace replace replace replace keep keep keep keep
<mask> JavaOnlyArray.of(0), <mask> null); <mask> <mask> uiManager.onBatchComplete(); <mask> executePendingChoreographerCallbacks(); <mask> return rootView; <mask> } <mask> <mask> private void executePendingChoreographerCallbacks() { <mask> ArrayList<Choreographer.FrameCallback> callbacks = <mask> new ArrayList<>(mPendingChoreographerCallbacks); <mask> mPendingChoreographerCallbacks.clear(); <mask> for (Choreographer.FrameCallback frameCallback : callbacks) { <mask> frameCallback.doFrame(0); <mask> } <mask> } <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove ArrayList<Choreographer.FrameCallback> callbacks = </s> add ArrayList<ChoreographerCompat.FrameCallback> callbacks = </s> remove for (Choreographer.FrameCallback frameCallback : callbacks) { </s> add for (ChoreographerCompat.FrameCallback frameCallback : callbacks) { </s> remove private void executePendingChoreographerCallbacks() { ArrayList<Choreographer.FrameCallback> callbacks = new ArrayList<>(mPendingChoreographerCallbacks); mPendingChoreographerCallbacks.clear(); for (Choreographer.FrameCallback frameCallback : callbacks) { </s> add private void executePendingFrameCallbacks() { ArrayList<ChoreographerCompat.FrameCallback> callbacks = new ArrayList<>(mPendingFrameCallbacks); mPendingFrameCallbacks.clear(); for (ChoreographerCompat.FrameCallback frameCallback : callbacks) { </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks();
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/text/ReactTextTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> import java.util.ArrayList; <mask> import java.util.Arrays; <mask> import java.util.List; <mask> <mask> import android.view.Choreographer; <mask> import android.widget.EditText; <mask> <mask> import com.facebook.react.ReactRootView; <mask> import com.facebook.react.bridge.Arguments; <mask> import com.facebook.react.bridge.JavaOnlyArray; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove import android.view.Choreographer; </s> add </s> remove import android.view.Choreographer; </s> add </s> remove import android.view.Choreographer; </s> add </s> add import java.util.Arrays; </s> remove import java.util.HashSet; import java.util.LinkedList; import java.util.List; </s> add </s> remove import java.util.List; </s> add import java.util.concurrent.TimeUnit; import com.facebook.react.packagerconnection.JSPackagerClient;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/textinput/TextInputTest.java
keep keep keep keep replace replace keep keep keep keep keep
<mask> import com.facebook.react.bridge.JavaOnlyArray; <mask> import com.facebook.react.bridge.JavaOnlyMap; <mask> import com.facebook.react.bridge.ReactApplicationContext; <mask> import com.facebook.react.bridge.ReactTestHelper; <mask> import com.facebook.react.uimanager.ReactChoreographer; <mask> import com.facebook.react.uimanager.UIImplementation; <mask> import com.facebook.react.uimanager.UIImplementationProvider; <mask> import com.facebook.react.uimanager.UIManagerModule; <mask> import com.facebook.react.uimanager.ViewManager; <mask> import com.facebook.react.uimanager.ViewProps; <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove import com.facebook.react.uimanager.ReactChoreographer; </s> add import com.facebook.react.modules.core.ChoreographerCompat; import com.facebook.react.modules.core.ReactChoreographer; </s> add import com.facebook.react.modules.core.ChoreographerCompat; import com.facebook.react.modules.core.ReactChoreographer; </s> remove import com.facebook.react.devsupport.DevSupportManager; import com.facebook.react.uimanager.ReactChoreographer; </s> add import com.facebook.react.devsupport.interfaces.DevSupportManager; </s> remove import android.view.Choreographer; </s> add </s> add import com.facebook.react.modules.fresco.ReactNetworkImageRequest; </s> add import com.facebook.react.uimanager.PixelUtil; import com.facebook.react.uimanager.Spacing; import com.facebook.react.uimanager.ViewProps;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/textinput/TextInputTest.java
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> @Rule <mask> public PowerMockRule rule = new PowerMockRule(); <mask> <mask> private ArrayList<Choreographer.FrameCallback> mPendingChoreographerCallbacks; <mask> <mask> @Before <mask> public void setUp() { <mask> PowerMockito.mockStatic(Arguments.class, ReactChoreographer.class); <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove private ArrayList<Choreographer.FrameCallback> mPendingChoreographerCallbacks; </s> add private ArrayList<ChoreographerCompat.FrameCallback> mPendingFrameCallbacks; </s> remove private ArrayList<Choreographer.FrameCallback> mPendingChoreographerCallbacks; </s> add private ArrayList<ChoreographerCompat.FrameCallback> mPendingFrameCallbacks; </s> remove ReactChoreographer choreographerMock = mock(ReactChoreographer.class); </s> add ReactChoreographer uiDriverMock = mock(ReactChoreographer.class); </s> remove private void executePendingChoreographerCallbacks() { ArrayList<Choreographer.FrameCallback> callbacks = new ArrayList<>(mPendingChoreographerCallbacks); mPendingChoreographerCallbacks.clear(); for (Choreographer.FrameCallback frameCallback : callbacks) { </s> add private void executePendingFrameCallbacks() { ArrayList<ChoreographerCompat.FrameCallback> callbacks = new ArrayList<>(mPendingFrameCallbacks); mPendingFrameCallbacks.clear(); for (ChoreographerCompat.FrameCallback frameCallback : callbacks) { </s> remove for (Choreographer.FrameCallback frameCallback : callbacks) { </s> add for (ChoreographerCompat.FrameCallback frameCallback : callbacks) { </s> remove new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { return new JavaOnlyArray(); } }); </s> add new Answer<Object>() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { return new JavaOnlyArray(); } });
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/textinput/TextInputTest.java
keep keep replace keep keep keep keep replace keep
<mask> public Object answer(InvocationOnMock invocation) throws Throwable { <mask> mPendingChoreographerCallbacks <mask> .add((Choreographer.FrameCallback) invocation.getArguments()[1]); <mask> return null; <mask> } <mask> }).when(choreographerMock).postFrameCallback( <mask> any(ReactChoreographer.CallbackType.class), <mask> any(Choreographer.FrameCallback.class)); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/textinput/TextInputTest.java
keep replace keep keep replace keep keep
<mask> private void executePendingChoreographerCallbacks() { <mask> ArrayList<Choreographer.FrameCallback> callbacks = <mask> new ArrayList<>(mPendingChoreographerCallbacks); <mask> mPendingChoreographerCallbacks.clear(); <mask> for (Choreographer.FrameCallback frameCallback : callbacks) { <mask> frameCallback.doFrame(0); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove private void executePendingChoreographerCallbacks() { ArrayList<Choreographer.FrameCallback> callbacks = new ArrayList<>(mPendingChoreographerCallbacks); mPendingChoreographerCallbacks.clear(); for (Choreographer.FrameCallback frameCallback : callbacks) { </s> add private void executePendingFrameCallbacks() { ArrayList<ChoreographerCompat.FrameCallback> callbacks = new ArrayList<>(mPendingFrameCallbacks); mPendingFrameCallbacks.clear(); for (ChoreographerCompat.FrameCallback frameCallback : callbacks) { </s> remove private void executePendingChoreographerCallbacks() { ArrayList<Choreographer.FrameCallback> callbacks = new ArrayList<>(mPendingChoreographerCallbacks); mPendingChoreographerCallbacks.clear(); for (Choreographer.FrameCallback frameCallback : callbacks) { </s> add private void executePendingFrameCallbacks() { ArrayList<ChoreographerCompat.FrameCallback> callbacks = new ArrayList<>(mPendingFrameCallbacks); mPendingFrameCallbacks.clear(); for (ChoreographerCompat.FrameCallback frameCallback : callbacks) { </s> remove executePendingChoreographerCallbacks(); </s> add executePendingFrameCallbacks(); </s> remove private ArrayList<Choreographer.FrameCallback> mPendingChoreographerCallbacks; </s> add private ArrayList<ChoreographerCompat.FrameCallback> mPendingFrameCallbacks; </s> remove private ArrayList<Choreographer.FrameCallback> mPendingChoreographerCallbacks; </s> add private ArrayList<ChoreographerCompat.FrameCallback> mPendingChoreographerCallbacks;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/com/facebook/react/views/textinput/TextInputTest.java
replace keep keep replace replace replace replace replace replace replace replace keep keep
<mask> include_defs('//ReactAndroid/DEFS') <mask> <mask> android_library( <mask> name = 'configuration', <mask> srcs = glob(['**/*.java']), <mask> deps = [ <mask> react_native_dep('third-party/java/mockito:mockito'), <mask> ], <mask> visibility = [ <mask> 'PUBLIC', <mask> ], <mask> ) <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove name = 'network', srcs = glob(['**/*.java']), deps = [ react_native_dep('third-party/java/okhttp:okhttp3'), ], visibility = [ 'PUBLIC', ], </s> add name = "network", srcs = glob(["**/*.java"]), visibility = [ "PUBLIC", ], deps = [ react_native_dep("third-party/java/okhttp:okhttp3"), ], </s> remove name = 'logging', srcs = glob(['**/*.java']), exported_deps = [ react_native_dep('libraries/fbcore/src/main/java/com/facebook/common/logging:logging'), ], deps = [ react_native_dep('third-party/java/jsr-305:jsr-305'), ], visibility = [ 'PUBLIC', ], </s> add name = "logging", srcs = glob(["**/*.java"]), exported_deps = [ react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"), ], visibility = [ "PUBLIC", ], deps = [ react_native_dep("third-party/java/jsr-305:jsr-305"), ], </s> remove name = 'picker', srcs = glob(['**/*.java']), deps = [ react_native_dep('third-party/java/infer-annotations:infer-annotations'), react_native_dep('third-party/java/jsr-305:jsr-305'), 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/module/annotations:annotations'), react_native_target('java/com/facebook/react/uimanager:uimanager'), react_native_target('java/com/facebook/react/uimanager/annotations:annotations'), ], visibility = [ 'PUBLIC', ], </s> add name = "picker", srcs = glob(["**/*.java"]), visibility = [ "PUBLIC", ], deps = [ react_native_dep("third-party/java/infer-annotations:infer-annotations"), react_native_dep("third-party/java/jsr-305:jsr-305"), 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/module/annotations:annotations"), react_native_target("java/com/facebook/react/uimanager:uimanager"), react_native_target("java/com/facebook/react/uimanager/annotations:annotations"), ], </s> remove name = 'model', srcs = glob(['**/*.java']), deps = [ react_native_dep('third-party/java/jsr-305:jsr-305'), ], visibility=[ 'PUBLIC' ] </s> add name = "model", srcs = glob(["**/*.java"]), visibility = [ "PUBLIC", ], deps = [ react_native_dep("third-party/java/jsr-305:jsr-305"), ], </s> remove name = 'imagehelper', srcs = glob(['*.java'], excludes=['MultiSourceHelper.java']), deps = [ react_native_dep('third-party/java/infer-annotations:infer-annotations'), react_native_dep('third-party/java/jsr-305:jsr-305'), ], visibility = [ 'PUBLIC', ], </s> add name = "imagehelper", srcs = glob( ["*.java"], excludes = ["MultiSourceHelper.java"], ), visibility = [ "PUBLIC", ], deps = [ react_native_dep("third-party/java/infer-annotations:infer-annotations"), react_native_dep("third-party/java/jsr-305:jsr-305"), ],
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactAndroid/src/test/java/org/mockito/configuration/BUCK
keep keep keep keep replace keep keep keep keep keep
<mask> LOCAL_MODULE := libreactnativefb <mask> <mask> LOCAL_SRC_FILES := \ <mask> CxxNativeModule.cpp \ <mask> Executor.cpp \ <mask> Instance.cpp \ <mask> JSCExecutor.cpp \ <mask> JSBundleType.cpp \ <mask> JSCLegacyProfiler.cpp \ <mask> JSCLegacyTracing.cpp \ </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add JSBigString.cpp \ </s> add #define YG_NODE_JNI_STYLE_UNIT_PROP_AUTO(name) \ YG_NODE_JNI_STYLE_UNIT_PROP(name) \ void jni_YGNodeStyleSet##name##Auto(alias_ref<jobject>, jlong nativePointer) { \ YGNodeStyleSet##name##Auto(_jlong2YGNodeRef(nativePointer)); \ } </s> remove YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPixel; \ </s> add YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPoint; \ </s> remove return YGComputedEdgeValue(node->style.instanceName, edge, &defaultValue)->value; \ </s> add return node->style.instanceName[edge].value; \ </s> remove node->style.instanceName[edge].unit != YGUnitPixel) { \ </s> add node->style.instanceName[edge].unit != YGUnitPoint) { \ </s> add #define YG_NODE_STYLE_PROPERTY_UNIT_AUTO(type, name, paramName) \ YG_NODE_STYLE_PROPERTY_UNIT(type, name, paramName) \ WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/Android.mk
keep keep add keep keep keep keep keep keep
<mask> CxxNativeModule.cpp \ <mask> Instance.cpp \ <mask> JSCExecutor.cpp \ <mask> JSBundleType.cpp \ <mask> JSCLegacyProfiler.cpp \ <mask> JSCLegacyTracing.cpp \ <mask> JSCMemory.cpp \ <mask> JSCNativeModules.cpp \ <mask> JSCPerfStats.cpp \ </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove Executor.cpp \ </s> add </s> add #define YG_NODE_JNI_STYLE_UNIT_PROP_AUTO(name) \ YG_NODE_JNI_STYLE_UNIT_PROP(name) \ void jni_YGNodeStyleSet##name##Auto(alias_ref<jobject>, jlong nativePointer) { \ YGNodeStyleSet##name##Auto(_jlong2YGNodeRef(nativePointer)); \ } </s> remove YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPixel; \ </s> add YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPoint; \ </s> remove return YGComputedEdgeValue(node->style.instanceName, edge, &defaultValue)->value; \ </s> add return node->style.instanceName[edge].value; \ </s> remove node->style.instanceName[edge].unit != YGUnitPixel) { \ </s> add node->style.instanceName[edge].unit != YGUnitPoint) { \ </s> add #define YG_NODE_STYLE_PROPERTY_UNIT_AUTO(type, name, paramName) \ YG_NODE_STYLE_PROPERTY_UNIT(type, name, paramName) \ WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/Android.mk
keep keep keep add keep keep keep keep keep
<mask> # on the bridge, we can mess up the SO initialisation order, causing <mask> # `initOnJSVMThread` to be called before the platform-specific hooks <mask> # have been properly initialised. Bad Times(TM). <mask> # -- @ashokmenon (2017/01/03) <mask> react_native_target('jni/xreact/jni:jni'), <mask> react_native_xplat_target('cxxreact/...'), <mask> ], <mask> ) <mask> ) </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove name = 'package_js', main = 'package_js.py', visibility = [ 'PUBLIC', ], </s> add name = "package_js", main = "package_js.py", visibility = [ "PUBLIC", ], </s> remove name = 'uimanager', # Please change the contact to the oncall of your team contacts = ['[email protected]'], # TODO Disabled temporarily until Yoga linking is fixed t14964130 # srcs = glob(['**/*.java']), srcs = ['SimpleViewPropertyTest.java'], deps = [ YOGA_TARGET, react_native_dep('libraries/fbcore/src/test/java/com/facebook/powermock:powermock'), react_native_dep('third-party/java/fest:fest'), react_native_dep('third-party/java/jsr-305:jsr-305'), react_native_dep('third-party/java/junit:junit'), react_native_dep('third-party/java/mockito:mockito'), react_native_dep('third-party/java/okhttp:okhttp3'), react_native_dep('third-party/java/okio:okio'), react_native_dep('third-party/java/robolectric3/robolectric:robolectric'), react_native_target('java/com/facebook/react:react'), react_native_target('java/com/facebook/react/animation:animation'), 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/touch:touch'), react_native_target('java/com/facebook/react/uimanager:uimanager'), react_native_target('java/com/facebook/react/uimanager/annotations:annotations'), react_native_target('java/com/facebook/react/views/text:text'), react_native_target('java/com/facebook/react/views/view:view'), react_native_tests_target('java/com/facebook/react/bridge:testhelpers'), ], visibility = [ 'PUBLIC' ], </s> add name = "uimanager", # TODO Disabled temporarily until Yoga linking is fixed t14964130 # srcs = glob(['**/*.java']), srcs = ["SimpleViewPropertyTest.java"], # Please change the contact to the oncall of your team contacts = ["[email protected]"], visibility = [ "PUBLIC", ], deps = [ YOGA_TARGET, react_native_dep("libraries/fbcore/src/test/java/com/facebook/powermock:powermock"), react_native_dep("third-party/java/fest:fest"), react_native_dep("third-party/java/jsr-305:jsr-305"), react_native_dep("third-party/java/junit:junit"), react_native_dep("third-party/java/mockito:mockito"), react_native_dep("third-party/java/okhttp:okhttp3"), react_native_dep("third-party/java/okio:okio"), react_native_dep("third-party/java/robolectric3/robolectric:robolectric"), react_native_target("java/com/facebook/react:react"), react_native_target("java/com/facebook/react/animation:animation"), 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/touch:touch"), react_native_target("java/com/facebook/react/uimanager:uimanager"), react_native_target("java/com/facebook/react/uimanager/annotations:annotations"), react_native_target("java/com/facebook/react/views/text:text"), react_native_target("java/com/facebook/react/views/view:view"), react_native_tests_target("java/com/facebook/react/bridge:testhelpers"), ], </s> remove name = 'android-all-4.1.2_r1-robolectric-0', # name defines filename used by robolectric in runtime binary_jar = ':robolectric-android-all-binary-jar', visibility = ['//ReactAndroid/...',], </s> add name = "android-all-4.1.2_r1-robolectric-0", # name defines filename used by robolectric in runtime binary_jar = ":robolectric-android-all-binary-jar", visibility = ["//ReactAndroid/..."], </s> remove name = 'cxxbridge', # Please change the contact to the oncall of your team contacts = ['[email protected]'], srcs = glob(['*Test.java']), deps = [ react_native_dep('third-party/java/fest:fest'), react_native_dep('third-party/java/junit:junit'), react_native_dep('third-party/java/mockito:mockito'), react_native_dep('third-party/java/robolectric3/robolectric:robolectric'), react_native_target('java/com/facebook/react/cxxbridge:bridge'), react_native_tests_target('java/com/facebook/common/logging:logging'), ], visibility = [ 'PUBLIC' ], </s> add name = "cxxbridge", srcs = glob(["*Test.java"]), # Please change the contact to the oncall of your team contacts = ["[email protected]"], visibility = [ "PUBLIC", ], deps = [ react_native_dep("third-party/java/fest:fest"), react_native_dep("third-party/java/junit:junit"), react_native_dep("third-party/java/mockito:mockito"), react_native_dep("third-party/java/robolectric3/robolectric:robolectric"), react_native_target("java/com/facebook/react/cxxbridge:bridge"), react_native_tests_target("java/com/facebook/common/logging:logging"), ], </s> remove name = 'views', # Please change the contact to the oncall of your team contacts = ['[email protected]'], # TODO Disabled temporarily until Yoga linking is fixed t14964130 # srcs = glob(['**/*.java']), srcs = glob(['image/*.java']), deps = [ YOGA_TARGET, react_native_dep('libraries/fbcore/src/test/java/com/facebook/powermock:powermock'), react_native_dep('libraries/fresco/fresco-react-native:fresco-drawee'), react_native_dep('libraries/fresco/fresco-react-native:fresco-react-native'), react_native_dep('libraries/fresco/fresco-react-native:imagepipeline'), react_native_dep('third-party/java/fest:fest'), react_native_dep('third-party/java/jsr-305:jsr-305'), react_native_dep('third-party/java/junit:junit'), react_native_dep('third-party/java/mockito:mockito'), react_native_dep('third-party/java/okhttp:okhttp3'), react_native_dep('third-party/java/okio:okio'), react_native_dep('third-party/java/robolectric3/robolectric:robolectric'), react_native_target('java/com/facebook/react:react'), 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/touch:touch'), react_native_target('java/com/facebook/react/uimanager:uimanager'), react_native_target('java/com/facebook/react/uimanager/annotations:annotations'), react_native_target('java/com/facebook/react/views/image:image'), react_native_target('java/com/facebook/react/views/slider:slider'), react_native_target('java/com/facebook/react/views/text:text'), react_native_target('java/com/facebook/react/views/textinput:textinput'), react_native_target('java/com/facebook/react/views/view:view'), react_native_tests_target('java/com/facebook/react/bridge:testhelpers'), ], </s> add name = "views", # TODO Disabled temporarily until Yoga linking is fixed t14964130 # srcs = glob(['**/*.java']), srcs = glob(["image/*.java"]), # Please change the contact to the oncall of your team contacts = ["[email protected]"], deps = [ YOGA_TARGET, react_native_dep("libraries/fbcore/src/test/java/com/facebook/powermock:powermock"), react_native_dep("libraries/fresco/fresco-react-native:fresco-drawee"), react_native_dep("libraries/fresco/fresco-react-native:fresco-react-native"), react_native_dep("libraries/fresco/fresco-react-native:imagepipeline"), react_native_dep("third-party/java/fest:fest"), react_native_dep("third-party/java/jsr-305:jsr-305"), react_native_dep("third-party/java/junit:junit"), react_native_dep("third-party/java/mockito:mockito"), react_native_dep("third-party/java/okhttp:okhttp3"), react_native_dep("third-party/java/okio:okio"), react_native_dep("third-party/java/robolectric3/robolectric:robolectric"), react_native_target("java/com/facebook/react:react"), 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/touch:touch"), react_native_target("java/com/facebook/react/uimanager:uimanager"), react_native_target("java/com/facebook/react/uimanager/annotations:annotations"), react_native_target("java/com/facebook/react/views/image:image"), react_native_target("java/com/facebook/react/views/slider:slider"), react_native_target("java/com/facebook/react/views/text:text"), react_native_target("java/com/facebook/react/views/textinput:textinput"), react_native_target("java/com/facebook/react/views/view:view"), react_native_tests_target("java/com/facebook/react/bridge:testhelpers"), ], </s> remove include_defs('//ReactAndroid/DEFS') </s> add include_defs("//ReactAndroid/DEFS")
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/BUCK
keep keep keep keep replace keep keep keep keep keep
<mask> ], <mask> ) <mask> ) <mask> <mask> elif THIS_IS_FBOBJC: <mask> def react_library(**kwargs): <mask> ios_library( <mask> name = 'bridge', <mask> header_path_prefix = "cxxreact", <mask> inherited_buck_flags = STATIC_LIBRARY_IOS_FLAGS, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove name = 'module', force_static = True, compiler_flags = CXX_LIBRARY_COMPILER_FLAGS, xcode_public_headers_symlinks = True, exported_headers = [ 'CxxModule.h', 'JsArgumentHelpers.h', 'JsArgumentHelpers-inl.h', ], header_namespace = 'cxxreact', deps = [ '//xplat/folly:molly', ], visibility = [ 'PUBLIC', ], </s> add name = "module", compiler_flags = CXX_LIBRARY_COMPILER_FLAGS, exported_headers = [ "CxxModule.h", "JsArgumentHelpers.h", "JsArgumentHelpers-inl.h", ], force_static = True, header_namespace = "cxxreact", visibility = [ "PUBLIC", ], xcode_public_headers_symlinks = True, deps = [ "//xplat/folly:molly", ], </s> remove name = 'bridge', srcs = glob(['**/*.java']), exported_deps = [ react_native_dep('java/com/facebook/jni:jni'), react_native_dep('java/com/facebook/proguard/annotations:annotations'), react_native_dep('third-party/java/jsr-330:jsr-330'), ], deps = [ react_native_dep('java/com/facebook/systrace:systrace'), react_native_dep('libraries/fbcore/src/main/java/com/facebook/common/logging:logging'), react_native_dep('libraries/soloader/java/com/facebook/soloader:soloader'), react_native_dep('third-party/android/support/v4:lib-support-v4'), react_native_dep('third-party/java/infer-annotations:infer-annotations'), react_native_dep('third-party/java/jsr-305:jsr-305'), react_native_target('java/com/facebook/react/common:common'), ], visibility = [ 'PUBLIC', ], </s> add name = "bridge", srcs = glob(["**/*.java"]), exported_deps = [ react_native_dep("java/com/facebook/jni:jni"), react_native_dep("java/com/facebook/proguard/annotations:annotations"), react_native_dep("third-party/java/jsr-330:jsr-330"), ], visibility = [ "PUBLIC", ], deps = [ react_native_dep("java/com/facebook/systrace:systrace"), react_native_dep("libraries/fbcore/src/main/java/com/facebook/common/logging:logging"), react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"), react_native_dep("third-party/android/support/v4:lib-support-v4"), react_native_dep("third-party/java/infer-annotations:infer-annotations"), react_native_dep("third-party/java/jsr-305:jsr-305"), react_native_target("java/com/facebook/react/common:common"), ], </s> remove name = 'testhelpers', srcs = glob(['*.java'], excludes = STANDARD_TEST_SRCS), deps = [ react_native_dep('third-party/java/mockito:mockito'), react_native_dep('third-party/java/robolectric3/robolectric:robolectric'), react_native_target('java/com/facebook/react/bridge:bridge'), react_native_target('java/com/facebook/react/uimanager:uimanager'), react_native_tests_target('java/org/mockito/configuration:configuration'), ], visibility = [ 'PUBLIC' ], </s> add name = "testhelpers", srcs = glob( ["*.java"], excludes = STANDARD_TEST_SRCS, ), visibility = [ "PUBLIC", ], deps = [ react_native_dep("third-party/java/mockito:mockito"), react_native_dep("third-party/java/robolectric3/robolectric:robolectric"), react_native_target("java/com/facebook/react/bridge:bridge"), react_native_target("java/com/facebook/react/uimanager:uimanager"), react_native_tests_target("java/org/mockito/configuration:configuration"), ], </s> remove name = 'bridge', # Please change the contact to the oncall of your team contacts = ['[email protected]'], srcs = glob(STANDARD_TEST_SRCS), deps = [ ':testhelpers', react_native_dep('libraries/fbcore/src/test/java/com/facebook/powermock:powermock'), react_native_dep('libraries/soloader/java/com/facebook/soloader:soloader'), react_native_dep('third-party/java/fest:fest'), react_native_dep('third-party/java/jsr-305:jsr-305'), react_native_dep('third-party/java/junit:junit'), react_native_dep('third-party/java/mockito:mockito'), react_native_dep('third-party/java/robolectric3/robolectric:robolectric'), 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/uimanager:uimanager'), ], visibility = [ 'PUBLIC' ], </s> add name = "bridge", srcs = glob(STANDARD_TEST_SRCS), # Please change the contact to the oncall of your team contacts = ["[email protected]"], visibility = [ "PUBLIC", ], deps = [ ":testhelpers", react_native_dep("libraries/fbcore/src/test/java/com/facebook/powermock:powermock"), react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"), react_native_dep("third-party/java/fest:fest"), react_native_dep("third-party/java/jsr-305:jsr-305"), react_native_dep("third-party/java/junit:junit"), react_native_dep("third-party/java/mockito:mockito"), react_native_dep("third-party/java/robolectric3/robolectric:robolectric"), 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/uimanager:uimanager"), ], </s> remove name = 'package_js', main = 'package_js.py', visibility = [ 'PUBLIC', ], </s> add name = "package_js", main = "package_js.py", visibility = [ "PUBLIC", ], </s> remove name = 'm', header_only = True, exported_linker_flags = [ '-lm', ], visibility = [ 'PUBLIC', ], </s> add name = "m", exported_linker_flags = [ "-lm", ], header_only = True, visibility = [ "PUBLIC", ],
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/BUCK
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep
<mask> ) <mask> ) <mask> <mask> cxx_library( <mask> name = 'module', <mask> force_static = True, <mask> compiler_flags = CXX_LIBRARY_COMPILER_FLAGS, <mask> xcode_public_headers_symlinks = True, <mask> exported_headers = [ <mask> 'CxxModule.h', <mask> 'JsArgumentHelpers.h', <mask> 'JsArgumentHelpers-inl.h', <mask> ], <mask> header_namespace = 'cxxreact', <mask> deps = [ <mask> '//xplat/folly:molly', <mask> ], <mask> visibility = [ <mask> 'PUBLIC', <mask> ], <mask> ) <mask> <mask> cxx_library( <mask> name = 'samplemodule', <mask> soname = 'libxplat_react_module_samplemodule.so', <mask> srcs = ['SampleCxxModule.cpp'], <mask> xcode_public_headers_symlinks = True, <mask> exported_headers = ['SampleCxxModule.h'], <mask> header_namespace = '', <mask> compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [ <mask> '-fno-omit-frame-pointer', <mask> '-Wall', <mask> '-Werror', <mask> '-std=c++1y', <mask> '-fexceptions', <mask> ], <mask> deps = [ <mask> ':module', <mask> '//xplat/folly:molly', <mask> ], <mask> visibility = [ <mask> 'PUBLIC', <mask> ], <mask> ) </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove name='jni', soname = 'libreactnativejnifb.$(ext)', header_namespace = 'xreact/jni', deps = JSC_DEPS + [ '//native/fb:fb', '//native/third-party/android-ndk:android', '//xplat/folly:molly', '//xplat/fbsystrace:fbsystrace', react_native_xplat_target('cxxreact:bridge'), react_native_xplat_target('cxxreact:module'), react_native_xplat_target('inspector:inspector'), ], srcs = glob(['*.cpp']), xcode_public_headers_symlinks = True, exported_headers = EXPORTED_HEADERS, headers = glob(['*.h'], excludes=EXPORTED_HEADERS), preprocessor_flags = [ '-DLOG_TAG="ReactNativeJNI"', '-DWITH_FBSYSTRACE=1', '-DWITH_INSPECTOR=1', ], compiler_flags = [ '-Wall', '-Werror', '-fexceptions', '-std=c++1y', '-fvisibility=hidden', '-frtti', '-Wno-pessimizing-move', '-Wno-inconsistent-missing-override', ], visibility = [ 'PUBLIC', ], </s> add name = "jni", srcs = glob(["*.cpp"]), compiler_flags = [ "-Wall", "-Werror", "-fexceptions", "-std=c++1y", "-frtti", "-Wno-pessimizing-move", "-Wno-inconsistent-missing-override", ], exported_headers = EXPORTED_HEADERS, header_namespace = "xreact/jni", headers = glob( ["*.h"], excludes = EXPORTED_HEADERS, ), preprocessor_flags = [ "-DLOG_TAG=\"ReactNativeJNI\"", "-DWITH_FBSYSTRACE=1", "-DWITH_INSPECTOR=1", ], soname = "libreactnativejnifb.$(ext)", visibility = [ "PUBLIC", ], xcode_public_headers_symlinks = True, deps = JSC_DEPS + [ "//native/fb:fb", "//native/third-party/android-ndk:android", "//xplat/folly:molly", "//xplat/fbgloginit:fbgloginit", "//xplat/fbsystrace:fbsystrace", react_native_xplat_target("cxxreact:bridge"), react_native_xplat_target("cxxreact:module"), react_native_xplat_target("inspector:inspector"), ], </s> remove header_namespace = 'cxxreact', force_static = True, srcs = glob(['*.cpp'], excludes=['SampleCxxModule.cpp']), headers = glob(['*.h'], excludes=CXXREACT_PUBLIC_HEADERS), xcode_public_headers_symlinks = True, exported_headers = CXXREACT_PUBLIC_HEADERS, preprocessor_flags = [ '-DLOG_TAG="ReactNative"', '-DWITH_FBSYSTRACE=1', ], compiler_flags = [ '-Wall', '-fexceptions', '-fvisibility=hidden', '-frtti', '-std=c++1y', ] + REACT_LIBRARY_EXTRA_COMPILER_FLAGS, deps = [ ':module', '//xplat/fbsystrace:fbsystrace', react_native_xplat_target('jschelpers:jschelpers'), react_native_xplat_target('microprofiler:microprofiler'), ], </s> add srcs = glob( ["*.cpp"], excludes = ["SampleCxxModule.cpp"], ), compiler_flags = [ "-Wall", "-fexceptions", "-frtti", "-std=c++1y", ] + REACT_LIBRARY_EXTRA_COMPILER_FLAGS, exported_headers = CXXREACT_PUBLIC_HEADERS, force_static = True, header_namespace = "cxxreact", headers = glob( ["*.h"], excludes = CXXREACT_PUBLIC_HEADERS, ), preprocessor_flags = [ "-DLOG_TAG=\"ReactNative\"", "-DWITH_FBSYSTRACE=1", ], xcode_public_headers_symlinks = True, deps = [ ":module", "//xplat/fbsystrace:fbsystrace", react_native_xplat_target("jschelpers:jschelpers"), react_native_xplat_target("microprofiler:microprofiler"), ], </s> remove name = 'perftests', srcs = [ 'OnLoad.cpp' ], soname = 'libnativereactperftests.$(ext)', compiler_flags = [ '-fexceptions', '-std=c++1y', ], deps = [ '//native:base', '//native/fb:fb', '//xplat/folly:molly', react_native_xplat_target('cxxreact:module'), ], visibility = [ '//instrumentation_tests/com/facebook/react/...', ], </s> add name = "perftests", srcs = ["OnLoad.cpp"], compiler_flags = [ "-fexceptions", "-std=c++1y", ], soname = "libnativereactperftests.$(ext)", visibility = [ "//instrumentation_tests/com/facebook/react/...", ], deps = [ "//native:base", "//native/fb:fb", "//xplat/folly:molly", react_native_xplat_target("cxxreact:module"), ], </s> remove name='jni', soname = 'libreactnativejni.$(ext)', header_namespace = 'react/jni', srcs = [ 'Dummy.cpp', ], deps = [ react_native_target('jni/xreact/jni:jni'), ], visibility = [ 'PUBLIC', ], </s> add name = "jni", srcs = [ "Dummy.cpp", ], header_namespace = "react/jni", soname = "libreactnativejni.$(ext)", visibility = [ "PUBLIC", ], deps = [ react_native_target("jni/xreact/jni:jni"), ], </s> remove name = 'm', header_only = True, exported_linker_flags = [ '-lm', ], visibility = [ 'PUBLIC', ], </s> add name = "m", exported_linker_flags = [ "-lm", ], header_only = True, visibility = [ "PUBLIC", ],
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/BUCK
keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace
<mask> CXXREACT_PUBLIC_HEADERS = [ <mask> 'CxxMessageQueue.h', <mask> 'CxxNativeModule.h', <mask> 'Executor.h', <mask> 'ExecutorToken.h', <mask> 'ExecutorTokenFactory.h', <mask> 'Instance.h', <mask> 'JSCExecutor.h', <mask> 'JSCNativeModules.h', <mask> 'JSCWebWorker.h', <mask> 'JSBundleType.h', <mask> 'JSIndexedRAMBundle.h', <mask> 'JSModulesUnbundle.h', <mask> 'MessageQueueThread.h', <mask> 'MethodCall.h', <mask> 'ModuleRegistry.h', <mask> 'NativeModule.h', <mask> 'NativeToJsBridge.h', <mask> 'Platform.h', <mask> 'RecoverableError.h', <mask> 'SystraceSection.h', <mask> ] <mask> <mask> react_library( <mask> header_namespace = 'cxxreact', <mask> force_static = True, <mask> srcs = glob(['*.cpp'], excludes=['SampleCxxModule.cpp']), <mask> headers = glob(['*.h'], excludes=CXXREACT_PUBLIC_HEADERS), <mask> xcode_public_headers_symlinks = True, <mask> exported_headers = CXXREACT_PUBLIC_HEADERS, <mask> preprocessor_flags = [ <mask> '-DLOG_TAG="ReactNative"', <mask> '-DWITH_FBSYSTRACE=1', <mask> ], <mask> compiler_flags = [ <mask> '-Wall', <mask> '-fexceptions', <mask> '-fvisibility=hidden', <mask> '-frtti', <mask> '-std=c++1y', <mask> ] + REACT_LIBRARY_EXTRA_COMPILER_FLAGS, <mask> deps = [ <mask> ':module', <mask> '//xplat/fbsystrace:fbsystrace', <mask> react_native_xplat_target('jschelpers:jschelpers'), <mask> react_native_xplat_target('microprofiler:microprofiler'), <mask> ], </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove name='jni', soname = 'libreactnativejnifb.$(ext)', header_namespace = 'xreact/jni', deps = JSC_DEPS + [ '//native/fb:fb', '//native/third-party/android-ndk:android', '//xplat/folly:molly', '//xplat/fbsystrace:fbsystrace', react_native_xplat_target('cxxreact:bridge'), react_native_xplat_target('cxxreact:module'), react_native_xplat_target('inspector:inspector'), ], srcs = glob(['*.cpp']), xcode_public_headers_symlinks = True, exported_headers = EXPORTED_HEADERS, headers = glob(['*.h'], excludes=EXPORTED_HEADERS), preprocessor_flags = [ '-DLOG_TAG="ReactNativeJNI"', '-DWITH_FBSYSTRACE=1', '-DWITH_INSPECTOR=1', ], compiler_flags = [ '-Wall', '-Werror', '-fexceptions', '-std=c++1y', '-fvisibility=hidden', '-frtti', '-Wno-pessimizing-move', '-Wno-inconsistent-missing-override', ], visibility = [ 'PUBLIC', ], </s> add name = "jni", srcs = glob(["*.cpp"]), compiler_flags = [ "-Wall", "-Werror", "-fexceptions", "-std=c++1y", "-frtti", "-Wno-pessimizing-move", "-Wno-inconsistent-missing-override", ], exported_headers = EXPORTED_HEADERS, header_namespace = "xreact/jni", headers = glob( ["*.h"], excludes = EXPORTED_HEADERS, ), preprocessor_flags = [ "-DLOG_TAG=\"ReactNativeJNI\"", "-DWITH_FBSYSTRACE=1", "-DWITH_INSPECTOR=1", ], soname = "libreactnativejnifb.$(ext)", visibility = [ "PUBLIC", ], xcode_public_headers_symlinks = True, deps = JSC_DEPS + [ "//native/fb:fb", "//native/third-party/android-ndk:android", "//xplat/folly:molly", "//xplat/fbgloginit:fbgloginit", "//xplat/fbsystrace:fbsystrace", react_native_xplat_target("cxxreact:bridge"), react_native_xplat_target("cxxreact:module"), react_native_xplat_target("inspector:inspector"), ], </s> remove name = 'samplemodule', soname = 'libxplat_react_module_samplemodule.so', srcs = ['SampleCxxModule.cpp'], xcode_public_headers_symlinks = True, exported_headers = ['SampleCxxModule.h'], header_namespace = '', compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [ '-fno-omit-frame-pointer', '-Wall', '-Werror', '-std=c++1y', '-fexceptions', ], deps = [ ':module', '//xplat/folly:molly', ], visibility = [ 'PUBLIC', ], </s> add name = "samplemodule", srcs = ["SampleCxxModule.cpp"], compiler_flags = CXX_LIBRARY_COMPILER_FLAGS + [ "-fno-omit-frame-pointer", "-Wall", "-Werror", "-std=c++1y", "-fexceptions", ], exported_headers = ["SampleCxxModule.h"], header_namespace = "", soname = "libxplat_react_module_samplemodule.so", visibility = [ "PUBLIC", ], xcode_public_headers_symlinks = True, deps = [ ":module", "//xplat/folly:molly", ], </s> remove name = 'module', force_static = True, compiler_flags = CXX_LIBRARY_COMPILER_FLAGS, xcode_public_headers_symlinks = True, exported_headers = [ 'CxxModule.h', 'JsArgumentHelpers.h', 'JsArgumentHelpers-inl.h', ], header_namespace = 'cxxreact', deps = [ '//xplat/folly:molly', ], visibility = [ 'PUBLIC', ], </s> add name = "module", compiler_flags = CXX_LIBRARY_COMPILER_FLAGS, exported_headers = [ "CxxModule.h", "JsArgumentHelpers.h", "JsArgumentHelpers-inl.h", ], force_static = True, header_namespace = "cxxreact", visibility = [ "PUBLIC", ], xcode_public_headers_symlinks = True, deps = [ "//xplat/folly:molly", ], </s> remove name = 'perftests', srcs = [ 'OnLoad.cpp' ], soname = 'libnativereactperftests.$(ext)', compiler_flags = [ '-fexceptions', '-std=c++1y', ], deps = [ '//native:base', '//native/fb:fb', '//xplat/folly:molly', react_native_xplat_target('cxxreact:module'), ], visibility = [ '//instrumentation_tests/com/facebook/react/...', ], </s> add name = "perftests", srcs = ["OnLoad.cpp"], compiler_flags = [ "-fexceptions", "-std=c++1y", ], soname = "libnativereactperftests.$(ext)", visibility = [ "//instrumentation_tests/com/facebook/react/...", ], deps = [ "//native:base", "//native/fb:fb", "//xplat/folly:molly", react_native_xplat_target("cxxreact:module"), ], </s> remove name = 'm', header_only = True, exported_linker_flags = [ '-lm', ], visibility = [ 'PUBLIC', ], </s> add name = "m", exported_linker_flags = [ "-lm", ], header_only = True, visibility = [ "PUBLIC", ],
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/BUCK
keep keep keep add keep keep keep keep keep
<mask> delayed_.process(); <mask> } <mask> <mask> void bindToThisThread() { <mask> if (tid_ != std::thread::id{}) { <mask> throw std::runtime_error("Message queue already bound to thread."); <mask> } <mask> tid_ = std::this_thread::get_id(); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove private synchronized void captureHeapHelper(File file, PerCaptureCallback callback) { if (mHeapCapture == null) { callback.onFailure(new CaptureException("HeapCapture.js module not connected")); </s> add public synchronized void captureHeap(String path, final CaptureCallback callback) { if (mCaptureInProgress != null) { callback.onFailure(new CaptureException("Heap capture already in progress.")); </s> remove mHeapCapture.captureHeap(file.getPath()); </s> add heapCapture.captureHeap(f.getPath()); </s> remove // TODO: handle nested runloops (either allow them or throw an exception). </s> add </s> remove if (current.unit != YogaUnit.PIXEL || current.value != padding) { </s> add if (current.unit != YogaUnit.POINT || current.value != padding) { </s> remove if (current.unit != YogaUnit.PIXEL || current.value != padding) { </s> add if (current.unit != YogaUnit.POINT || current.value != padding) { </s> remove if (current.unit != YogaUnit.PIXEL || current.value != padding) { </s> add if (current.unit != YogaUnit.POINT || current.value != padding) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxMessageQueue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> return *mq_registry; <mask> } <mask> } <mask> <mask> std::weak_ptr<CxxMessageQueue> CxxMessageQueue::current() { <mask> auto tid = std::this_thread::get_id(); <mask> return getMQRegistry().find(tid); <mask> } <mask> <mask> std::function<void()> CxxMessageQueue::getRunLoop(std::shared_ptr<CxxMessageQueue> mq) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove return getMQRegistry().find(tid); </s> add return getMQRegistry().find(tid).lock(); } std::function<void()> CxxMessageQueue::getUnregisteredRunLoop() { return [capture=qr_] { capture->bindToThisThread(); capture->run(); }; </s> remove // TODO: handle nested runloops (either allow them or throw an exception). </s> add </s> remove qplClass()->getMethod<jlong()>("currentMonotonicTimestamp"); return currentTimestampMethod(this_); } private: static alias_ref<jclass> qplClass() { static auto cls = findClassStatic("com/facebook/quicklog/QuickPerformanceLogger"); return cls; </s> add javaClassStatic()->getMethod<jlong()>("currentMonotonicTimestamp"); return currentTimestampMethod(self()); </s> remove using JObjectWrapper<jobject>::JObjectWrapper; static global_ref<jqpl> get() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); static global_ref<jqpl> theQpl = make_global(getQPLInstMethod(qplProviderClass().get())); return theQpl; } static bool check() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); auto theQpl = getQPLInstMethod(qplProviderClass().get()); return (theQpl.get() != nullptr); } private: static alias_ref<jclass> qplProviderClass() { static auto cls = findClassStatic("com/facebook/quicklog/QuickPerformanceLoggerProvider"); return cls; </s> add static alias_ref<JQuickPerformanceLogger::javaobject> get() { static auto getQPLInstMethod = javaClassStatic()->getStaticMethod<JQuickPerformanceLogger::javaobject()>("getQPLInstance"); static auto logger = make_global(getQPLInstMethod(javaClassStatic())); return logger; </s> remove using JQuickPerformanceLoggerProvider = JObjectWrapper<jqplProvider>; }} </s> add </s> remove public Choreographer.FrameCallback getAndResetFrameCallback() { Choreographer.FrameCallback callback = mFrameCallback; </s> add public ChoreographerCompat.FrameCallback getAndResetFrameCallback() { ChoreographerCompat.FrameCallback callback = mFrameCallback;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxMessageQueue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> } <mask> <mask> std::weak_ptr<CxxMessageQueue> CxxMessageQueue::current() { <mask> auto tid = std::this_thread::get_id(); <mask> return getMQRegistry().find(tid); <mask> } <mask> <mask> std::function<void()> CxxMessageQueue::getRunLoop(std::shared_ptr<CxxMessageQueue> mq) { <mask> return [capture=mq->qr_, weakMq=std::weak_ptr<CxxMessageQueue>(mq)] { <mask> capture->bindToThisThread(); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove std::weak_ptr<CxxMessageQueue> CxxMessageQueue::current() { </s> add std::shared_ptr<CxxMessageQueue> CxxMessageQueue::current() { </s> remove // TODO: handle nested runloops (either allow them or throw an exception). </s> add </s> remove qplClass()->getMethod<jlong()>("currentMonotonicTimestamp"); return currentTimestampMethod(this_); } private: static alias_ref<jclass> qplClass() { static auto cls = findClassStatic("com/facebook/quicklog/QuickPerformanceLogger"); return cls; </s> add javaClassStatic()->getMethod<jlong()>("currentMonotonicTimestamp"); return currentTimestampMethod(self()); </s> remove using JObjectWrapper<jobject>::JObjectWrapper; static global_ref<jqpl> get() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); static global_ref<jqpl> theQpl = make_global(getQPLInstMethod(qplProviderClass().get())); return theQpl; } static bool check() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); auto theQpl = getQPLInstMethod(qplProviderClass().get()); return (theQpl.get() != nullptr); } private: static alias_ref<jclass> qplProviderClass() { static auto cls = findClassStatic("com/facebook/quicklog/QuickPerformanceLoggerProvider"); return cls; </s> add static alias_ref<JQuickPerformanceLogger::javaobject> get() { static auto getQPLInstMethod = javaClassStatic()->getStaticMethod<JQuickPerformanceLogger::javaobject()>("getQPLInstance"); static auto logger = make_global(getQPLInstMethod(javaClassStatic())); return logger; </s> remove using JQuickPerformanceLoggerProvider = JObjectWrapper<jqplProvider>; }} </s> add </s> remove static std::weak_ptr<CxxMessageQueue> current(); </s> add static std::shared_ptr<CxxMessageQueue> current();
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxMessageQueue.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> return [capture=mq->qr_, weakMq=std::weak_ptr<CxxMessageQueue>(mq)] { <mask> capture->bindToThisThread(); <mask> auto tid = std::this_thread::get_id(); <mask> <mask> // TODO: handle nested runloops (either allow them or throw an exception). <mask> getMQRegistry().registerQueue(tid, weakMq); <mask> capture->run(); <mask> getMQRegistry().unregister(tid); <mask> }; <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add // TODO: handle nested runloops (either allow them or throw an exception). </s> remove return getMQRegistry().find(tid); </s> add return getMQRegistry().find(tid).lock(); } std::function<void()> CxxMessageQueue::getUnregisteredRunLoop() { return [capture=qr_] { capture->bindToThisThread(); capture->run(); }; </s> remove std::weak_ptr<CxxMessageQueue> CxxMessageQueue::current() { </s> add std::shared_ptr<CxxMessageQueue> CxxMessageQueue::current() { </s> remove qplClass()->getMethod<jlong()>("currentMonotonicTimestamp"); return currentTimestampMethod(this_); } private: static alias_ref<jclass> qplClass() { static auto cls = findClassStatic("com/facebook/quicklog/QuickPerformanceLogger"); return cls; </s> add javaClassStatic()->getMethod<jlong()>("currentMonotonicTimestamp"); return currentTimestampMethod(self()); </s> remove using JObjectWrapper<jobject>::JObjectWrapper; static global_ref<jqpl> get() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); static global_ref<jqpl> theQpl = make_global(getQPLInstMethod(qplProviderClass().get())); return theQpl; } static bool check() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); auto theQpl = getQPLInstMethod(qplProviderClass().get()); return (theQpl.get() != nullptr); } private: static alias_ref<jclass> qplProviderClass() { static auto cls = findClassStatic("com/facebook/quicklog/QuickPerformanceLoggerProvider"); return cls; </s> add static alias_ref<JQuickPerformanceLogger::javaobject> get() { static auto getQPLInstMethod = javaClassStatic()->getStaticMethod<JQuickPerformanceLogger::javaobject()>("getQPLInstance"); static auto logger = make_global(getQPLInstMethod(javaClassStatic())); return logger; </s> remove using JQuickPerformanceLoggerProvider = JObjectWrapper<jqplProvider>; }} </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxMessageQueue.cpp
keep keep keep keep replace replace keep keep keep keep keep
<mask> // Copyright 2004-present Facebook. All Rights Reserved. <mask> <mask> #pragma once <mask> <mask> #include "MessageQueueThread.h" <mask> <mask> #include <atomic> <mask> #include <functional> <mask> #include <chrono> <mask> #include <mutex> <mask> #include <thread> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include <fcntl.h> #include <functional> </s> add </s> remove #include <folly/Optional.h> </s> add </s> remove #include <functional> </s> add </s> remove #include "ExecutorToken.h" #include "Executor.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> </s> remove #include "NativeModule.h" </s> add </s> remove #include "Executor.h" </s> add #include <cxxreact/Executor.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxMessageQueue.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> #include "MessageQueueThread.h" <mask> <mask> #include <atomic> <mask> #include <functional> <mask> #include <chrono> <mask> #include <mutex> <mask> #include <thread> <mask> #include <memory> <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #include <functional> #include <memory> </s> remove #include "MessageQueueThread.h" </s> add </s> remove #include <memory> </s> add #include <cxxreact/MessageQueueThread.h> </s> remove #include <sys/mman.h> #include <vector> </s> add </s> remove #include <fcntl.h> #include <functional> </s> add </s> remove #include <folly/json.h> </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> #include <cxxreact/JSCNativeModules.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxMessageQueue.h
keep keep add keep keep keep keep keep
<mask> <mask> #include <atomic> <mask> #include <chrono> <mask> #include <mutex> <mask> #include <thread> <mask> <mask> #include <cxxreact/MessageQueueThread.h> <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include <functional> </s> add </s> remove #include "MessageQueueThread.h" </s> add </s> remove #include <memory> </s> add #include <cxxreact/MessageQueueThread.h> </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> #include <cxxreact/JSCExecutor.h> #include <cxxreact/JSModulesUnbundle.h> #include <cxxreact/MessageQueueThread.h> #include <cxxreact/MethodCall.h> #include <cxxreact/NativeModule.h> </s> remove #include <folly/json.h> </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> #include <cxxreact/JSCNativeModules.h> </s> remove #include <jschelpers/JavaScriptCore.h> </s> add #include <folly/json.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxMessageQueue.h
keep keep keep keep replace keep keep keep keep keep
<mask> #include <functional> <mask> #include <chrono> <mask> #include <mutex> <mask> #include <thread> <mask> #include <memory> <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> namespace detail { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include <functional> </s> add </s> add #include <functional> #include <memory> </s> add #include <cxxreact/ModuleRegistry.h> #include <folly/Optional.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <cxxreact/NativeModule.h> #include <cxxreact/NativeToJsBridge.h> </s> remove #include "NativeToJsBridge.h" #include "ModuleRegistry.h" #include "NativeModule.h" </s> add </s> remove #include "Executor.h" #include "JSBundleType.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/JSBundleType.h> #include <cxxreact/JSModulesUnbundle.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxMessageQueue.h
keep keep add keep keep keep keep keep
<mask> <mask> bool isOnQueue(); <mask> <mask> // This returns a function that will actually run the runloop. <mask> // This runloop will return some time after quitSynchronous (or after this is destroyed). <mask> // <mask> // When running the runloop, it is important to ensure that no frames in the <mask> // current stack have a strong reference to the queue. </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #include <folly/Conv.h> #include <folly/dynamic.h> </s> remove // pixel values then the returned value will be the same as YGNodeStyleGetXXX. However if </s> add // point values then the returned value will be the same as YGNodeStyleGetXXX. However if </s> remove // * The 'wrap' property supports only 'nowrap' (which is the default) or // 'wrap'. The // rarely-used 'wrap-reverse' is not supported. // * Rather than allowing arbitrary combinations of flexGrow, flexShrink and // flexBasis, this algorithm supports only the three most common // combinations: // flex: 0 is equiavlent to flex: 0 0 auto // flex: n (where n is a positive value) is equivalent to flex: n 1 auto // If POSITIVE_FLEX_IS_AUTO is 0, then it is equivalent to flex: n 0 0 // This is faster because the content doesn't need to be measured, but // it's // less flexible because the basis is always 0 and can't be overriden // with // the width/height attributes. // flex: -1 (or any negative value) is equivalent to flex: 0 1 auto // * Margins cannot be specified as 'auto'. They must be specified in terms of // pixel // values, and the default value is 0. // * Values of width, maxWidth, minWidth, height, maxHeight and minHeight must // be // specified as pixel values, not as percentages. // * There is no support for calculation of dimensions based on intrinsic // aspect ratios // (e.g. images). </s> add </s> remove -YGNodeStyleGetFlexShrink(child) * child->layout.computedFlexBasis; </s> add -YGNodeResolveFlexShrink(child) * child->layout.computedFlexBasis; </s> remove const float availableWidth, const float availableHeight, </s> add const float parentWidth, const float parentHeight, </s> add // TODO: findClassStatic only does the lookup once. If we can't find // QuickPerformanceLoggerProvider the first time we call this, we will always fail here.
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxMessageQueue.h
keep keep keep keep replace keep keep keep keep keep
<mask> // <mask> // Only one thread should run the runloop. <mask> static std::function<void()> getRunLoop(std::shared_ptr<CxxMessageQueue> mq); <mask> <mask> static std::weak_ptr<CxxMessageQueue> current(); <mask> private: <mask> class QueueRunner; <mask> std::shared_ptr<QueueRunner> qr_; <mask> }; <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add // If this getRunLoop is used, current() will not work. std::function<void()> getUnregisteredRunLoop(); </s> remove qplClass()->getMethod<jlong()>("currentMonotonicTimestamp"); return currentTimestampMethod(this_); } private: static alias_ref<jclass> qplClass() { static auto cls = findClassStatic("com/facebook/quicklog/QuickPerformanceLogger"); return cls; </s> add javaClassStatic()->getMethod<jlong()>("currentMonotonicTimestamp"); return currentTimestampMethod(self()); </s> remove return getMQRegistry().find(tid); </s> add return getMQRegistry().find(tid).lock(); } std::function<void()> CxxMessageQueue::getUnregisteredRunLoop() { return [capture=qr_] { capture->bindToThisThread(); capture->run(); }; </s> remove using JObjectWrapper<jobject>::JObjectWrapper; static global_ref<jqpl> get() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); static global_ref<jqpl> theQpl = make_global(getQPLInstMethod(qplProviderClass().get())); return theQpl; } static bool check() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); auto theQpl = getQPLInstMethod(qplProviderClass().get()); return (theQpl.get() != nullptr); } private: static alias_ref<jclass> qplProviderClass() { static auto cls = findClassStatic("com/facebook/quicklog/QuickPerformanceLoggerProvider"); return cls; </s> add static alias_ref<JQuickPerformanceLogger::javaobject> get() { static auto getQPLInstMethod = javaClassStatic()->getStaticMethod<JQuickPerformanceLogger::javaobject()>("getQPLInstance"); static auto logger = make_global(getQPLInstMethod(javaClassStatic())); return logger; </s> add // TODO: findClassStatic only does the lookup once. If we can't find // QuickPerformanceLoggerProvider the first time we call this, we will always fail here. </s> remove template<> class JObjectWrapper<jqplProvider> : public JObjectWrapper<jobject> { public: static constexpr const char* kJavaDescriptor = "Lcom/facebook/quicklog/QuickPerformanceLoggerProvider;"; </s> add struct JQuickPerformanceLoggerProvider : JavaClass<JQuickPerformanceLoggerProvider> { static auto constexpr kJavaDescriptor = "Lcom/facebook/quicklog/QuickPerformanceLoggerProvider;";
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxMessageQueue.h
keep add keep keep keep keep keep keep
<mask> using namespace std::placeholders; <mask> <mask> namespace facebook { namespace xplat { namespace module { <mask> <mask> /** <mask> * Base class for Catalyst native modules whose implementations are <mask> * written in C++. Native methods are represented by instances of the <mask> * Method struct. Generally, a derived class will manage an instance </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "ModuleRegistry.h" </s> add </s> remove public class ReactModuleInfo implements Info { </s> add public class ReactModuleInfo { </s> remove struct _jqplProvider : _jobject {}; using jqplProvider = _jqplProvider*; </s> add namespace facebook { namespace react { </s> add #include <cxxreact/NativeModule.h> </s> remove namespace facebook { namespace react { </s> add </s> remove #include "NativeToJsBridge.h" #include "ModuleRegistry.h" #include "NativeModule.h" </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxModule.h
keep keep keep keep replace keep keep keep keep keep
<mask> CxxNativeModule::CxxNativeModule(std::weak_ptr<Instance> instance, <mask> std::unique_ptr<CxxModule> module) <mask> : instance_(instance) <mask> , module_(std::move(module)) <mask> , methods_(module_->getMethods()) {} <mask> <mask> std::string CxxNativeModule::getName() { <mask> return module_->getName(); <mask> } <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove // JSExecutor functions sometimes take large strings, on the order of // megabytes. Copying these can be expensive. Introducing a // move-only, non-CopyConstructible type will let the compiler ensure // that no copies occur. folly::MoveWrapper should be used when a // large string needs to be curried into a std::function<>, which must // by CopyConstructible. class JSBigString { public: JSBigString() = default; // Not copyable JSBigString(const JSBigString&) = delete; JSBigString& operator=(const JSBigString&) = delete; virtual ~JSBigString() {} virtual bool isAscii() const = 0; virtual const char* c_str() const = 0; virtual size_t size() const = 0; }; // Concrete JSBigString implementation which holds a std::string // instance. class JSBigStdString : public JSBigString { public: JSBigStdString(std::string str, bool isAscii=false) : m_isAscii(isAscii) , m_str(std::move(str)) {} bool isAscii() const override { return m_isAscii; } const char* c_str() const override { return m_str.c_str(); } size_t size() const override { return m_str.size(); } private: bool m_isAscii; std::string m_str; }; // Concrete JSBigString implementation which holds a heap-allocated // buffer, and provides an accessor for writing to it. This can be // used to construct a JSBigString in place, such as by reading from a // file. class JSBigBufferString : public facebook::react::JSBigString { public: JSBigBufferString(size_t size) : m_data(new char[size + 1]) , m_size(size) { // Guarantee nul-termination. The caller is responsible for // filling in the rest of m_data. m_data[m_size] = '\0'; } ~JSBigBufferString() { delete[] m_data; } bool isAscii() const override { return true; } const char* c_str() const override { return m_data; } size_t size() const override { return m_size; } char* data() { return m_data; } private: char* m_data; size_t m_size; }; // JSBigString interface implemented by a file-backed mmap region. class RN_EXPORT JSBigFileString : public JSBigString { public: JSBigFileString(int fd, size_t size, off_t offset = 0) : m_fd {-1} , m_data {nullptr} { folly::checkUnixError( m_fd = dup(fd), "Could not duplicate file descriptor"); // Offsets given to mmap must be page aligend. We abstract away that // restriction by sending a page aligned offset to mmap, and keeping track // of the offset within the page that we must alter the mmap pointer by to // get the final desired offset. auto ps = getpagesize(); auto d = lldiv(offset, ps); m_mapOff = d.quot; m_pageOff = d.rem; m_size = size + m_pageOff; } ~JSBigFileString() { if (m_data) { munmap((void *)m_data, m_size); } close(m_fd); } bool isAscii() const override { return true; } const char *c_str() const override { if (!m_data) { m_data = (const char *)mmap(0, m_size, PROT_READ, MAP_SHARED, m_fd, m_mapOff); CHECK(m_data != MAP_FAILED) << " fd: " << m_fd << " size: " << m_size << " offset: " << m_mapOff << " error: " << std::strerror(errno); } return m_data + m_pageOff; } size_t size() const override { return m_size - m_pageOff; } int fd() const { return m_fd; } static std::unique_ptr<const JSBigFileString> fromPath(const std::string& sourceURL); private: int m_fd; // The file descriptor being mmaped size_t m_size; // The size of the mmaped region size_t m_pageOff; // The offset in the mmaped region to the data. off_t m_mapOff; // The offset in the file to the mmaped region. mutable const char *m_data; // Pointer to the mmaped region. }; class JSBigOptimizedBundleString : public JSBigString { public: enum class Encoding { Unknown, Ascii, Utf8, Utf16, }; JSBigOptimizedBundleString(int fd, size_t size, const uint8_t sha1[20], Encoding encoding) : m_fd(-1), m_size(size), m_encoding(encoding), m_str(nullptr) { folly::checkUnixError( m_fd = dup(fd), "Could not duplicate file descriptor"); memcpy(m_hash, sha1, 20); } ~JSBigOptimizedBundleString() { if (m_str) { CHECK(munmap((void *)m_str, m_size) != -1); } close(m_fd); } bool isAscii() const override { return m_encoding == Encoding::Ascii; } const char* c_str() const override { if (!m_str) { m_str = (const char *)mmap(0, m_size, PROT_READ, MAP_SHARED, m_fd, 0); CHECK(m_str != MAP_FAILED); } return m_str; } size_t size() const override { return m_size; } int fd() const { return m_fd; } const uint8_t* hash() const { return m_hash; } Encoding encoding() const { return m_encoding; } static std::unique_ptr<const JSBigOptimizedBundleString> fromOptimizedBundle(const std::string& bundlePath); private: int m_fd; size_t m_size; uint8_t m_hash[20]; Encoding m_encoding; mutable const char *m_str; }; </s> add </s> remove void NativeToJsBridge::loadOptimizedApplicationScript( std::string bundlePath, std::string sourceURL, int flags) { runOnExecutorQueue( m_mainExecutorToken, [bundlePath=std::move(bundlePath), sourceURL=std::move(sourceURL), flags=flags] (JSExecutor* executor) { executor->loadApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); }); } </s> add </s> remove void loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags); </s> add </s> remove void Instance::loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags) { SystraceSection s("reactbridge_xplat_loadScriptFromOptimizedBundle", "bundlePath", bundlePath); nativeToJsBridge_->loadOptimizedApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); } </s> add </s> remove #ifdef WITH_FBJSCEXTENSIONS virtual void loadApplicationScript( std::string bundlePath, std::string sourceURL, int flags) override; #endif </s> add </s> remove number->unit == YGUnitPixel ? "px" : "%"); </s> add number->unit == YGUnitPoint ? "pt" : "%");
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxNativeModule.cpp
keep keep keep keep replace replace keep keep keep keep keep
<mask> // Copyright 2004-present Facebook. All Rights Reserved. <mask> <mask> #pragma once <mask> <mask> #include "NativeModule.h" <mask> <mask> #include <cxxreact/CxxModule.h> <mask> <mask> namespace facebook { <mask> namespace react { <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "Executor.h" </s> add #include <cxxreact/Executor.h> </s> remove #include "ExecutorToken.h" #include "Executor.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> </s> remove #include <folly/Optional.h> </s> add </s> remove #include <fcntl.h> #include <functional> </s> add </s> remove #include "MessageQueueThread.h" </s> add </s> remove #include <folly/Conv.h> #include <folly/dynamic.h> </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxNativeModule.h
keep add keep keep keep keep keep keep
<mask> <mask> #include <cxxreact/CxxModule.h> <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> class Instance; <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "NativeModule.h" </s> add </s> remove #include "NativeToJsBridge.h" #include "ModuleRegistry.h" #include "NativeModule.h" </s> add </s> add #include <jschelpers/JavaScriptCore.h> </s> remove #include "ExecutorToken.h" #include "NativeModule.h" </s> add #include <folly/dynamic.h> </s> remove #include "Executor.h" #include "ExecutorToken.h" #include "JSCNativeModules.h" </s> add </s> remove #include "Executor.h" #include "JSBundleType.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/JSBundleType.h> #include <cxxreact/JSModulesUnbundle.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/CxxNativeModule.h
keep keep replace replace keep keep replace replace
<mask> #pragma once <mask> <mask> #include <fcntl.h> <mask> #include <functional> <mask> #include <memory> <mask> #include <string> <mask> #include <sys/mman.h> <mask> #include <vector> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include <folly/Exception.h> </s> add #include <cxxreact/JSBigString.h> </s> remove #include <folly/Optional.h> </s> add </s> remove #include "MessageQueueThread.h" </s> add </s> add #include <cxxreact/ModuleRegistry.h> #include <cxxreact/NativeModule.h> #include <cxxreact/NativeToJsBridge.h> </s> remove #include <functional> </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/Executor.h
keep keep keep keep replace keep keep keep replace replace
<mask> #include <string> <mask> #include <sys/mman.h> <mask> #include <vector> <mask> <mask> #include <folly/Exception.h> <mask> #include <folly/Optional.h> <mask> #include <folly/dynamic.h> <mask> <mask> #include "JSModulesUnbundle.h" <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include <sys/mman.h> #include <vector> </s> add </s> remove #include <folly/dynamic.h> </s> add #include <cxxreact/ExecutorToken.h> #include <cxxreact/NativeModule.h> </s> remove #include "ExecutorToken.h" #include "NativeModule.h" </s> add #include <folly/dynamic.h> </s> remove #include <fcntl.h> #include <functional> </s> add </s> add #include <cxxreact/ExecutorToken.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/Executor.h
keep add keep keep keep keep keep keep
<mask> #ifndef RN_EXPORT <mask> #define RN_EXPORT __attribute__((visibility("default"))) <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> #define UNPACKED_JS_SOURCE_PATH_SUFFIX "/bundle.js" <mask> #define UNPACKED_META_PATH_SUFFIX "/bundle.meta" </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "JSModulesUnbundle.h" </s> add #ifndef RN_EXPORT </s> add #include <cxxreact/Executor.h> </s> add #include <cxxreact/NativeModule.h> </s> remove struct _jqplProvider : _jobject {}; using jqplProvider = _jqplProvider*; </s> add namespace facebook { namespace react { </s> remove #include <memory> </s> add #include <cxxreact/MessageQueueThread.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <folly/Optional.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/Executor.h
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> std::shared_ptr<MessageQueueThread> jsQueue) = 0; <mask> virtual ~JSExecutorFactory() {} <mask> }; <mask> <mask> // JSExecutor functions sometimes take large strings, on the order of <mask> // megabytes. Copying these can be expensive. Introducing a <mask> // move-only, non-CopyConstructible type will let the compiler ensure <mask> // that no copies occur. folly::MoveWrapper should be used when a <mask> // large string needs to be curried into a std::function<>, which must <mask> // by CopyConstructible. <mask> <mask> class JSBigString { <mask> public: <mask> JSBigString() = default; <mask> <mask> // Not copyable <mask> JSBigString(const JSBigString&) = delete; <mask> JSBigString& operator=(const JSBigString&) = delete; <mask> <mask> virtual ~JSBigString() {} <mask> <mask> virtual bool isAscii() const = 0; <mask> virtual const char* c_str() const = 0; <mask> virtual size_t size() const = 0; <mask> }; <mask> <mask> // Concrete JSBigString implementation which holds a std::string <mask> // instance. <mask> class JSBigStdString : public JSBigString { <mask> public: <mask> JSBigStdString(std::string str, bool isAscii=false) <mask> : m_isAscii(isAscii) <mask> , m_str(std::move(str)) {} <mask> <mask> bool isAscii() const override { <mask> return m_isAscii; <mask> } <mask> <mask> const char* c_str() const override { <mask> return m_str.c_str(); <mask> } <mask> <mask> size_t size() const override { <mask> return m_str.size(); <mask> } <mask> <mask> private: <mask> bool m_isAscii; <mask> std::string m_str; <mask> }; <mask> <mask> // Concrete JSBigString implementation which holds a heap-allocated <mask> // buffer, and provides an accessor for writing to it. This can be <mask> // used to construct a JSBigString in place, such as by reading from a <mask> // file. <mask> class JSBigBufferString : public facebook::react::JSBigString { <mask> public: <mask> JSBigBufferString(size_t size) <mask> : m_data(new char[size + 1]) <mask> , m_size(size) { <mask> // Guarantee nul-termination. The caller is responsible for <mask> // filling in the rest of m_data. <mask> m_data[m_size] = '\0'; <mask> } <mask> <mask> ~JSBigBufferString() { <mask> delete[] m_data; <mask> } <mask> <mask> bool isAscii() const override { <mask> return true; <mask> } <mask> <mask> const char* c_str() const override { <mask> return m_data; <mask> } <mask> <mask> size_t size() const override { <mask> return m_size; <mask> } <mask> <mask> char* data() { <mask> return m_data; <mask> } <mask> <mask> private: <mask> char* m_data; <mask> size_t m_size; <mask> }; <mask> <mask> // JSBigString interface implemented by a file-backed mmap region. <mask> class RN_EXPORT JSBigFileString : public JSBigString { <mask> public: <mask> <mask> JSBigFileString(int fd, size_t size, off_t offset = 0) <mask> : m_fd {-1} <mask> , m_data {nullptr} <mask> { <mask> folly::checkUnixError( <mask> m_fd = dup(fd), <mask> "Could not duplicate file descriptor"); <mask> <mask> // Offsets given to mmap must be page aligend. We abstract away that <mask> // restriction by sending a page aligned offset to mmap, and keeping track <mask> // of the offset within the page that we must alter the mmap pointer by to <mask> // get the final desired offset. <mask> auto ps = getpagesize(); <mask> auto d = lldiv(offset, ps); <mask> <mask> m_mapOff = d.quot; <mask> m_pageOff = d.rem; <mask> m_size = size + m_pageOff; <mask> } <mask> <mask> ~JSBigFileString() { <mask> if (m_data) { <mask> munmap((void *)m_data, m_size); <mask> } <mask> close(m_fd); <mask> } <mask> <mask> bool isAscii() const override { <mask> return true; <mask> } <mask> <mask> const char *c_str() const override { <mask> if (!m_data) { <mask> m_data = (const char *)mmap(0, m_size, PROT_READ, MAP_SHARED, m_fd, m_mapOff); <mask> CHECK(m_data != MAP_FAILED) <mask> << " fd: " << m_fd <mask> << " size: " << m_size <mask> << " offset: " << m_mapOff <mask> << " error: " << std::strerror(errno); <mask> } <mask> return m_data + m_pageOff; <mask> } <mask> <mask> size_t size() const override { <mask> return m_size - m_pageOff; <mask> } <mask> <mask> int fd() const { <mask> return m_fd; <mask> } <mask> <mask> static std::unique_ptr<const JSBigFileString> fromPath(const std::string& sourceURL); <mask> <mask> private: <mask> int m_fd; // The file descriptor being mmaped <mask> size_t m_size; // The size of the mmaped region <mask> size_t m_pageOff; // The offset in the mmaped region to the data. <mask> off_t m_mapOff; // The offset in the file to the mmaped region. <mask> mutable const char *m_data; // Pointer to the mmaped region. <mask> }; <mask> <mask> class JSBigOptimizedBundleString : public JSBigString { <mask> public: <mask> enum class Encoding { <mask> Unknown, <mask> Ascii, <mask> Utf8, <mask> Utf16, <mask> }; <mask> <mask> JSBigOptimizedBundleString(int fd, size_t size, const uint8_t sha1[20], Encoding encoding) : <mask> m_fd(-1), <mask> m_size(size), <mask> m_encoding(encoding), <mask> m_str(nullptr) <mask> { <mask> folly::checkUnixError( <mask> m_fd = dup(fd), <mask> "Could not duplicate file descriptor"); <mask> <mask> memcpy(m_hash, sha1, 20); <mask> } <mask> <mask> ~JSBigOptimizedBundleString() { <mask> if (m_str) { <mask> CHECK(munmap((void *)m_str, m_size) != -1); <mask> } <mask> close(m_fd); <mask> } <mask> <mask> bool isAscii() const override { <mask> return m_encoding == Encoding::Ascii; <mask> } <mask> <mask> const char* c_str() const override { <mask> if (!m_str) { <mask> m_str = (const char *)mmap(0, m_size, PROT_READ, MAP_SHARED, m_fd, 0); <mask> CHECK(m_str != MAP_FAILED); <mask> } <mask> return m_str; <mask> } <mask> <mask> size_t size() const override { <mask> return m_size; <mask> } <mask> <mask> int fd() const { <mask> return m_fd; <mask> } <mask> <mask> const uint8_t* hash() const { <mask> return m_hash; <mask> } <mask> <mask> Encoding encoding() const { <mask> return m_encoding; <mask> } <mask> <mask> static std::unique_ptr<const JSBigOptimizedBundleString> fromOptimizedBundle(const std::string& bundlePath); <mask> <mask> private: <mask> int m_fd; <mask> size_t m_size; <mask> uint8_t m_hash[20]; <mask> Encoding m_encoding; <mask> mutable const char *m_str; <mask> }; <mask> <mask> class JSExecutor { <mask> public: <mask> /** <mask> * Execute an application script bundle in the JS context. <mask> */ </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove using JQuickPerformanceLogger = JObjectWrapper<jqpl>; </s> add </s> add static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { node->layout.dimensions[YGDimensionHeight] = 0; node->layout.dimensions[YGDimensionWidth] = 0; node->layout.position[YGEdgeTop] = 0; node->layout.position[YGEdgeBottom] = 0; node->layout.position[YGEdgeLeft] = 0; node->layout.position[YGEdgeRight] = 0; const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); YGZeroOutLayoutRecursivly(child); } } </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> add static local_ref<jstring> getJStringFromJSValueRef(JSContextRef ctx, JSValueRef ref) { JSStringRef jsStringRef = JSValueToStringCopy(ctx, ref, nullptr); const JSChar* chars = JSStringGetCharactersPtr(jsStringRef); const size_t length = JSStringGetLength(jsStringRef); local_ref<jstring> returnStr = adopt_local(Environment::current()->NewString(chars, length)); JSStringRelease(jsStringRef); return returnStr; } </s> remove if (alignItem == YGAlignStretch) { const bool isCrossSizeDefinite = (isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionColumn)) || (!isMainAxisRow && YGNodeIsStyleDimDefined(child, YGFlexDirectionRow)); float childWidth; float childHeight; YGMeasureMode childWidthMeasureMode = YGMeasureModeExactly; YGMeasureMode childHeightMeasureMode = YGMeasureModeExactly; const float marginRow = YGNodeMarginForAxis(child, YGFlexDirectionRow, availableInnerWidth); const float marginColumn = YGNodeMarginForAxis(child, YGFlexDirectionColumn, availableInnerWidth); if (isMainAxisRow) { childWidth = child->layout.measuredDimensions[YGDimensionWidth]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childHeight = marginColumn + childWidth / child->style.aspectRatio; } else { childHeight = crossDim; } childWidth += marginRow; } else { childHeight = child->layout.measuredDimensions[YGDimensionHeight]; if (!YGFloatIsUndefined(child->style.aspectRatio)) { childWidth = marginRow + childHeight * child->style.aspectRatio; } else { childWidth = crossDim; } childHeight += marginColumn; } YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionWidth], availableInnerWidth), &childWidthMeasureMode, &childWidth); YGConstrainMaxSizeForMode(YGValueResolve(&child->style.maxDimensions[YGDimensionHeight], availableInnerHeight), &childHeightMeasureMode, &childHeight); </s> add if (alignItem == YGAlignStretch && YGMarginLeadingValue(child, crossAxis)->unit != YGUnitAuto && YGMarginTrailingValue(child, crossAxis)->unit != YGUnitAuto) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/Executor.h
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
<mask> */ <mask> virtual void loadApplicationScript(std::unique_ptr<const JSBigString> script, <mask> std::string sourceURL) = 0; <mask> <mask> /** <mask> * Execute an application script optimized bundle in the JS context. <mask> */ <mask> virtual void loadApplicationScript(std::string bundlePath, std::string source, int flags); <mask> <mask> /** <mask> * Add an application "unbundle" file <mask> */ <mask> virtual void setJSModulesUnbundle(std::unique_ptr<JSModulesUnbundle> bundle) = 0; <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #ifdef WITH_FBJSCEXTENSIONS virtual void loadApplicationScript( std::string bundlePath, std::string sourceURL, int flags) override; #endif </s> add </s> remove void loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags); </s> add </s> remove void Instance::loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags) { SystraceSection s("reactbridge_xplat_loadScriptFromOptimizedBundle", "bundlePath", bundlePath); nativeToJsBridge_->loadOptimizedApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); } </s> add </s> remove void NativeToJsBridge::loadOptimizedApplicationScript( std::string bundlePath, std::string sourceURL, int flags) { runOnExecutorQueue( m_mainExecutorToken, [bundlePath=std::move(bundlePath), sourceURL=std::move(sourceURL), flags=flags] (JSExecutor* executor) { executor->loadApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); }); } </s> add </s> remove import static com.facebook.react.common.LifecycleState.BEFORE_CREATE; import static com.facebook.react.common.LifecycleState.BEFORE_RESUME; import static com.facebook.react.common.LifecycleState.RESUMED; </s> add </s> remove // JSExecutor functions sometimes take large strings, on the order of // megabytes. Copying these can be expensive. Introducing a // move-only, non-CopyConstructible type will let the compiler ensure // that no copies occur. folly::MoveWrapper should be used when a // large string needs to be curried into a std::function<>, which must // by CopyConstructible. class JSBigString { public: JSBigString() = default; // Not copyable JSBigString(const JSBigString&) = delete; JSBigString& operator=(const JSBigString&) = delete; virtual ~JSBigString() {} virtual bool isAscii() const = 0; virtual const char* c_str() const = 0; virtual size_t size() const = 0; }; // Concrete JSBigString implementation which holds a std::string // instance. class JSBigStdString : public JSBigString { public: JSBigStdString(std::string str, bool isAscii=false) : m_isAscii(isAscii) , m_str(std::move(str)) {} bool isAscii() const override { return m_isAscii; } const char* c_str() const override { return m_str.c_str(); } size_t size() const override { return m_str.size(); } private: bool m_isAscii; std::string m_str; }; // Concrete JSBigString implementation which holds a heap-allocated // buffer, and provides an accessor for writing to it. This can be // used to construct a JSBigString in place, such as by reading from a // file. class JSBigBufferString : public facebook::react::JSBigString { public: JSBigBufferString(size_t size) : m_data(new char[size + 1]) , m_size(size) { // Guarantee nul-termination. The caller is responsible for // filling in the rest of m_data. m_data[m_size] = '\0'; } ~JSBigBufferString() { delete[] m_data; } bool isAscii() const override { return true; } const char* c_str() const override { return m_data; } size_t size() const override { return m_size; } char* data() { return m_data; } private: char* m_data; size_t m_size; }; // JSBigString interface implemented by a file-backed mmap region. class RN_EXPORT JSBigFileString : public JSBigString { public: JSBigFileString(int fd, size_t size, off_t offset = 0) : m_fd {-1} , m_data {nullptr} { folly::checkUnixError( m_fd = dup(fd), "Could not duplicate file descriptor"); // Offsets given to mmap must be page aligend. We abstract away that // restriction by sending a page aligned offset to mmap, and keeping track // of the offset within the page that we must alter the mmap pointer by to // get the final desired offset. auto ps = getpagesize(); auto d = lldiv(offset, ps); m_mapOff = d.quot; m_pageOff = d.rem; m_size = size + m_pageOff; } ~JSBigFileString() { if (m_data) { munmap((void *)m_data, m_size); } close(m_fd); } bool isAscii() const override { return true; } const char *c_str() const override { if (!m_data) { m_data = (const char *)mmap(0, m_size, PROT_READ, MAP_SHARED, m_fd, m_mapOff); CHECK(m_data != MAP_FAILED) << " fd: " << m_fd << " size: " << m_size << " offset: " << m_mapOff << " error: " << std::strerror(errno); } return m_data + m_pageOff; } size_t size() const override { return m_size - m_pageOff; } int fd() const { return m_fd; } static std::unique_ptr<const JSBigFileString> fromPath(const std::string& sourceURL); private: int m_fd; // The file descriptor being mmaped size_t m_size; // The size of the mmaped region size_t m_pageOff; // The offset in the mmaped region to the data. off_t m_mapOff; // The offset in the file to the mmaped region. mutable const char *m_data; // Pointer to the mmaped region. }; class JSBigOptimizedBundleString : public JSBigString { public: enum class Encoding { Unknown, Ascii, Utf8, Utf16, }; JSBigOptimizedBundleString(int fd, size_t size, const uint8_t sha1[20], Encoding encoding) : m_fd(-1), m_size(size), m_encoding(encoding), m_str(nullptr) { folly::checkUnixError( m_fd = dup(fd), "Could not duplicate file descriptor"); memcpy(m_hash, sha1, 20); } ~JSBigOptimizedBundleString() { if (m_str) { CHECK(munmap((void *)m_str, m_size) != -1); } close(m_fd); } bool isAscii() const override { return m_encoding == Encoding::Ascii; } const char* c_str() const override { if (!m_str) { m_str = (const char *)mmap(0, m_size, PROT_READ, MAP_SHARED, m_fd, 0); CHECK(m_str != MAP_FAILED); } return m_str; } size_t size() const override { return m_size; } int fd() const { return m_fd; } const uint8_t* hash() const { return m_hash; } Encoding encoding() const { return m_encoding; } static std::unique_ptr<const JSBigOptimizedBundleString> fromOptimizedBundle(const std::string& bundlePath); private: int m_fd; size_t m_size; uint8_t m_hash[20]; Encoding m_encoding; mutable const char *m_str; }; </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/Executor.h
keep keep keep keep replace keep keep keep keep keep
<mask> // Copyright 2004-present Facebook. All Rights Reserved. <mask> <mask> #pragma once <mask> <mask> #include "Executor.h" <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> /** </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "ExecutorToken.h" #include "Executor.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> </s> remove #include "NativeModule.h" </s> add </s> remove #include <folly/Optional.h> </s> add </s> remove #include "MessageQueueThread.h" </s> add </s> remove #include <fcntl.h> #include <functional> </s> add </s> remove #include <folly/Conv.h> #include <folly/dynamic.h> </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/ExecutorToken.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> // Copyright 2004-present Facebook. All Rights Reserved. <mask> <mask> #pragma once <mask> <mask> #include "ExecutorToken.h" <mask> #include "Executor.h" <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> /** </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "Executor.h" </s> add #include <cxxreact/Executor.h> </s> remove #include "NativeModule.h" </s> add </s> remove #include <folly/Optional.h> </s> add </s> remove #include "MessageQueueThread.h" </s> add </s> remove #include <fcntl.h> #include <functional> </s> add </s> remove #include <folly/Conv.h> #include <folly/dynamic.h> </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/ExecutorTokenFactory.h
keep keep keep keep replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> <mask> nativeToJsBridge_->loadApplication(nullptr, std::move(script), sourceURL); <mask> } <mask> <mask> void Instance::loadScriptFromOptimizedBundle(std::string bundlePath, <mask> std::string sourceURL, <mask> int flags) { <mask> SystraceSection s("reactbridge_xplat_loadScriptFromOptimizedBundle", <mask> "bundlePath", bundlePath); <mask> nativeToJsBridge_->loadOptimizedApplicationScript(std::move(bundlePath), <mask> std::move(sourceURL), <mask> flags); <mask> } <mask> <mask> void Instance::loadUnbundle(std::unique_ptr<JSModulesUnbundle> unbundle, <mask> std::unique_ptr<const JSBigString> startupScript, <mask> std::string startupScriptSourceURL) { <mask> callback_->incrementPendingJSCalls(); <mask> nativeToJsBridge_->loadApplication(std::move(unbundle), std::move(startupScript), </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove void loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags); </s> add </s> remove void NativeToJsBridge::loadOptimizedApplicationScript( std::string bundlePath, std::string sourceURL, int flags) { runOnExecutorQueue( m_mainExecutorToken, [bundlePath=std::move(bundlePath), sourceURL=std::move(sourceURL), flags=flags] (JSExecutor* executor) { executor->loadApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); }); } </s> add </s> remove #ifdef WITH_FBJSCEXTENSIONS virtual void loadApplicationScript( std::string bundlePath, std::string sourceURL, int flags) override; #endif </s> add </s> remove void jniLoadScriptFromOptimizedBundle(const std::string& bundlePath, const std::string& sourceURL, jint flags); void callJSFunction(JExecutorToken* token, std::string module, std::string method, NativeArray* arguments); void callJSCallback(JExecutorToken* token, jint callbackId, NativeArray* arguments); </s> add void jniCallJSFunction(JExecutorToken* token, std::string module, std::string method, NativeArray* arguments); void jniCallJSCallback(JExecutorToken* token, jint callbackId, NativeArray* arguments); </s> remove #ifdef WITH_FBJSCEXTENSIONS void JSCExecutor::loadApplicationScript( std::string bundlePath, std::string sourceURL, int flags) { SystraceSection s("JSCExecutor::loadApplicationScript", "sourceURL", sourceURL); if (!(flags & (UNPACKED_JS_SOURCE | UNPACKED_BYTECODE))) { throw RecoverableError("Optimized bundle with no unpacked source or bytecode"); } String jsSourceURL(m_context, sourceURL.c_str()); JSSourceCodeRef sourceCode = nullptr; SCOPE_EXIT { if (sourceCode) { JSReleaseSourceCode(sourceCode); } }; if (flags & UNPACKED_BYTECODE) { int fd = open((bundlePath + UNPACKED_BYTECODE_SUFFIX).c_str(), O_RDONLY); RecoverableError::runRethrowingAsRecoverable<std::system_error>([fd]() { folly::checkUnixError(fd, "Couldn't open compiled bundle"); }); SCOPE_EXIT { close(fd); }; JSLoadSourceStatus jsStatus; sourceCode = JSCreateCompiledSourceCode(fd, jsSourceURL, &jsStatus); if (!sourceCode) { throw RecoverableError(explainLoadSourceStatus(jsStatus)); } } else { auto jsScriptBigString = JSBigOptimizedBundleString::fromOptimizedBundle(bundlePath); if (!jsScriptBigString->isAscii()) { LOG(WARNING) << "Bundle is not ASCII encoded - falling back to the slow path"; return loadApplicationScript(std::move(jsScriptBigString), sourceURL); } sourceCode = JSCreateSourceCode( jsScriptBigString->fd(), jsSourceURL, jsScriptBigString->hash(), true); } ReactMarker::logMarker("RUN_JS_BUNDLE_START"); evaluateSourceCode(m_context, sourceCode, jsSourceURL); bindBridge(); flush(); ReactMarker::logMarker("CREATE_REACT_CONTEXT_END"); ReactMarker::logMarker("RUN_JS_BUNDLE_END"); } #endif </s> add </s> remove /** * Execute an application script optimized bundle in the JS context. */ virtual void loadApplicationScript(std::string bundlePath, std::string source, int flags); </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/Instance.cpp
keep keep keep add keep keep keep keep keep
<mask> #pragma once <mask> <mask> #include <memory> <mask> <mask> #include <folly/dynamic.h> <mask> <mask> namespace facebook { <mask> namespace react { <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #include <cxxreact/Executor.h> </s> remove #include "NativeToJsBridge.h" #include "ModuleRegistry.h" #include "NativeModule.h" </s> add </s> remove #include "Executor.h" </s> add </s> remove #include "NativeModule.h" </s> add </s> remove #include "ExecutorToken.h" #include "Executor.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> </s> remove #include "Executor.h" </s> add #include <cxxreact/Executor.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/Instance.h
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> #include <memory> <mask> <mask> #include <folly/dynamic.h> <mask> <mask> #include "NativeToJsBridge.h" <mask> #include "ModuleRegistry.h" <mask> #include "NativeModule.h" <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> class JSExecutorFactory; <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "ExecutorToken.h" #include "NativeModule.h" </s> add #include <folly/dynamic.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <cxxreact/NativeModule.h> #include <cxxreact/NativeToJsBridge.h> </s> remove #include "Executor.h" #include "JSBundleType.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/JSBundleType.h> #include <cxxreact/JSModulesUnbundle.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <folly/Optional.h> </s> remove #include <memory> </s> add #include <cxxreact/MessageQueueThread.h> </s> add #include <cxxreact/ExecutorToken.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/Instance.h
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> void loadScriptFromString(std::unique_ptr<const JSBigString> string, std::string sourceURL); <mask> void loadScriptFromStringSync(std::unique_ptr<const JSBigString> string, std::string sourceURL); <mask> void loadScriptFromFile(const std::string& filename, const std::string& sourceURL); <mask> void loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags); <mask> void loadUnbundle( <mask> std::unique_ptr<JSModulesUnbundle> unbundle, <mask> std::unique_ptr<const JSBigString> startupScript, <mask> std::string startupScriptSourceURL); <mask> void loadUnbundleSync( </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove void Instance::loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags) { SystraceSection s("reactbridge_xplat_loadScriptFromOptimizedBundle", "bundlePath", bundlePath); nativeToJsBridge_->loadOptimizedApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); } </s> add </s> remove #ifdef WITH_FBJSCEXTENSIONS virtual void loadApplicationScript( std::string bundlePath, std::string sourceURL, int flags) override; #endif </s> add </s> remove void jniLoadScriptFromOptimizedBundle(const std::string& bundlePath, const std::string& sourceURL, jint flags); void callJSFunction(JExecutorToken* token, std::string module, std::string method, NativeArray* arguments); void callJSCallback(JExecutorToken* token, jint callbackId, NativeArray* arguments); </s> add void jniCallJSFunction(JExecutorToken* token, std::string module, std::string method, NativeArray* arguments); void jniCallJSCallback(JExecutorToken* token, jint callbackId, NativeArray* arguments); </s> remove void NativeToJsBridge::loadOptimizedApplicationScript( std::string bundlePath, std::string sourceURL, int flags) { runOnExecutorQueue( m_mainExecutorToken, [bundlePath=std::move(bundlePath), sourceURL=std::move(sourceURL), flags=flags] (JSExecutor* executor) { executor->loadApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); }); } </s> add </s> remove void CatalystInstanceImpl::jniLoadScriptFromOptimizedBundle(const std::string& bundlePath, const std::string& sourceURL, jint flags) { return instance_->loadScriptFromOptimizedBundle(std::move(bundlePath), std::move(sourceURL), flags); } void CatalystInstanceImpl::callJSFunction( </s> add void CatalystInstanceImpl::jniCallJSFunction( </s> remove /** * Execute an application script optimized bundle in the JS context. */ virtual void loadApplicationScript(std::string bundlePath, std::string source, int flags); </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/Instance.h
keep keep replace keep keep replace replace replace
<mask> <mask> static uint32_t constexpr RAMBundleMagicNumber = 0xFB0BD1E5; <mask> static uint64_t constexpr BCBundleMagicNumber = 0xFF4865726D657300; <mask> <mask> ScriptTag parseTypeFromHeader(const BundleHeader& header) { <mask> if (littleEndianToHost(header.RAMMagic) == RAMBundleMagicNumber) { <mask> return ScriptTag::RAMBundle; <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (littleEndianToHost(header.BCMagic) == BCBundleMagicNumber) { </s> add switch (littleEndianToHost(header.magic)) { case RAMBundleMagicNumber: return ScriptTag::RAMBundle; case BCBundleMagicNumber: </s> remove template<> class JObjectWrapper<jqplProvider> : public JObjectWrapper<jobject> { public: static constexpr const char* kJavaDescriptor = "Lcom/facebook/quicklog/QuickPerformanceLoggerProvider;"; </s> add struct JQuickPerformanceLoggerProvider : JavaClass<JQuickPerformanceLoggerProvider> { static auto constexpr kJavaDescriptor = "Lcom/facebook/quicklog/QuickPerformanceLoggerProvider;"; </s> remove using JQuickPerformanceLogger = JObjectWrapper<jqpl>; </s> add </s> remove using JObjectWrapper<jobject>::JObjectWrapper; static global_ref<jqpl> get() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); static global_ref<jqpl> theQpl = make_global(getQPLInstMethod(qplProviderClass().get())); return theQpl; } static bool check() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); auto theQpl = getQPLInstMethod(qplProviderClass().get()); return (theQpl.get() != nullptr); } private: static alias_ref<jclass> qplProviderClass() { static auto cls = findClassStatic("com/facebook/quicklog/QuickPerformanceLoggerProvider"); return cls; </s> add static alias_ref<JQuickPerformanceLogger::javaobject> get() { static auto getQPLInstMethod = javaClassStatic()->getStaticMethod<JQuickPerformanceLogger::javaobject()>("getQPLInstance"); static auto logger = make_global(getQPLInstMethod(javaClassStatic())); return logger; </s> remove struct _jqpl : _jobject {}; using jqpl = _jqpl*; namespace facebook { namespace jni { template<> class JObjectWrapper<jqpl> : public JObjectWrapper<jobject> { public: static constexpr const char* kJavaDescriptor = "Lcom/facebook/quicklog/QuickPerformanceLogger;"; using JObjectWrapper<jobject>::JObjectWrapper; </s> add struct JQuickPerformanceLogger : JavaClass<JQuickPerformanceLogger> { static auto constexpr kJavaDescriptor = "Lcom/facebook/quicklog/QuickPerformanceLogger;";
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSBundleType.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> if (littleEndianToHost(header.RAMMagic) == RAMBundleMagicNumber) { <mask> return ScriptTag::RAMBundle; <mask> } <mask> <mask> if (littleEndianToHost(header.BCMagic) == BCBundleMagicNumber) { <mask> return ScriptTag::BCBundle; <mask> } <mask> <mask> return ScriptTag::String; <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove if (littleEndianToHost(header.RAMMagic) == RAMBundleMagicNumber) { return ScriptTag::RAMBundle; } </s> add </s> remove return ScriptTag::String; </s> add </s> remove static uint64_t constexpr BCBundleMagicNumber = 0xFF4865726D657300; </s> add static uint32_t constexpr BCBundleMagicNumber = 0x6D657300; </s> add default: return ScriptTag::String; </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { </s> remove (YGNodeStyleGetFlexGrow(node) != 0 || YGNodeStyleGetFlexShrink(node) != 0)); </s> add (YGResolveFlexGrow(node) != 0 || YGNodeResolveFlexShrink(node) != 0));
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSBundleType.cpp
keep add keep keep keep keep keep
<mask> case BCBundleMagicNumber: <mask> return ScriptTag::BCBundle; <mask> } <mask> } <mask> <mask> const char *stringForScriptTag(const ScriptTag& tag) { <mask> switch (tag) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove return ScriptTag::String; </s> add </s> remove if (littleEndianToHost(header.BCMagic) == BCBundleMagicNumber) { </s> add switch (littleEndianToHost(header.magic)) { case RAMBundleMagicNumber: return ScriptTag::RAMBundle; case BCBundleMagicNumber: </s> remove const char *reason); </s> add const char *reason, const YGConfigRef config); </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; </s> add int numberOfAutoMarginsOnCurrentLine = 0; for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); if (child->style.positionType == YGPositionTypeRelative) { if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; </s> remove const char *reason) { </s> add const char *reason, const YGConfigRef config) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSBundleType.cpp
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> if (littleEndianToHost(header.BCMagic) == BCBundleMagicNumber) { <mask> return ScriptTag::BCBundle; <mask> } <mask> <mask> return ScriptTag::String; <mask> } <mask> <mask> const char *stringForScriptTag(const ScriptTag& tag) { <mask> switch (tag) { <mask> case ScriptTag::String: </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add default: return ScriptTag::String; </s> remove if (littleEndianToHost(header.BCMagic) == BCBundleMagicNumber) { </s> add switch (littleEndianToHost(header.magic)) { case RAMBundleMagicNumber: return ScriptTag::RAMBundle; case BCBundleMagicNumber: </s> remove if (littleEndianToHost(header.RAMMagic) == RAMBundleMagicNumber) { return ScriptTag::RAMBundle; } </s> add </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove const char *reason); </s> add const char *reason, const YGConfigRef config); </s> remove for (uint32_t i = 0; i < YGNodeGetChildCount(node); i++) { </s> add const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSBundleType.cpp
keep keep keep keep replace keep keep keep keep replace replace replace replace replace keep keep
<mask> * RAM bundles and BC bundles begin with headers. For RAM bundles this is <mask> * 4 bytes, for BC bundles this is 12 bytes. This structure holds the first 12 <mask> * bytes from a bundle in a way that gives access to that information. <mask> */ <mask> union BundleHeader { <mask> BundleHeader() { <mask> std::memset(this, 0, sizeof(BundleHeader)); <mask> } <mask> <mask> uint32_t RAMMagic; <mask> struct { <mask> uint64_t BCMagic; <mask> uint32_t BCVersion; <mask> }; <mask> }; <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add // If this getRunLoop is used, current() will not work. std::function<void()> getUnregisteredRunLoop(); </s> remove // * The 'wrap' property supports only 'nowrap' (which is the default) or // 'wrap'. The // rarely-used 'wrap-reverse' is not supported. // * Rather than allowing arbitrary combinations of flexGrow, flexShrink and // flexBasis, this algorithm supports only the three most common // combinations: // flex: 0 is equiavlent to flex: 0 0 auto // flex: n (where n is a positive value) is equivalent to flex: n 1 auto // If POSITIVE_FLEX_IS_AUTO is 0, then it is equivalent to flex: n 0 0 // This is faster because the content doesn't need to be measured, but // it's // less flexible because the basis is always 0 and can't be overriden // with // the width/height attributes. // flex: -1 (or any negative value) is equivalent to flex: 0 1 auto // * Margins cannot be specified as 'auto'. They must be specified in terms of // pixel // values, and the default value is 0. // * Values of width, maxWidth, minWidth, height, maxHeight and minHeight must // be // specified as pixel values, not as percentages. // * There is no support for calculation of dimensions based on intrinsic // aspect ratios // (e.g. images). </s> add </s> add import com.facebook.react.uimanager.annotations.ReactPropGroup; import com.facebook.yoga.YogaConstants; </s> add import com.facebook.react.views.view.ReactViewBackgroundDrawable; </s> remove -YGNodeStyleGetFlexShrink(child) * child->layout.computedFlexBasis; </s> add -YGNodeResolveFlexShrink(child) * child->layout.computedFlexBasis;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSBundleType.h
keep add keep keep keep keep keep
<mask> #endif <mask> <mask> #include "Platform.h" <mask> #include "SystraceSection.h" <mask> #include "JSCNativeModules.h" <mask> #include "JSCSamplingProfiler.h" <mask> #include "JSCUtils.h" </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "Executor.h" #include "ExecutorToken.h" #include "JSCNativeModules.h" </s> add </s> remove #include <folly/json.h> </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> #include <cxxreact/JSCNativeModules.h> </s> remove #include <jschelpers/JavaScriptCore.h> </s> add #include <folly/json.h> </s> remove #include <sys/mman.h> #include <vector> </s> add </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> #include <cxxreact/JSCExecutor.h> #include <cxxreact/JSModulesUnbundle.h> #include <cxxreact/MessageQueueThread.h> #include <cxxreact/MethodCall.h> #include <cxxreact/NativeModule.h> </s> remove #include <folly/Exception.h> </s> add #include <cxxreact/JSBigString.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> #ifdef WITH_JSC_EXTRA_TRACING <mask> addNativeProfilingHooks(m_context); <mask> addNativeTracingLegacyHooks(m_context); <mask> PerfLogging::installNativeHooks(m_context); <mask> #endif <mask> <mask> #if defined(__APPLE__) || defined(WITH_JSC_EXTRA_TRACING) <mask> if (JSC_JSSamplingProfilerEnabled(m_context)) { <mask> initSamplingProfilerOnMainJSCThread(m_context); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add PerfLogging::installNativeHooks(m_context); </s> remove #if defined(WITH_FB_JSC_TUNING) && defined(__ANDROID__) configureJSContextForAndroid(m_context, m_jscConfig, m_deviceCacheDir); #endif </s> add </s> remove #endif </s> add #elif defined(__APPLE__) BundleHeader header; memcpy(&header, script->c_str(), std::min(script->size(), sizeof(BundleHeader))); auto scriptTag = parseTypeFromHeader(header); </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); #endif </s> add #ifdef WITH_FBSYSTRACE fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); #endif </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> add if (scriptTag == ScriptTag::BCBundle) { using file_ptr = std::unique_ptr<FILE, decltype(&fclose)>; file_ptr source(fopen(sourceURL.c_str(), "r"), fclose); int sourceFD = fileno(source.get()); JSValueRef jsError; JSValueRef result = JSC_JSEvaluateBytecodeBundle(m_context, NULL, sourceFD, jsSourceURL, &jsError); if (result == nullptr) { formatAndThrowJSException(m_context, jsError, jsSourceURL); } } else #endif { #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> remove ReactMarker::logMarker("loadApplicationScript_startStringConvert"); String jsScript = jsStringFromBigString(m_context, *script); ReactMarker::logMarker("loadApplicationScript_endStringConvert"); </s> add ReactMarker::logMarker("loadApplicationScript_startStringConvert"); String jsScript = jsStringFromBigString(m_context, *script); ReactMarker::logMarker("loadApplicationScript_endStringConvert");
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep keep keep add keep keep keep keep
<mask> addNativeProfilingHooks(m_context); <mask> addNativeTracingLegacyHooks(m_context); <mask> #endif <mask> <mask> #if defined(__APPLE__) || defined(WITH_JSC_EXTRA_TRACING) <mask> if (JSC_JSSamplingProfilerEnabled(m_context)) { <mask> initSamplingProfilerOnMainJSCThread(m_context); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove PerfLogging::installNativeHooks(m_context); </s> add </s> remove #if defined(WITH_FB_JSC_TUNING) && defined(__ANDROID__) configureJSContextForAndroid(m_context, m_jscConfig, m_deviceCacheDir); #endif </s> add </s> remove #endif </s> add #elif defined(__APPLE__) BundleHeader header; memcpy(&header, script->c_str(), std::min(script->size(), sizeof(BundleHeader))); auto scriptTag = parseTypeFromHeader(header); </s> remove if (styles.hasKey(PROP_DECOMPOSED_MATRIX) || styles.hasKey(PROP_OPACITY) || </s> add if (styles.hasKey(PROP_OPACITY) || </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> add if (scriptTag == ScriptTag::BCBundle) { using file_ptr = std::unique_ptr<FILE, decltype(&fclose)>; file_ptr source(fopen(sourceURL.c_str(), "r"), fclose); int sourceFD = fileno(source.get()); JSValueRef jsError; JSValueRef result = JSC_JSEvaluateBytecodeBundle(m_context, NULL, sourceFD, jsSourceURL, &jsError); if (result == nullptr) { formatAndThrowJSException(m_context, jsError, jsSourceURL); } } else #endif { #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> remove if (current.unit != YogaUnit.PIXEL || current.value != padding) { </s> add if (current.unit != YogaUnit.POINT || current.value != padding) {
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> <mask> #ifdef JSC_HAS_PERF_STATS_API <mask> addJSCPerfStatsHooks(m_context); <mask> #endif <mask> <mask> #if defined(WITH_FB_JSC_TUNING) && defined(__ANDROID__) <mask> configureJSContextForAndroid(m_context, m_jscConfig, m_deviceCacheDir); <mask> #endif <mask> } <mask> <mask> void JSCExecutor::terminateOnJSVMThread() { <mask> // terminateOwnedWebWorker mutates m_ownedWorkers so collect all the workers <mask> // to terminate first </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove PerfLogging::installNativeHooks(m_context); </s> add </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); #endif </s> add #ifdef WITH_FBSYSTRACE fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); #endif </s> add PerfLogging::installNativeHooks(m_context); </s> remove #endif </s> add #elif defined(__APPLE__) BundleHeader header; memcpy(&header, script->c_str(), std::min(script->size(), sizeof(BundleHeader))); auto scriptTag = parseTypeFromHeader(header); </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> add if (scriptTag == ScriptTag::BCBundle) { using file_ptr = std::unique_ptr<FILE, decltype(&fclose)>; file_ptr source(fopen(sourceURL.c_str(), "r"), fclose); int sourceFD = fileno(source.get()); JSValueRef jsError; JSValueRef result = JSC_JSEvaluateBytecodeBundle(m_context, NULL, sourceFD, jsSourceURL, &jsError); if (result == nullptr) { formatAndThrowJSException(m_context, jsError, jsSourceURL); } } else #endif { #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> remove ReactMarker::logMarker("loadApplicationScript_startStringConvert"); String jsScript = jsStringFromBigString(m_context, *script); ReactMarker::logMarker("loadApplicationScript_endStringConvert"); </s> add ReactMarker::logMarker("loadApplicationScript_startStringConvert"); String jsScript = jsStringFromBigString(m_context, *script); ReactMarker::logMarker("loadApplicationScript_endStringConvert");
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> } <mask> } <mask> #endif <mask> <mask> #ifdef WITH_FBJSCEXTENSIONS <mask> void JSCExecutor::loadApplicationScript( <mask> std::string bundlePath, <mask> std::string sourceURL, <mask> int flags) { <mask> SystraceSection s("JSCExecutor::loadApplicationScript", <mask> "sourceURL", sourceURL); <mask> <mask> if (!(flags & (UNPACKED_JS_SOURCE | UNPACKED_BYTECODE))) { <mask> throw RecoverableError("Optimized bundle with no unpacked source or bytecode"); <mask> } <mask> <mask> String jsSourceURL(m_context, sourceURL.c_str()); <mask> JSSourceCodeRef sourceCode = nullptr; <mask> SCOPE_EXIT { <mask> if (sourceCode) { <mask> JSReleaseSourceCode(sourceCode); <mask> } <mask> }; <mask> <mask> if (flags & UNPACKED_BYTECODE) { <mask> int fd = open((bundlePath + UNPACKED_BYTECODE_SUFFIX).c_str(), O_RDONLY); <mask> RecoverableError::runRethrowingAsRecoverable<std::system_error>([fd]() { <mask> folly::checkUnixError(fd, "Couldn't open compiled bundle"); <mask> }); <mask> SCOPE_EXIT { close(fd); }; <mask> <mask> JSLoadSourceStatus jsStatus; <mask> sourceCode = JSCreateCompiledSourceCode(fd, jsSourceURL, &jsStatus); <mask> <mask> if (!sourceCode) { <mask> throw RecoverableError(explainLoadSourceStatus(jsStatus)); <mask> } <mask> } else { <mask> auto jsScriptBigString = JSBigOptimizedBundleString::fromOptimizedBundle(bundlePath); <mask> if (!jsScriptBigString->isAscii()) { <mask> LOG(WARNING) << "Bundle is not ASCII encoded - falling back to the slow path"; <mask> return loadApplicationScript(std::move(jsScriptBigString), sourceURL); <mask> } <mask> <mask> sourceCode = JSCreateSourceCode( <mask> jsScriptBigString->fd(), <mask> jsSourceURL, <mask> jsScriptBigString->hash(), <mask> true); <mask> } <mask> <mask> ReactMarker::logMarker("RUN_JS_BUNDLE_START"); <mask> <mask> evaluateSourceCode(m_context, sourceCode, jsSourceURL); <mask> <mask> bindBridge(); <mask> <mask> flush(); <mask> ReactMarker::logMarker("CREATE_REACT_CONTEXT_END"); <mask> ReactMarker::logMarker("RUN_JS_BUNDLE_END"); <mask> } <mask> #endif <mask> <mask> void JSCExecutor::loadApplicationScript(std::unique_ptr<const JSBigString> script, std::string sourceURL) { <mask> SystraceSection s("JSCExecutor::loadApplicationScript", <mask> "sourceURL", sourceURL); <mask> <mask> ReactMarker::logMarker("RUN_JS_BUNDLE_START"); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove auto bcSourceCode = JSCreateCompiledSourceCode(fileStr->fd(), jsSourceURL, &jsStatus); </s> add auto bcSourceCode = JSCreateSourceCodeFromFile(fileStr->fd(), jsSourceURL, nullptr, &jsStatus); </s> remove void Instance::loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags) { SystraceSection s("reactbridge_xplat_loadScriptFromOptimizedBundle", "bundlePath", bundlePath); nativeToJsBridge_->loadOptimizedApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); } </s> add </s> remove #ifdef WITH_FBJSCEXTENSIONS virtual void loadApplicationScript( std::string bundlePath, std::string sourceURL, int flags) override; #endif </s> add </s> add // TODO t15069155: reduce the number of overrides here </s> remove void loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags); </s> add </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> add if (scriptTag == ScriptTag::BCBundle) { using file_ptr = std::unique_ptr<FILE, decltype(&fclose)>; file_ptr source(fopen(sourceURL.c_str(), "r"), fclose); int sourceFD = fileno(source.get()); JSValueRef jsError; JSValueRef result = JSC_JSEvaluateBytecodeBundle(m_context, NULL, sourceFD, jsSourceURL, &jsError); if (result == nullptr) { formatAndThrowJSException(m_context, jsError, jsSourceURL); } } else #endif { #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep add keep keep keep keep keep keep
<mask> String jsSourceURL(m_context, sourceURL.c_str()); <mask> <mask> #ifdef WITH_FBJSCEXTENSIONS <mask> if (auto fileStr = dynamic_cast<const JSBigFileString *>(script.get())) { <mask> JSLoadSourceStatus jsStatus; <mask> auto bcSourceCode = JSCreateSourceCodeFromFile(fileStr->fd(), jsSourceURL, nullptr, &jsStatus); <mask> <mask> switch (jsStatus) { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove auto bcSourceCode = JSCreateCompiledSourceCode(fileStr->fd(), jsSourceURL, &jsStatus); </s> add auto bcSourceCode = JSCreateSourceCodeFromFile(fileStr->fd(), jsSourceURL, nullptr, &jsStatus); </s> remove #ifdef WITH_FBJSCEXTENSIONS void JSCExecutor::loadApplicationScript( std::string bundlePath, std::string sourceURL, int flags) { SystraceSection s("JSCExecutor::loadApplicationScript", "sourceURL", sourceURL); if (!(flags & (UNPACKED_JS_SOURCE | UNPACKED_BYTECODE))) { throw RecoverableError("Optimized bundle with no unpacked source or bytecode"); } String jsSourceURL(m_context, sourceURL.c_str()); JSSourceCodeRef sourceCode = nullptr; SCOPE_EXIT { if (sourceCode) { JSReleaseSourceCode(sourceCode); } }; if (flags & UNPACKED_BYTECODE) { int fd = open((bundlePath + UNPACKED_BYTECODE_SUFFIX).c_str(), O_RDONLY); RecoverableError::runRethrowingAsRecoverable<std::system_error>([fd]() { folly::checkUnixError(fd, "Couldn't open compiled bundle"); }); SCOPE_EXIT { close(fd); }; JSLoadSourceStatus jsStatus; sourceCode = JSCreateCompiledSourceCode(fd, jsSourceURL, &jsStatus); if (!sourceCode) { throw RecoverableError(explainLoadSourceStatus(jsStatus)); } } else { auto jsScriptBigString = JSBigOptimizedBundleString::fromOptimizedBundle(bundlePath); if (!jsScriptBigString->isAscii()) { LOG(WARNING) << "Bundle is not ASCII encoded - falling back to the slow path"; return loadApplicationScript(std::move(jsScriptBigString), sourceURL); } sourceCode = JSCreateSourceCode( jsScriptBigString->fd(), jsSourceURL, jsScriptBigString->hash(), true); } ReactMarker::logMarker("RUN_JS_BUNDLE_START"); evaluateSourceCode(m_context, sourceCode, jsSourceURL); bindBridge(); flush(); ReactMarker::logMarker("CREATE_REACT_CONTEXT_END"); ReactMarker::logMarker("RUN_JS_BUNDLE_END"); } #endif </s> add </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> add if (scriptTag == ScriptTag::BCBundle) { using file_ptr = std::unique_ptr<FILE, decltype(&fclose)>; file_ptr source(fopen(sourceURL.c_str(), "r"), fclose); int sourceFD = fileno(source.get()); JSValueRef jsError; JSValueRef result = JSC_JSEvaluateBytecodeBundle(m_context, NULL, sourceFD, jsSourceURL, &jsError); if (result == nullptr) { formatAndThrowJSException(m_context, jsError, jsSourceURL); } } else #endif { #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> remove ReactMarker::logMarker("loadApplicationScript_startStringConvert"); String jsScript = jsStringFromBigString(m_context, *script); ReactMarker::logMarker("loadApplicationScript_endStringConvert"); </s> add ReactMarker::logMarker("loadApplicationScript_startStringConvert"); String jsScript = jsStringFromBigString(m_context, *script); ReactMarker::logMarker("loadApplicationScript_endStringConvert"); </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); #endif </s> add #ifdef WITH_FBSYSTRACE fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); #endif </s> remove using JObjectWrapper<jobject>::JObjectWrapper; static global_ref<jqpl> get() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); static global_ref<jqpl> theQpl = make_global(getQPLInstMethod(qplProviderClass().get())); return theQpl; } static bool check() { static auto getQPLInstMethod = qplProviderClass()->getStaticMethod<jqpl()>("getQPLInstance"); auto theQpl = getQPLInstMethod(qplProviderClass().get()); return (theQpl.get() != nullptr); } private: static alias_ref<jclass> qplProviderClass() { static auto cls = findClassStatic("com/facebook/quicklog/QuickPerformanceLoggerProvider"); return cls; </s> add static alias_ref<JQuickPerformanceLogger::javaobject> get() { static auto getQPLInstMethod = javaClassStatic()->getStaticMethod<JQuickPerformanceLogger::javaobject()>("getQPLInstance"); static auto logger = make_global(getQPLInstMethod(javaClassStatic())); return logger;
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> <mask> #ifdef WITH_FBJSCEXTENSIONS <mask> if (auto fileStr = dynamic_cast<const JSBigFileString *>(script.get())) { <mask> JSLoadSourceStatus jsStatus; <mask> auto bcSourceCode = JSCreateCompiledSourceCode(fileStr->fd(), jsSourceURL, &jsStatus); <mask> <mask> switch (jsStatus) { <mask> case JSLoadSourceIsCompiled: <mask> if (!bcSourceCode) { <mask> throw std::runtime_error("Unexpected error opening compiled bundle"); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add // TODO t15069155: reduce the number of overrides here </s> remove #ifdef WITH_FBJSCEXTENSIONS void JSCExecutor::loadApplicationScript( std::string bundlePath, std::string sourceURL, int flags) { SystraceSection s("JSCExecutor::loadApplicationScript", "sourceURL", sourceURL); if (!(flags & (UNPACKED_JS_SOURCE | UNPACKED_BYTECODE))) { throw RecoverableError("Optimized bundle with no unpacked source or bytecode"); } String jsSourceURL(m_context, sourceURL.c_str()); JSSourceCodeRef sourceCode = nullptr; SCOPE_EXIT { if (sourceCode) { JSReleaseSourceCode(sourceCode); } }; if (flags & UNPACKED_BYTECODE) { int fd = open((bundlePath + UNPACKED_BYTECODE_SUFFIX).c_str(), O_RDONLY); RecoverableError::runRethrowingAsRecoverable<std::system_error>([fd]() { folly::checkUnixError(fd, "Couldn't open compiled bundle"); }); SCOPE_EXIT { close(fd); }; JSLoadSourceStatus jsStatus; sourceCode = JSCreateCompiledSourceCode(fd, jsSourceURL, &jsStatus); if (!sourceCode) { throw RecoverableError(explainLoadSourceStatus(jsStatus)); } } else { auto jsScriptBigString = JSBigOptimizedBundleString::fromOptimizedBundle(bundlePath); if (!jsScriptBigString->isAscii()) { LOG(WARNING) << "Bundle is not ASCII encoded - falling back to the slow path"; return loadApplicationScript(std::move(jsScriptBigString), sourceURL); } sourceCode = JSCreateSourceCode( jsScriptBigString->fd(), jsSourceURL, jsScriptBigString->hash(), true); } ReactMarker::logMarker("RUN_JS_BUNDLE_START"); evaluateSourceCode(m_context, sourceCode, jsSourceURL); bindBridge(); flush(); ReactMarker::logMarker("CREATE_REACT_CONTEXT_END"); ReactMarker::logMarker("RUN_JS_BUNDLE_END"); } #endif </s> add </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; } </s> remove switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; </s> add int numberOfAutoMarginsOnCurrentLine = 0; for (uint32_t i = startOfLineIndex; i < endOfLineIndex; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); if (child->style.positionType == YGPositionTypeRelative) { if (YGMarginLeadingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> add if (scriptTag == ScriptTag::BCBundle) { using file_ptr = std::unique_ptr<FILE, decltype(&fclose)>; file_ptr source(fopen(sourceURL.c_str(), "r"), fclose); int sourceFD = fileno(source.get()); JSValueRef jsError; JSValueRef result = JSC_JSEvaluateBytecodeBundle(m_context, NULL, sourceFD, jsSourceURL, &jsError); if (result == nullptr) { formatAndThrowJSException(m_context, jsError, jsSourceURL); } } else #endif { #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> remove break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; </s> add if (YGMarginTrailingValue(child, mainAxis)->unit == YGUnitAuto) { numberOfAutoMarginsOnCurrentLine++; } } } if (numberOfAutoMarginsOnCurrentLine == 0) { switch (justifyContent) { case YGJustifyCenter: leadingMainDim = remainingFreeSpace / 2; break; case YGJustifyFlexEnd: leadingMainDim = remainingFreeSpace; break; case YGJustifySpaceBetween: if (itemsOnLine > 1) { betweenMainDim = fmaxf(remainingFreeSpace, 0) / (itemsOnLine - 1); } else { betweenMainDim = 0; } break; case YGJustifySpaceAround: // Space on the edges is half of the space between elements betweenMainDim = remainingFreeSpace / itemsOnLine; leadingMainDim = betweenMainDim / 2; break; case YGJustifyFlexStart: break; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep keep replace keep replace replace replace replace replace keep keep
<mask> } <mask> } <mask> #endif <mask> <mask> #ifdef WITH_FBSYSTRACE <mask> fbsystrace_begin_section( <mask> TRACE_TAG_REACT_CXX_BRIDGE, <mask> "JSCExecutor::loadApplicationScript-createExpectingAscii"); <mask> #endif <mask> <mask> ReactMarker::logMarker("loadApplicationScript_startStringConvert"); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove ReactMarker::logMarker("loadApplicationScript_startStringConvert"); String jsScript = jsStringFromBigString(m_context, *script); ReactMarker::logMarker("loadApplicationScript_endStringConvert"); </s> add ReactMarker::logMarker("loadApplicationScript_startStringConvert"); String jsScript = jsStringFromBigString(m_context, *script); ReactMarker::logMarker("loadApplicationScript_endStringConvert"); </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); #endif </s> add #ifdef WITH_FBSYSTRACE fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); #endif </s> remove evaluateScript(m_context, jsScript, jsSourceURL); </s> add evaluateScript(m_context, jsScript, jsSourceURL); } </s> remove #if defined(WITH_FB_JSC_TUNING) && defined(__ANDROID__) configureJSContextForAndroid(m_context, m_jscConfig, m_deviceCacheDir); #endif </s> add </s> remove PerfLogging::installNativeHooks(m_context); </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep keep replace replace replace keep replace replace replace keep keep
<mask> #endif <mask> <mask> ReactMarker::logMarker("loadApplicationScript_startStringConvert"); <mask> String jsScript = jsStringFromBigString(m_context, *script); <mask> ReactMarker::logMarker("loadApplicationScript_endStringConvert"); <mask> <mask> #ifdef WITH_FBSYSTRACE <mask> fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); <mask> #endif <mask> <mask> evaluateScript(m_context, jsScript, jsSourceURL); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> add if (scriptTag == ScriptTag::BCBundle) { using file_ptr = std::unique_ptr<FILE, decltype(&fclose)>; file_ptr source(fopen(sourceURL.c_str(), "r"), fclose); int sourceFD = fileno(source.get()); JSValueRef jsError; JSValueRef result = JSC_JSEvaluateBytecodeBundle(m_context, NULL, sourceFD, jsSourceURL, &jsError); if (result == nullptr) { formatAndThrowJSException(m_context, jsError, jsSourceURL); } } else #endif { #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> remove evaluateScript(m_context, jsScript, jsSourceURL); </s> add evaluateScript(m_context, jsScript, jsSourceURL); } </s> remove #endif </s> add #elif defined(__APPLE__) BundleHeader header; memcpy(&header, script->c_str(), std::min(script->size(), sizeof(BundleHeader))); auto scriptTag = parseTypeFromHeader(header); </s> remove #if defined(WITH_FB_JSC_TUNING) && defined(__ANDROID__) configureJSContextForAndroid(m_context, m_jscConfig, m_deviceCacheDir); #endif </s> add </s> remove PerfLogging::installNativeHooks(m_context); </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> #ifdef WITH_FBSYSTRACE <mask> fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); <mask> #endif <mask> <mask> evaluateScript(m_context, jsScript, jsSourceURL); <mask> <mask> // TODO(luk): t13903306 Remove this check once we make native modules working for java2js <mask> if (m_delegate) { <mask> bindBridge(); <mask> flush(); </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); #endif </s> add #ifdef WITH_FBSYSTRACE fbsystrace_end_section(TRACE_TAG_REACT_CXX_BRIDGE); #endif </s> remove ReactMarker::logMarker("loadApplicationScript_startStringConvert"); String jsScript = jsStringFromBigString(m_context, *script); ReactMarker::logMarker("loadApplicationScript_endStringConvert"); </s> add ReactMarker::logMarker("loadApplicationScript_startStringConvert"); String jsScript = jsStringFromBigString(m_context, *script); ReactMarker::logMarker("loadApplicationScript_endStringConvert"); </s> remove #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> add if (scriptTag == ScriptTag::BCBundle) { using file_ptr = std::unique_ptr<FILE, decltype(&fclose)>; file_ptr source(fopen(sourceURL.c_str(), "r"), fclose); int sourceFD = fileno(source.get()); JSValueRef jsError; JSValueRef result = JSC_JSEvaluateBytecodeBundle(m_context, NULL, sourceFD, jsSourceURL, &jsError); if (result == nullptr) { formatAndThrowJSException(m_context, jsError, jsSourceURL); } } else #endif { #ifdef WITH_FBSYSTRACE fbsystrace_begin_section( TRACE_TAG_REACT_CXX_BRIDGE, "JSCExecutor::loadApplicationScript-createExpectingAscii"); #endif </s> remove #endif </s> add #elif defined(__APPLE__) BundleHeader header; memcpy(&header, script->c_str(), std::min(script->size(), sizeof(BundleHeader))); auto scriptTag = parseTypeFromHeader(header); </s> remove #ifdef WITH_FBJSCEXTENSIONS void JSCExecutor::loadApplicationScript( std::string bundlePath, std::string sourceURL, int flags) { SystraceSection s("JSCExecutor::loadApplicationScript", "sourceURL", sourceURL); if (!(flags & (UNPACKED_JS_SOURCE | UNPACKED_BYTECODE))) { throw RecoverableError("Optimized bundle with no unpacked source or bytecode"); } String jsSourceURL(m_context, sourceURL.c_str()); JSSourceCodeRef sourceCode = nullptr; SCOPE_EXIT { if (sourceCode) { JSReleaseSourceCode(sourceCode); } }; if (flags & UNPACKED_BYTECODE) { int fd = open((bundlePath + UNPACKED_BYTECODE_SUFFIX).c_str(), O_RDONLY); RecoverableError::runRethrowingAsRecoverable<std::system_error>([fd]() { folly::checkUnixError(fd, "Couldn't open compiled bundle"); }); SCOPE_EXIT { close(fd); }; JSLoadSourceStatus jsStatus; sourceCode = JSCreateCompiledSourceCode(fd, jsSourceURL, &jsStatus); if (!sourceCode) { throw RecoverableError(explainLoadSourceStatus(jsStatus)); } } else { auto jsScriptBigString = JSBigOptimizedBundleString::fromOptimizedBundle(bundlePath); if (!jsScriptBigString->isAscii()) { LOG(WARNING) << "Bundle is not ASCII encoded - falling back to the slow path"; return loadApplicationScript(std::move(jsScriptBigString), sourceURL); } sourceCode = JSCreateSourceCode( jsScriptBigString->fd(), jsSourceURL, jsScriptBigString->hash(), true); } ReactMarker::logMarker("RUN_JS_BUNDLE_START"); evaluateSourceCode(m_context, sourceCode, jsSourceURL); bindBridge(); flush(); ReactMarker::logMarker("CREATE_REACT_CONTEXT_END"); ReactMarker::logMarker("RUN_JS_BUNDLE_END"); } #endif </s> add </s> remove #if defined(WITH_FB_JSC_TUNING) && defined(__ANDROID__) configureJSContextForAndroid(m_context, m_jscConfig, m_deviceCacheDir); #endif </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> Value::fromDynamic(m_context, std::move(arguments)) <mask> }); <mask> } catch (...) { <mask> std::throw_with_nested( <mask> std::runtime_error("Error calling function: " + moduleId + ":" + methodId)); <mask> } <mask> }(); <mask> <mask> callNativeModules(std::move(result)); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove std::runtime_error(folly::to<std::string>("Error invoking callback.", callbackId))); </s> add std::runtime_error(folly::to<std::string>("Error invoking callback ", callbackId))); </s> add responder.respond(response.body().string()); } }); } </s> remove @Override public void onResponse(Call call, Response response) throws IOException { if (!response.isSuccessful()) { Log.e("JSCHeapCapture", "Upload of heap capture failed with code: " + Integer.toString(response.code())); } } }); } </s> add @Override public void onFailure(JSCHeapCapture.CaptureException e) { String message = "Heap capture failed: " + e.toString(); Log.e("JSCHeapCapture", message); responder.error(message); </s> remove mDrawCommands[commandIndex++].draw(mFlatViewGroup, canvas); </s> add DrawCommand command = mDrawCommands[commandIndex++]; if (command instanceof DrawView) { // We should never have more DrawView commands at this point. But in case we do, fail safely // by ignoring the DrawView command FLog.w( TAG, "Unexpected DrawView command at index " + (commandIndex-1) + " with mStop=" + mStop + ". " + Arrays.toString(mDrawCommands)); continue; } command.draw(mFlatViewGroup, canvas); </s> remove private static synchronized void unregisterHeapCapture(JSCHeapCapture dumper) { sRegisteredDumpers.remove(dumper); } public static synchronized void captureHeap(String path, final CaptureCallback callback) { final LinkedList<File> captureFiles = new LinkedList<>(); final LinkedList<CaptureException> captureFailures = new LinkedList<>(); if (sRegisteredDumpers.isEmpty()) { captureFailures.add(new CaptureException("No JSC registered")); callback.onComplete(captureFiles, captureFailures); return; } int disambiguate = 0; File f = new File(path + "/capture" + Integer.toString(disambiguate) + ".json"); while (f.delete()) { disambiguate++; f = new File(path + "/capture" + Integer.toString(disambiguate) + ".json"); } final int numRegisteredDumpers = sRegisteredDumpers.size(); disambiguate = 0; for (JSCHeapCapture dumper : sRegisteredDumpers) { File file = new File(path + "/capture" + Integer.toString(disambiguate) + ".json"); dumper.captureHeapHelper(file, new PerCaptureCallback() { @Override public void onSuccess(File capture) { captureFiles.add(capture); if (captureFiles.size() + captureFailures.size() == numRegisteredDumpers) { callback.onComplete(captureFiles, captureFailures); } } @Override public void onFailure(CaptureException cause) { captureFailures.add(cause); if (captureFiles.size() + captureFailures.size() == numRegisteredDumpers) { callback.onComplete(captureFiles, captureFailures); } } }); } } </s> add private @Nullable CaptureCallback mCaptureInProgress; </s> remove for (File path : captures) { RequestBody body = RequestBody.create(MediaType.parse("application/json"), path); Request request = new Request.Builder() .url(uploadUrl) .method("POST", body) .build(); Call call = httpClient.newCall(request); call.enqueue(new Callback() { @Override public void onFailure(Call call, IOException e) { Log.e("JSCHeapCapture", "Upload of heap capture failed: " + e.toString()); </s> add @Override public void onResponse(Call call, Response response) throws IOException { if (!response.isSuccessful()) { String message = "Upload of heap capture failed with code " + Integer.toString(response.code()) + ": " + response.body().string(); Log.e("JSCHeapCapture", message); responder.error(message);
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> Value::fromDynamic(m_context, std::move(arguments)) <mask> }); <mask> } catch (...) { <mask> std::throw_with_nested( <mask> std::runtime_error(folly::to<std::string>("Error invoking callback.", callbackId))); <mask> } <mask> }(); <mask> <mask> callNativeModules(std::move(result)); <mask> } </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove std::runtime_error("Error calling function: " + moduleId + ":" + methodId)); </s> add std::runtime_error("Error calling " + moduleId + "." + methodId)); </s> remove listener.onHostResume(); </s> add try { listener.onHostResume(); } catch (RuntimeException e) { handleException(e); } </s> remove YGMakeNativeMethod(jni_YGSetExperimentalFeatureEnabled), YGMakeNativeMethod(jni_YGIsExperimentalFeatureEnabled), </s> add }); registerNatives("com/facebook/yoga/YogaConfig", { YGMakeNativeMethod(jni_YGConfigNew), YGMakeNativeMethod(jni_YGConfigFree), YGMakeNativeMethod(jni_YGConfigSetExperimentalFeatureEnabled), </s> remove } catch (IOException e) { showNewJavaError(e.getMessage(), e); </s> add </s> remove listener.onHostDestroy(); </s> add try { listener.onHostDestroy(); } catch (RuntimeException e) { handleException(e); } </s> remove m_callback->onBatchComplete(); </s> add if (m_batchHadNativeModuleCalls) { m_callback->onBatchComplete(); m_batchHadNativeModuleCalls = false; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.cpp
keep keep replace keep replace replace keep keep keep
<mask> #include <unordered_map> <mask> <mask> #include <folly/json.h> <mask> #include <folly/Optional.h> <mask> <mask> #include <jschelpers/JavaScriptCore.h> <mask> #include <jschelpers/JSCHelpers.h> <mask> #include <jschelpers/Value.h> <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #include <jschelpers/JavaScriptCore.h> </s> remove #include "Executor.h" #include "ExecutorToken.h" #include "JSCNativeModules.h" </s> add </s> add #include <cxxreact/ModuleRegistry.h> #include <folly/Optional.h> </s> remove #include <folly/Optional.h> </s> add </s> remove #include <sys/mman.h> #include <vector> </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.h
keep keep keep add keep keep keep keep keep keep
<mask> #include <cxxreact/JSCNativeModules.h> <mask> #include <folly/Optional.h> <mask> #include <folly/json.h> <mask> #include <jschelpers/JSCHelpers.h> <mask> #include <jschelpers/Value.h> <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> class MessageQueueThread; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "Executor.h" #include "ExecutorToken.h" #include "JSCNativeModules.h" </s> add </s> remove #include <folly/json.h> </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> #include <cxxreact/JSCNativeModules.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <folly/Optional.h> </s> remove #include "ExecutorToken.h" #include "NativeModule.h" </s> add #include <folly/dynamic.h> </s> remove #include <jschelpers/JavaScriptCore.h> </s> add #include <folly/json.h> </s> remove #include "JSModulesUnbundle.h" </s> add #ifndef RN_EXPORT
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.h
keep keep keep keep replace replace replace replace keep keep keep keep keep
<mask> #include <jschelpers/JavaScriptCore.h> <mask> #include <jschelpers/JSCHelpers.h> <mask> #include <jschelpers/Value.h> <mask> <mask> #include "Executor.h" <mask> #include "ExecutorToken.h" <mask> #include "JSCNativeModules.h" <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> class MessageQueueThread; <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #include <jschelpers/JavaScriptCore.h> </s> remove #include <jschelpers/JavaScriptCore.h> </s> add #include <folly/json.h> </s> remove #include "ExecutorToken.h" #include "NativeModule.h" </s> add #include <folly/dynamic.h> </s> remove #include "Executor.h" #include "JSBundleType.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/JSBundleType.h> #include <cxxreact/JSModulesUnbundle.h> </s> remove #include "ExecutorToken.h" #include "Executor.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <folly/Optional.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.h
keep keep keep keep replace replace replace replace replace replace replace keep keep keep keep keep
<mask> virtual void loadApplicationScript( <mask> std::unique_ptr<const JSBigString> script, <mask> std::string sourceURL) override; <mask> <mask> #ifdef WITH_FBJSCEXTENSIONS <mask> virtual void loadApplicationScript( <mask> std::string bundlePath, <mask> std::string sourceURL, <mask> int flags) override; <mask> #endif <mask> <mask> virtual void setJSModulesUnbundle( <mask> std::unique_ptr<JSModulesUnbundle> unbundle) override; <mask> <mask> virtual void callFunction( <mask> const std::string& moduleId, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove /** * Execute an application script optimized bundle in the JS context. */ virtual void loadApplicationScript(std::string bundlePath, std::string source, int flags); </s> add </s> remove void loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags); </s> add </s> remove void NativeToJsBridge::loadOptimizedApplicationScript( std::string bundlePath, std::string sourceURL, int flags) { runOnExecutorQueue( m_mainExecutorToken, [bundlePath=std::move(bundlePath), sourceURL=std::move(sourceURL), flags=flags] (JSExecutor* executor) { executor->loadApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); }); } </s> add </s> remove void Instance::loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags) { SystraceSection s("reactbridge_xplat_loadScriptFromOptimizedBundle", "bundlePath", bundlePath); nativeToJsBridge_->loadOptimizedApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); } </s> add </s> remove void jniLoadScriptFromOptimizedBundle(const std::string& bundlePath, const std::string& sourceURL, jint flags); void callJSFunction(JExecutorToken* token, std::string module, std::string method, NativeArray* arguments); void callJSCallback(JExecutorToken* token, jint callbackId, NativeArray* arguments); </s> add void jniCallJSFunction(JExecutorToken* token, std::string module, std::string method, NativeArray* arguments); void jniCallJSCallback(JExecutorToken* token, jint callbackId, NativeArray* arguments); </s> remove #ifdef WITH_FBJSCEXTENSIONS void JSCExecutor::loadApplicationScript( std::string bundlePath, std::string sourceURL, int flags) { SystraceSection s("JSCExecutor::loadApplicationScript", "sourceURL", sourceURL); if (!(flags & (UNPACKED_JS_SOURCE | UNPACKED_BYTECODE))) { throw RecoverableError("Optimized bundle with no unpacked source or bytecode"); } String jsSourceURL(m_context, sourceURL.c_str()); JSSourceCodeRef sourceCode = nullptr; SCOPE_EXIT { if (sourceCode) { JSReleaseSourceCode(sourceCode); } }; if (flags & UNPACKED_BYTECODE) { int fd = open((bundlePath + UNPACKED_BYTECODE_SUFFIX).c_str(), O_RDONLY); RecoverableError::runRethrowingAsRecoverable<std::system_error>([fd]() { folly::checkUnixError(fd, "Couldn't open compiled bundle"); }); SCOPE_EXIT { close(fd); }; JSLoadSourceStatus jsStatus; sourceCode = JSCreateCompiledSourceCode(fd, jsSourceURL, &jsStatus); if (!sourceCode) { throw RecoverableError(explainLoadSourceStatus(jsStatus)); } } else { auto jsScriptBigString = JSBigOptimizedBundleString::fromOptimizedBundle(bundlePath); if (!jsScriptBigString->isAscii()) { LOG(WARNING) << "Bundle is not ASCII encoded - falling back to the slow path"; return loadApplicationScript(std::move(jsScriptBigString), sourceURL); } sourceCode = JSCreateSourceCode( jsScriptBigString->fd(), jsSourceURL, jsScriptBigString->hash(), true); } ReactMarker::logMarker("RUN_JS_BUNDLE_START"); evaluateSourceCode(m_context, sourceCode, jsSourceURL); bindBridge(); flush(); ReactMarker::logMarker("CREATE_REACT_CONTEXT_END"); ReactMarker::logMarker("RUN_JS_BUNDLE_END"); } #endif </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCExecutor.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> // Copyright 2004-present Facebook. All Rights Reserved. <mask> <mask> #pragma once <mask> <mask> #include <folly/Optional.h> <mask> <mask> #include <memory> <mask> #include <string> <mask> <mask> #include <jschelpers/Value.h> <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include <fcntl.h> #include <functional> </s> add </s> remove #include "MessageQueueThread.h" </s> add </s> remove #include "NativeModule.h" </s> add </s> remove #include "ExecutorToken.h" #include "Executor.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> </s> remove #include "Executor.h" </s> add #include <cxxreact/Executor.h> </s> remove #include <folly/Conv.h> #include <folly/dynamic.h> </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCNativeModules.h
keep keep keep add keep keep keep keep
<mask> <mask> #include <memory> <mask> #include <string> <mask> <mask> #include <jschelpers/Value.h> <mask> <mask> namespace facebook { <mask> namespace react { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "ModuleRegistry.h" </s> add </s> remove #include <memory> </s> add #include <cxxreact/MessageQueueThread.h> </s> add #include <cxxreact/ExecutorToken.h> </s> add #include <cxxreact/Executor.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <cxxreact/NativeModule.h> #include <cxxreact/NativeToJsBridge.h> </s> remove #include "NativeToJsBridge.h" #include "ModuleRegistry.h" #include "NativeModule.h" </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCNativeModules.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> #include <string> <mask> <mask> #include <jschelpers/Value.h> <mask> <mask> #include "ModuleRegistry.h" <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> /** <mask> * Holds and creates JS representations of the modules in ModuleRegistry </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #include <cxxreact/ModuleRegistry.h> #include <folly/Optional.h> </s> remove #include "NativeToJsBridge.h" #include "ModuleRegistry.h" #include "NativeModule.h" </s> add </s> add #include <cxxreact/ExecutorToken.h> </s> add #include <cxxreact/Executor.h> </s> add #include <jschelpers/JavaScriptCore.h> </s> remove #include "Executor.h" #include "ExecutorToken.h" #include "JSCNativeModules.h" </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCNativeModules.h
keep add keep keep keep keep
<mask> result.setProperty("capacity", {ctx, Value::makeNumber(ctx, heapStats.capacity)}); <mask> result.setProperty("object_count", {ctx, Value::makeNumber(ctx, heapStats.objectCount)}); <mask> <mask> return (JSObjectRef) result; <mask> } <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove result[i] = new StackFrame(fileName, methodName, lineNumber, columnNumber); </s> add result[i] = new StackFrameImpl(fileName, methodName, lineNumber, columnNumber); </s> remove if (littleEndianToHost(header.BCMagic) == BCBundleMagicNumber) { </s> add switch (littleEndianToHost(header.magic)) { case RAMBundleMagicNumber: return ScriptTag::RAMBundle; case BCBundleMagicNumber: </s> remove return getMQRegistry().find(tid); </s> add return getMQRegistry().find(tid).lock(); } std::function<void()> CxxMessageQueue::getUnregisteredRunLoop() { return [capture=qr_] { capture->bindToThisThread(); capture->run(); }; </s> remove @Override </s> add </s> remove @Override </s> add </s> remove qplClass()->getMethod<jlong()>("currentMonotonicTimestamp"); return currentTimestampMethod(this_); } private: static alias_ref<jclass> qplClass() { static auto cls = findClassStatic("com/facebook/quicklog/QuickPerformanceLogger"); return cls; </s> add javaClassStatic()->getMethod<jlong()>("currentMonotonicTimestamp"); return currentTimestampMethod(self());
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCPerfStats.cpp
keep keep add keep keep keep keep keep
<mask> <mask> #pragma once <mask> <mask> #include <jschelpers/Value.h> <mask> <mask> namespace facebook { <mask> namespace react { <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "Executor.h" </s> add </s> add #include <cxxreact/ModuleRegistry.h> #include <cxxreact/NativeModule.h> #include <cxxreact/NativeToJsBridge.h> </s> remove #include "NativeModule.h" </s> add </s> remove #include "Executor.h" </s> add #include <cxxreact/Executor.h> </s> remove #include "ExecutorToken.h" #include "Executor.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <folly/Optional.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCUtils.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> #pragma once <mask> <mask> #include <jschelpers/Value.h> <mask> <mask> #include "Executor.h" <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> String jsStringFromBigString(JSContextRef ctx, const JSBigString& bigstr); <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #include <cxxreact/Executor.h> </s> remove #include "Executor.h" </s> add #include <cxxreact/Executor.h> </s> remove #include "ExecutorToken.h" #include "Executor.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> </s> remove #include "Executor.h" #include "ExecutorToken.h" #include "JSCNativeModules.h" </s> add </s> add #include <cxxreact/ModuleRegistry.h> #include <cxxreact/NativeModule.h> #include <cxxreact/NativeToJsBridge.h> </s> remove #include "NativeModule.h" </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSCUtils.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> <mask> #include <fstream> <mask> #include <memory> <mask> <mask> #include "Executor.h" <mask> #include "JSBundleType.h" <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> class JSBigString; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "Executor.h" #include "ExecutorToken.h" #include "JSCNativeModules.h" </s> add </s> remove #include "NativeToJsBridge.h" #include "ModuleRegistry.h" #include "NativeModule.h" </s> add </s> add #include <cxxreact/ModuleRegistry.h> #include <folly/Optional.h> </s> remove #include <memory> </s> add #include <cxxreact/MessageQueueThread.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <cxxreact/NativeModule.h> #include <cxxreact/NativeToJsBridge.h> </s> add #include <jschelpers/JavaScriptCore.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSIndexedRAMBundle.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> namespace react { <mask> <mask> class JSBigString; <mask> <mask> #include <cxxreact/JSModulesUnbundle.h> <mask> <mask> class JSIndexedRAMBundle : public facebook::react::JSModulesUnbundle { <mask> public: <mask> // Throws std::runtime_error on failure. <mask> JSIndexedRAMBundle(const char *sourceURL); <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "Executor.h" #include "JSBundleType.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/JSBundleType.h> #include <cxxreact/JSModulesUnbundle.h> </s> add #include <cxxreact/NativeModule.h> </s> remove #include "NativeToJsBridge.h" #include "ModuleRegistry.h" #include "NativeModule.h" </s> add </s> remove #include "Executor.h" #include "ExecutorToken.h" #include "JSCNativeModules.h" </s> add </s> add #include <jschelpers/JavaScriptCore.h> </s> remove #include "ExecutorToken.h" #include "NativeModule.h" </s> add #include <folly/dynamic.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JSIndexedRAMBundle.h
keep keep keep keep replace replace replace keep keep keep keep keep
<mask> // Copyright 2004-present Facebook. All Rights Reserved. <mask> <mask> #pragma once <mask> <mask> #include <folly/Conv.h> <mask> #include <folly/dynamic.h> <mask> <mask> #include <exception> <mask> #include <string> <mask> <mask> // When building a cross-platform module for React Native, arguments passed <mask> // from JS are represented as a folly::dynamic. This class provides helpers to </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #include <folly/Conv.h> #include <folly/dynamic.h> </s> remove #include <folly/Optional.h> </s> add </s> remove #include <fcntl.h> #include <functional> </s> add </s> remove #include "MessageQueueThread.h" </s> add </s> remove #include "NativeModule.h" </s> add </s> remove #include "ExecutorToken.h" #include "Executor.h" </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JsArgumentHelpers.h
keep add keep keep keep keep keep
<mask> #include <string> <mask> <mask> // When building a cross-platform module for React Native, arguments passed <mask> // from JS are represented as a folly::dynamic. This class provides helpers to <mask> // extract arguments from the folly::dynamic to concrete types usable by <mask> // cross-platform code, and converting exceptions to a JsArgumentException so <mask> // they can be caught and reported to RN consistently. The goal is to make the </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include <folly/Conv.h> #include <folly/dynamic.h> </s> add </s> remove // * The 'wrap' property supports only 'nowrap' (which is the default) or // 'wrap'. The // rarely-used 'wrap-reverse' is not supported. // * Rather than allowing arbitrary combinations of flexGrow, flexShrink and // flexBasis, this algorithm supports only the three most common // combinations: // flex: 0 is equiavlent to flex: 0 0 auto // flex: n (where n is a positive value) is equivalent to flex: n 1 auto // If POSITIVE_FLEX_IS_AUTO is 0, then it is equivalent to flex: n 0 0 // This is faster because the content doesn't need to be measured, but // it's // less flexible because the basis is always 0 and can't be overriden // with // the width/height attributes. // flex: -1 (or any negative value) is equivalent to flex: 0 1 auto // * Margins cannot be specified as 'auto'. They must be specified in terms of // pixel // values, and the default value is 0. // * Values of width, maxWidth, minWidth, height, maxHeight and minHeight must // be // specified as pixel values, not as percentages. // * There is no support for calculation of dimensions based on intrinsic // aspect ratios // (e.g. images). </s> add </s> remove void CatalystInstanceImpl::jniLoadScriptFromOptimizedBundle(const std::string& bundlePath, const std::string& sourceURL, jint flags) { return instance_->loadScriptFromOptimizedBundle(std::move(bundlePath), std::move(sourceURL), flags); } void CatalystInstanceImpl::callJSFunction( </s> add void CatalystInstanceImpl::jniCallJSFunction( </s> add // If this getRunLoop is used, current() will not work. std::function<void()> getUnregisteredRunLoop(); </s> remove -YGNodeStyleGetFlexShrink(child) * child->layout.computedFlexBasis; </s> add -YGNodeResolveFlexShrink(child) * child->layout.computedFlexBasis; </s> remove </s> add if (child->style.display == YGDisplayNone) { continue; }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JsArgumentHelpers.h
keep keep keep keep replace
<mask> } <mask> <mask> }} <mask> <mask> #include "JsArgumentHelpers-inl.h" </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include <folly/json.h> </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> #include <cxxreact/JSCNativeModules.h> </s> remove #include <sys/mman.h> #include <vector> </s> add </s> remove #include <jschelpers/JavaScriptCore.h> </s> add #include <folly/json.h> </s> add #include <cxxreact/Executor.h> #include <cxxreact/ExecutorToken.h> #include <cxxreact/JSCExecutor.h> #include <cxxreact/JSModulesUnbundle.h> #include <cxxreact/MessageQueueThread.h> #include <cxxreact/MethodCall.h> #include <cxxreact/NativeModule.h> </s> remove #include <folly/dynamic.h> </s> add #include <cxxreact/ExecutorToken.h> #include <cxxreact/NativeModule.h> </s> remove #include <folly/Exception.h> </s> add #include <cxxreact/JSBigString.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/JsArgumentHelpers.h
keep keep keep replace keep replace replace replace keep keep keep
<mask> #include <memory> <mask> #include <vector> <mask> <mask> #include <folly/dynamic.h> <mask> #include <folly/Optional.h> <mask> <mask> #include "ExecutorToken.h" <mask> #include "NativeModule.h" <mask> <mask> namespace facebook { <mask> namespace react { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "NativeToJsBridge.h" #include "ModuleRegistry.h" #include "NativeModule.h" </s> add </s> remove #include "ExecutorToken.h" </s> add </s> add #include <cxxreact/ModuleRegistry.h> #include <folly/Optional.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <cxxreact/NativeModule.h> #include <cxxreact/NativeToJsBridge.h> </s> add #include <cxxreact/ExecutorToken.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/ModuleRegistry.h
keep keep add keep keep keep keep keep keep
<mask> #include <string> <mask> #include <vector> <mask> <mask> #include <folly/dynamic.h> <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> struct MethodDescriptor { </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove #include "ExecutorToken.h" </s> add </s> remove #include "ExecutorToken.h" #include "NativeModule.h" </s> add #include <folly/dynamic.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <folly/Optional.h> </s> add #include <cxxreact/ModuleRegistry.h> #include <cxxreact/NativeModule.h> #include <cxxreact/NativeToJsBridge.h> </s> remove #include "NativeToJsBridge.h" #include "ModuleRegistry.h" #include "NativeModule.h" </s> add </s> remove #include "JSModulesUnbundle.h" </s> add #ifndef RN_EXPORT
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/NativeModule.h
keep keep keep keep replace replace keep keep keep keep keep
<mask> #include <vector> <mask> <mask> #include <folly/dynamic.h> <mask> <mask> #include "ExecutorToken.h" <mask> <mask> namespace facebook { <mask> namespace react { <mask> <mask> struct MethodDescriptor { <mask> std::string name; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #include <cxxreact/ExecutorToken.h> </s> remove #include "ExecutorToken.h" #include "NativeModule.h" </s> add #include <folly/dynamic.h> </s> remove #include "Executor.h" #include "ExecutorToken.h" #include "JSCNativeModules.h" </s> add </s> remove #include "NativeToJsBridge.h" #include "ModuleRegistry.h" #include "NativeModule.h" </s> add </s> add #include <cxxreact/ModuleRegistry.h> #include <cxxreact/NativeModule.h> #include <cxxreact/NativeToJsBridge.h> </s> remove #include "JSModulesUnbundle.h" </s> add #ifndef RN_EXPORT
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/NativeModule.h
keep keep keep add keep keep keep keep keep
<mask> void callNativeModules( <mask> JSExecutor& executor, folly::dynamic&& calls, bool isEndOfBatch) override { <mask> ExecutorToken token = m_nativeToJs->getTokenForExecutor(executor); <mask> m_nativeQueue->runOnQueue([this, token, calls=std::move(calls), isEndOfBatch] () mutable { <mask> // An exception anywhere in here stops processing of the batch. This <mask> // was the behavior of the Android bridge, and since exception handling <mask> // terminates the whole bridge, there's not much point in continuing. <mask> for (auto& call : react::parseMethodCalls(std::move(calls))) { <mask> m_registry->callNativeMethod( </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove // The main dimension is the sum of all the elements dimension plus // the spacing. </s> add // The main dimension is the sum of all the elements dimension plus the spacing. </s> add // TODO: findClassStatic only does the lookup once. If we can't find // QuickPerformanceLoggerProvider the first time we call this, we will always fail here. </s> remove // there // can only be one element in that cross dimension. </s> add // there can only be one element in that cross dimension. </s> add // If this getRunLoop is used, current() will not work. std::function<void()> getUnregisteredRunLoop(); </s> add static void YGZeroOutLayoutRecursivly(const YGNodeRef node) { node->layout.dimensions[YGDimensionHeight] = 0; node->layout.dimensions[YGDimensionWidth] = 0; node->layout.position[YGEdgeTop] = 0; node->layout.position[YGEdgeBottom] = 0; node->layout.position[YGEdgeLeft] = 0; node->layout.position[YGEdgeRight] = 0; const uint32_t childCount = YGNodeGetChildCount(node); for (uint32_t i = 0; i < childCount; i++) { const YGNodeRef child = YGNodeListGet(node->children, i); YGZeroOutLayoutRecursivly(child); } } </s> remove // JSExecutor functions sometimes take large strings, on the order of // megabytes. Copying these can be expensive. Introducing a // move-only, non-CopyConstructible type will let the compiler ensure // that no copies occur. folly::MoveWrapper should be used when a // large string needs to be curried into a std::function<>, which must // by CopyConstructible. class JSBigString { public: JSBigString() = default; // Not copyable JSBigString(const JSBigString&) = delete; JSBigString& operator=(const JSBigString&) = delete; virtual ~JSBigString() {} virtual bool isAscii() const = 0; virtual const char* c_str() const = 0; virtual size_t size() const = 0; }; // Concrete JSBigString implementation which holds a std::string // instance. class JSBigStdString : public JSBigString { public: JSBigStdString(std::string str, bool isAscii=false) : m_isAscii(isAscii) , m_str(std::move(str)) {} bool isAscii() const override { return m_isAscii; } const char* c_str() const override { return m_str.c_str(); } size_t size() const override { return m_str.size(); } private: bool m_isAscii; std::string m_str; }; // Concrete JSBigString implementation which holds a heap-allocated // buffer, and provides an accessor for writing to it. This can be // used to construct a JSBigString in place, such as by reading from a // file. class JSBigBufferString : public facebook::react::JSBigString { public: JSBigBufferString(size_t size) : m_data(new char[size + 1]) , m_size(size) { // Guarantee nul-termination. The caller is responsible for // filling in the rest of m_data. m_data[m_size] = '\0'; } ~JSBigBufferString() { delete[] m_data; } bool isAscii() const override { return true; } const char* c_str() const override { return m_data; } size_t size() const override { return m_size; } char* data() { return m_data; } private: char* m_data; size_t m_size; }; // JSBigString interface implemented by a file-backed mmap region. class RN_EXPORT JSBigFileString : public JSBigString { public: JSBigFileString(int fd, size_t size, off_t offset = 0) : m_fd {-1} , m_data {nullptr} { folly::checkUnixError( m_fd = dup(fd), "Could not duplicate file descriptor"); // Offsets given to mmap must be page aligend. We abstract away that // restriction by sending a page aligned offset to mmap, and keeping track // of the offset within the page that we must alter the mmap pointer by to // get the final desired offset. auto ps = getpagesize(); auto d = lldiv(offset, ps); m_mapOff = d.quot; m_pageOff = d.rem; m_size = size + m_pageOff; } ~JSBigFileString() { if (m_data) { munmap((void *)m_data, m_size); } close(m_fd); } bool isAscii() const override { return true; } const char *c_str() const override { if (!m_data) { m_data = (const char *)mmap(0, m_size, PROT_READ, MAP_SHARED, m_fd, m_mapOff); CHECK(m_data != MAP_FAILED) << " fd: " << m_fd << " size: " << m_size << " offset: " << m_mapOff << " error: " << std::strerror(errno); } return m_data + m_pageOff; } size_t size() const override { return m_size - m_pageOff; } int fd() const { return m_fd; } static std::unique_ptr<const JSBigFileString> fromPath(const std::string& sourceURL); private: int m_fd; // The file descriptor being mmaped size_t m_size; // The size of the mmaped region size_t m_pageOff; // The offset in the mmaped region to the data. off_t m_mapOff; // The offset in the file to the mmaped region. mutable const char *m_data; // Pointer to the mmaped region. }; class JSBigOptimizedBundleString : public JSBigString { public: enum class Encoding { Unknown, Ascii, Utf8, Utf16, }; JSBigOptimizedBundleString(int fd, size_t size, const uint8_t sha1[20], Encoding encoding) : m_fd(-1), m_size(size), m_encoding(encoding), m_str(nullptr) { folly::checkUnixError( m_fd = dup(fd), "Could not duplicate file descriptor"); memcpy(m_hash, sha1, 20); } ~JSBigOptimizedBundleString() { if (m_str) { CHECK(munmap((void *)m_str, m_size) != -1); } close(m_fd); } bool isAscii() const override { return m_encoding == Encoding::Ascii; } const char* c_str() const override { if (!m_str) { m_str = (const char *)mmap(0, m_size, PROT_READ, MAP_SHARED, m_fd, 0); CHECK(m_str != MAP_FAILED); } return m_str; } size_t size() const override { return m_size; } int fd() const { return m_fd; } const uint8_t* hash() const { return m_hash; } Encoding encoding() const { return m_encoding; } static std::unique_ptr<const JSBigOptimizedBundleString> fromOptimizedBundle(const std::string& bundlePath); private: int m_fd; size_t m_size; uint8_t m_hash[20]; Encoding m_encoding; mutable const char *m_str; }; </s> add
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/NativeToJsBridge.cpp
keep keep keep keep replace keep keep keep keep keep
<mask> m_registry->callNativeMethod( <mask> token, call.moduleId, call.methodId, std::move(call.arguments), call.callId); <mask> } <mask> if (isEndOfBatch) { <mask> m_callback->onBatchComplete(); <mask> m_callback->decrementPendingJSCalls(); <mask> } <mask> }); <mask> } <mask> </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove void CatalystInstanceImpl::callJSCallback(JExecutorToken* token, jint callbackId, NativeArray* arguments) { </s> add void CatalystInstanceImpl::jniCallJSCallback(JExecutorToken* token, jint callbackId, NativeArray* arguments) { </s> remove YGMakeNativeMethod(jni_YGSetExperimentalFeatureEnabled), YGMakeNativeMethod(jni_YGIsExperimentalFeatureEnabled), </s> add }); registerNatives("com/facebook/yoga/YogaConfig", { YGMakeNativeMethod(jni_YGConfigNew), YGMakeNativeMethod(jni_YGConfigFree), YGMakeNativeMethod(jni_YGConfigSetExperimentalFeatureEnabled), </s> remove public void run() { </s> add public void runGuarded() { </s> add m_batchHadNativeModuleCalls = m_batchHadNativeModuleCalls || !calls.empty(); </s> remove std::runtime_error(folly::to<std::string>("Error invoking callback.", callbackId))); </s> add std::runtime_error(folly::to<std::string>("Error invoking callback ", callbackId))); </s> add responder.respond(response.body().string()); } }); }
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/NativeToJsBridge.cpp
keep keep add keep keep keep keep
<mask> std::shared_ptr<ModuleRegistry> m_registry; <mask> std::unique_ptr<MessageQueueThread> m_nativeQueue; <mask> std::shared_ptr<InstanceCallback> m_callback; <mask> }; <mask> <mask> NativeToJsBridge::NativeToJsBridge( <mask> JSExecutorFactory* jsExecutorFactory, </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove uint32_t RAMMagic; struct { uint64_t BCMagic; uint32_t BCVersion; }; </s> add uint32_t magic; uint32_t reserved_; uint32_t version; </s> remove using JQuickPerformanceLogger = JObjectWrapper<jqpl>; </s> add </s> remove static std::weak_ptr<CxxMessageQueue> current(); </s> add static std::shared_ptr<CxxMessageQueue> current(); </s> remove // TODO: handle nested runloops (either allow them or throw an exception). </s> add </s> remove using JQuickPerformanceLoggerProvider = JObjectWrapper<jqplProvider>; }} </s> add </s> add private static final int[] SPACING_TYPES = { Spacing.ALL, Spacing.LEFT, Spacing.RIGHT, Spacing.TOP, Spacing.BOTTOM, };
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/NativeToJsBridge.cpp
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
<mask> CHECK(*m_destroyed) << <mask> "NativeToJsBridge::destroy() must be called before deallocating the NativeToJsBridge!"; <mask> } <mask> <mask> void NativeToJsBridge::loadOptimizedApplicationScript( <mask> std::string bundlePath, <mask> std::string sourceURL, <mask> int flags) { <mask> runOnExecutorQueue( <mask> m_mainExecutorToken, <mask> [bundlePath=std::move(bundlePath), <mask> sourceURL=std::move(sourceURL), <mask> flags=flags] <mask> (JSExecutor* executor) { <mask> executor->loadApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); <mask> }); <mask> } <mask> <mask> void NativeToJsBridge::loadApplication( <mask> std::unique_ptr<JSModulesUnbundle> unbundle, <mask> std::unique_ptr<const JSBigString> startupScript, <mask> std::string startupScriptSourceURL) { <mask> runOnExecutorQueue( </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> remove void Instance::loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags) { SystraceSection s("reactbridge_xplat_loadScriptFromOptimizedBundle", "bundlePath", bundlePath); nativeToJsBridge_->loadOptimizedApplicationScript(std::move(bundlePath), std::move(sourceURL), flags); } </s> add </s> remove void loadScriptFromOptimizedBundle(std::string bundlePath, std::string sourceURL, int flags); </s> add </s> remove #ifdef WITH_FBJSCEXTENSIONS virtual void loadApplicationScript( std::string bundlePath, std::string sourceURL, int flags) override; #endif </s> add </s> remove /** * Execute an application script optimized bundle in the JS context. */ virtual void loadApplicationScript(std::string bundlePath, std::string source, int flags); </s> add </s> remove void jniLoadScriptFromOptimizedBundle(const std::string& bundlePath, const std::string& sourceURL, jint flags); void callJSFunction(JExecutorToken* token, std::string module, std::string method, NativeArray* arguments); void callJSCallback(JExecutorToken* token, jint callbackId, NativeArray* arguments); </s> add void jniCallJSFunction(JExecutorToken* token, std::string module, std::string method, NativeArray* arguments); void jniCallJSCallback(JExecutorToken* token, jint callbackId, NativeArray* arguments); </s> remove void CatalystInstanceImpl::jniLoadScriptFromOptimizedBundle(const std::string& bundlePath, const std::string& sourceURL, jint flags) { return instance_->loadScriptFromOptimizedBundle(std::move(bundlePath), std::move(sourceURL), flags); } void CatalystInstanceImpl::callJSFunction( </s> add void CatalystInstanceImpl::jniCallJSFunction(
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/NativeToJsBridge.cpp
keep keep keep add keep keep keep keep keep keep
<mask> #include <functional> <mask> #include <map> <mask> #include <vector> <mask> <mask> #include <folly/dynamic.h> <mask> #include <jschelpers/Value.h> <mask> <mask> namespace folly { <mask> <mask> struct dynamic; </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #include <cxxreact/ExecutorToken.h> </s> remove #include "ExecutorToken.h" </s> add </s> remove #include <sys/mman.h> #include <vector> </s> add </s> remove #include "ExecutorToken.h" #include "NativeModule.h" </s> add #include <folly/dynamic.h> </s> remove #include <folly/Exception.h> </s> add #include <cxxreact/JSBigString.h> </s> remove #include <folly/dynamic.h> </s> add #include <cxxreact/ExecutorToken.h> #include <cxxreact/NativeModule.h>
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/cxxreact/NativeToJsBridge.h
keep keep keep keep replace keep keep replace
<mask> <mask> #define YG_NODE_STYLE_EDGE_PROPERTY_IMPL(type, name, paramName, instanceName, defaultValue) \ <mask> void YGNodeStyleSet##name(const YGNodeRef node, const YGEdge edge, const float paramName) { \ <mask> if (node->style.instanceName[edge].value != paramName || \ <mask> node->style.instanceName[edge].unit != YGUnitPixel) { \ <mask> node->style.instanceName[edge].value = paramName; \ <mask> node->style.instanceName[edge].unit = \ <mask> YGFloatIsUndefined(paramName) ? YGUnitUndefined : YGUnitPixel; \ </s> Update RN for Android Ran kernel, can load React Conf experience fbshipit-source-id: 2977793 </s> add #define YG_NODE_STYLE_PROPERTY_UNIT_AUTO(type, name, paramName) \ YG_NODE_STYLE_PROPERTY_UNIT(type, name, paramName) \ WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node); </s> remove return YGComputedEdgeValue(node->style.instanceName, edge, &defaultValue)->value; \ </s> add return node->style.instanceName[edge].value; \ </s> add #define YG_NODE_STYLE_EDGE_PROPERTY_UNIT_AUTO(type, name) \ WIN_EXPORT void YGNodeStyleSet##name##Auto(const YGNodeRef node, const YGEdge edge); </s> add #define YG_NODE_JNI_STYLE_UNIT_PROP_AUTO(name) \ YG_NODE_JNI_STYLE_UNIT_PROP(name) \ void jni_YGNodeStyleSet##name##Auto(alias_ref<jobject>, jlong nativePointer) { \ YGNodeStyleSet##name##Auto(_jlong2YGNodeRef(nativePointer)); \ } </s> add JSBigString.cpp \
https://github.com/expo/expo/commit/1d8f03248acb1f02dbe390e691ec4a15c039124a
android/ReactCommon/yoga/yoga/Yoga.c