react-native 0.74.0-rc.1 → 0.74.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/AppDelegate/RCTAppDelegate.mm +1 -1
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/ReactAndroid/api/ReactAndroid.api +7 -56
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/CoreModulesPackage.java +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/DebugCorePackage.java +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java +3 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ModuleHolder.java +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleInteropUtils.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManager.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/TurboModuleManagerDelegate.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.java +10 -0
- package/ReactAndroid/src/main/java/com/facebook/react/module/processing/ReactModuleSpecProcessor.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/fresco/FrescoModule.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/CoreReactPackage.java +1 -2
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +1 -5
- package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/TurboModule.kt +10 -11
- package/ReactAndroid/src/main/jni/react/fabric/CoreComponentsRegistry.cpp +0 -2
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.h +1 -1
- package/ReactCommon/react/nativemodule/samples/platform/android/NativeSampleTurboModuleSpec.java +1 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h +6 -2
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +16 -4
- package/index.js +0 -5
- package/package.json +3 -3
- package/scripts/codegen/generate-artifacts-executor.js +1 -5
- package/sdks/hermes-engine/hermes-utils.rb +4 -3
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/package.json +3 -3
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.android.js +0 -69
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.d.ts +0 -24
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroid.js +0 -33
- package/Libraries/Components/PopupMenuAndroid/PopupMenuAndroidNativeComponent.js +0 -13
- package/ReactAndroid/src/main/java/com/facebook/react/internal/turbomodule/core/interfaces/TurboModule.kt +0 -19
- package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/PopupMenuSelectionEvent.kt +0 -38
- package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuContainer.kt +0 -49
- package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuManager.kt +0 -54
- package/src/private/specs/components/PopupMenuAndroidNativeComponent.js +0 -47
|
@@ -116,6 +116,7 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
|
|
116
116
|
}
|
|
117
117
|
rootView = [self createRootViewWithBridge:self.bridge moduleName:self.moduleName initProps:initProps];
|
|
118
118
|
}
|
|
119
|
+
[self _logWarnIfCreateRootViewWithBridgeIsOverridden];
|
|
119
120
|
[self customizeRootView:(RCTRootView *)rootView];
|
|
120
121
|
self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
|
|
121
122
|
UIViewController *rootViewController = [self createRootViewController];
|
|
@@ -158,7 +159,6 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
|
|
158
159
|
moduleName:(NSString *)moduleName
|
|
159
160
|
initProps:(NSDictionary *)initProps
|
|
160
161
|
{
|
|
161
|
-
[self _logWarnIfCreateRootViewWithBridgeIsOverridden];
|
|
162
162
|
BOOL enableFabric = self.fabricEnabled;
|
|
163
163
|
UIView *rootView = RCTAppSetupDefaultRootView(bridge, moduleName, initProps, enableFabric);
|
|
164
164
|
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -322,7 +322,7 @@ public abstract class com/facebook/react/ReactPackageTurboModuleManagerDelegate
|
|
|
322
322
|
protected fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;Ljava/util/List;Lcom/facebook/jni/HybridData;)V
|
|
323
323
|
public fun getEagerInitModuleNames ()Ljava/util/List;
|
|
324
324
|
public fun getLegacyModule (Ljava/lang/String;)Lcom/facebook/react/bridge/NativeModule;
|
|
325
|
-
public fun getModule (Ljava/lang/String;)Lcom/facebook/react/
|
|
325
|
+
public fun getModule (Ljava/lang/String;)Lcom/facebook/react/turbomodule/core/interfaces/TurboModule;
|
|
326
326
|
public fun unstable_enableSyncVoidMethods ()Z
|
|
327
327
|
public fun unstable_isLegacyModuleRegistered (Ljava/lang/String;)Z
|
|
328
328
|
public fun unstable_isModuleRegistered (Ljava/lang/String;)Z
|
|
@@ -2856,6 +2856,7 @@ public class com/facebook/react/module/model/ReactModuleInfo {
|
|
|
2856
2856
|
public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZ)V
|
|
2857
2857
|
public fun <init> (Ljava/lang/String;Ljava/lang/String;ZZZZZ)V
|
|
2858
2858
|
public fun canOverrideExistingModule ()Z
|
|
2859
|
+
public static fun classIsTurboModule (Ljava/lang/Class;)Z
|
|
2859
2860
|
public fun className ()Ljava/lang/String;
|
|
2860
2861
|
public fun hasConstants ()Z
|
|
2861
2862
|
public fun isCxxModule ()Z
|
|
@@ -3199,7 +3200,7 @@ public class com/facebook/react/modules/dialog/DialogModule : com/facebook/fbrea
|
|
|
3199
3200
|
public fun showAlert (Lcom/facebook/react/bridge/ReadableMap;Lcom/facebook/react/bridge/Callback;Lcom/facebook/react/bridge/Callback;)V
|
|
3200
3201
|
}
|
|
3201
3202
|
|
|
3202
|
-
public class com/facebook/react/modules/fresco/FrescoModule : com/facebook/react/bridge/ReactContextBaseJavaModule, com/facebook/react/bridge/LifecycleEventListener, com/facebook/react/
|
|
3203
|
+
public class com/facebook/react/modules/fresco/FrescoModule : com/facebook/react/bridge/ReactContextBaseJavaModule, com/facebook/react/bridge/LifecycleEventListener, com/facebook/react/modules/common/ModuleDataCleaner$Cleanable, com/facebook/react/turbomodule/core/interfaces/TurboModule {
|
|
3203
3204
|
public static final field NAME Ljava/lang/String;
|
|
3204
3205
|
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
|
|
3205
3206
|
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;Lcom/facebook/imagepipeline/core/ImagePipeline;Z)V
|
|
@@ -3440,7 +3441,7 @@ public class com/facebook/react/modules/systeminfo/AndroidInfoHelpers {
|
|
|
3440
3441
|
public static fun getServerHost (Ljava/lang/Integer;)Ljava/lang/String;
|
|
3441
3442
|
}
|
|
3442
3443
|
|
|
3443
|
-
public class com/facebook/react/modules/systeminfo/AndroidInfoModule : com/facebook/fbreact/specs/NativePlatformConstantsAndroidSpec, com/facebook/react/
|
|
3444
|
+
public class com/facebook/react/modules/systeminfo/AndroidInfoModule : com/facebook/fbreact/specs/NativePlatformConstantsAndroidSpec, com/facebook/react/turbomodule/core/interfaces/TurboModule {
|
|
3444
3445
|
public fun <init> (Lcom/facebook/react/bridge/ReactApplicationContext;)V
|
|
3445
3446
|
public fun getAndroidID ()Ljava/lang/String;
|
|
3446
3447
|
public fun getTypedExportedConstants ()Ljava/util/Map;
|
|
@@ -3806,7 +3807,9 @@ public abstract interface class com/facebook/react/turbomodule/core/interfaces/C
|
|
|
3806
3807
|
public abstract interface class com/facebook/react/turbomodule/core/interfaces/NativeMethodCallInvokerHolder {
|
|
3807
3808
|
}
|
|
3808
3809
|
|
|
3809
|
-
public abstract interface class com/facebook/react/turbomodule/core/interfaces/TurboModule
|
|
3810
|
+
public abstract interface class com/facebook/react/turbomodule/core/interfaces/TurboModule {
|
|
3811
|
+
public abstract fun initialize ()V
|
|
3812
|
+
public abstract fun invalidate ()V
|
|
3810
3813
|
}
|
|
3811
3814
|
|
|
3812
3815
|
public abstract class com/facebook/react/uimanager/BaseViewManager : com/facebook/react/uimanager/ViewManager, android/view/View$OnLayoutChangeListener, com/facebook/react/uimanager/BaseViewManagerInterface {
|
|
@@ -5673,17 +5676,6 @@ public abstract interface class com/facebook/react/viewmanagers/AndroidHorizonta
|
|
|
5673
5676
|
public abstract fun setRemoveClippedSubviews (Landroid/view/View;Z)V
|
|
5674
5677
|
}
|
|
5675
5678
|
|
|
5676
|
-
public class com/facebook/react/viewmanagers/AndroidPopupMenuManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
|
|
5677
|
-
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
|
|
5678
|
-
public fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
|
|
5679
|
-
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
|
|
5680
|
-
}
|
|
5681
|
-
|
|
5682
|
-
public abstract interface class com/facebook/react/viewmanagers/AndroidPopupMenuManagerInterface {
|
|
5683
|
-
public abstract fun setMenuItems (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
|
|
5684
|
-
public abstract fun show (Landroid/view/View;)V
|
|
5685
|
-
}
|
|
5686
|
-
|
|
5687
5679
|
public class com/facebook/react/viewmanagers/AndroidProgressBarManagerDelegate : com/facebook/react/uimanager/BaseViewManagerDelegate {
|
|
5688
5680
|
public fun <init> (Lcom/facebook/react/uimanager/BaseViewManagerInterface;)V
|
|
5689
5681
|
public fun setProperty (Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
|
|
@@ -6153,47 +6145,6 @@ public abstract interface class com/facebook/react/views/modal/ReactModalHostVie
|
|
|
6153
6145
|
public abstract fun onRequestClose (Landroid/content/DialogInterface;)V
|
|
6154
6146
|
}
|
|
6155
6147
|
|
|
6156
|
-
public final class com/facebook/react/views/popupmenu/PopupMenuSelectionEvent : com/facebook/react/uimanager/events/Event {
|
|
6157
|
-
public static final field Companion Lcom/facebook/react/views/popupmenu/PopupMenuSelectionEvent$Companion;
|
|
6158
|
-
public static final field EVENT_NAME Ljava/lang/String;
|
|
6159
|
-
public fun <init> (III)V
|
|
6160
|
-
public fun dispatch (Lcom/facebook/react/uimanager/events/RCTEventEmitter;)V
|
|
6161
|
-
public fun getEventName ()Ljava/lang/String;
|
|
6162
|
-
}
|
|
6163
|
-
|
|
6164
|
-
public final class com/facebook/react/views/popupmenu/PopupMenuSelectionEvent$Companion {
|
|
6165
|
-
}
|
|
6166
|
-
|
|
6167
|
-
public final class com/facebook/react/views/popupmenu/ReactPopupMenuContainer : android/widget/FrameLayout {
|
|
6168
|
-
public fun <init> (Landroid/content/Context;)V
|
|
6169
|
-
public final fun setMenuItems (Lcom/facebook/react/bridge/ReadableArray;)V
|
|
6170
|
-
public final fun showPopupMenu ()V
|
|
6171
|
-
}
|
|
6172
|
-
|
|
6173
|
-
public final class com/facebook/react/views/popupmenu/ReactPopupMenuManager : com/facebook/react/uimanager/ViewGroupManager, com/facebook/react/viewmanagers/AndroidPopupMenuManagerInterface {
|
|
6174
|
-
public static final field Companion Lcom/facebook/react/views/popupmenu/ReactPopupMenuManager$Companion;
|
|
6175
|
-
public static final field REACT_CLASS Ljava/lang/String;
|
|
6176
|
-
public fun <init> ()V
|
|
6177
|
-
public synthetic fun createViewInstance (Lcom/facebook/react/uimanager/ThemedReactContext;)Landroid/view/View;
|
|
6178
|
-
public fun getName ()Ljava/lang/String;
|
|
6179
|
-
public synthetic fun receiveCommand (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
|
|
6180
|
-
public fun receiveCommand (Lcom/facebook/react/views/popupmenu/ReactPopupMenuContainer;Ljava/lang/String;Lcom/facebook/react/bridge/ReadableArray;)V
|
|
6181
|
-
public synthetic fun setMenuItems (Landroid/view/View;Lcom/facebook/react/bridge/ReadableArray;)V
|
|
6182
|
-
public fun setMenuItems (Lcom/facebook/react/views/popupmenu/ReactPopupMenuContainer;Lcom/facebook/react/bridge/ReadableArray;)V
|
|
6183
|
-
public synthetic fun show (Landroid/view/View;)V
|
|
6184
|
-
public fun show (Lcom/facebook/react/views/popupmenu/ReactPopupMenuContainer;)V
|
|
6185
|
-
}
|
|
6186
|
-
|
|
6187
|
-
public class com/facebook/react/views/popupmenu/ReactPopupMenuManager$$PropsSetter : com/facebook/react/uimanager/ViewManagerPropertyUpdater$ViewManagerSetter {
|
|
6188
|
-
public fun <init> ()V
|
|
6189
|
-
public fun getProperties (Ljava/util/Map;)V
|
|
6190
|
-
public synthetic fun setProperty (Lcom/facebook/react/uimanager/ViewManager;Landroid/view/View;Ljava/lang/String;Ljava/lang/Object;)V
|
|
6191
|
-
public fun setProperty (Lcom/facebook/react/views/popupmenu/ReactPopupMenuManager;Lcom/facebook/react/views/popupmenu/ReactPopupMenuContainer;Ljava/lang/String;Ljava/lang/Object;)V
|
|
6192
|
-
}
|
|
6193
|
-
|
|
6194
|
-
public final class com/facebook/react/views/popupmenu/ReactPopupMenuManager$Companion {
|
|
6195
|
-
}
|
|
6196
|
-
|
|
6197
6148
|
public class com/facebook/react/views/progressbar/ProgressBarShadowNode : com/facebook/react/uimanager/LayoutShadowNode, com/facebook/yoga/YogaMeasureFunction {
|
|
6198
6149
|
public fun <init> ()V
|
|
6199
6150
|
public fun getStyle ()Ljava/lang/String;
|
|
@@ -17,7 +17,6 @@ import com.facebook.react.bridge.NativeModule;
|
|
|
17
17
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
18
|
import com.facebook.react.bridge.ReactMarker;
|
|
19
19
|
import com.facebook.react.devsupport.LogBoxModule;
|
|
20
|
-
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
|
|
21
20
|
import com.facebook.react.module.annotations.ReactModule;
|
|
22
21
|
import com.facebook.react.module.annotations.ReactModuleList;
|
|
23
22
|
import com.facebook.react.module.model.ReactModuleInfo;
|
|
@@ -115,7 +114,7 @@ class CoreModulesPackage extends TurboReactPackage implements ReactPackageLogger
|
|
|
115
114
|
reactModule.canOverrideExistingModule(),
|
|
116
115
|
reactModule.needsEagerInit(),
|
|
117
116
|
reactModule.isCxxModule(),
|
|
118
|
-
|
|
117
|
+
ReactModuleInfo.classIsTurboModule(moduleClass)));
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
return () -> reactModuleInfoMap;
|
|
@@ -12,7 +12,6 @@ import com.facebook.react.bridge.ModuleSpec;
|
|
|
12
12
|
import com.facebook.react.bridge.NativeModule;
|
|
13
13
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
14
14
|
import com.facebook.react.devsupport.JSCHeapCapture;
|
|
15
|
-
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
|
|
16
15
|
import com.facebook.react.module.annotations.ReactModule;
|
|
17
16
|
import com.facebook.react.module.annotations.ReactModuleList;
|
|
18
17
|
import com.facebook.react.module.model.ReactModuleInfo;
|
|
@@ -74,7 +73,7 @@ class DebugCorePackage extends TurboReactPackage implements ViewManagerOnDemandR
|
|
|
74
73
|
reactModule.canOverrideExistingModule(),
|
|
75
74
|
reactModule.needsEagerInit(),
|
|
76
75
|
reactModule.isCxxModule(),
|
|
77
|
-
|
|
76
|
+
ReactModuleInfo.classIsTurboModule(moduleClass)));
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
return () -> reactModuleInfoMap;
|
package/ReactAndroid/src/main/java/com/facebook/react/ReactPackageTurboModuleManagerDelegate.java
CHANGED
|
@@ -18,9 +18,9 @@ import com.facebook.react.bridge.ReactApplicationContext;
|
|
|
18
18
|
import com.facebook.react.common.ReactConstants;
|
|
19
19
|
import com.facebook.react.config.ReactFeatureFlags;
|
|
20
20
|
import com.facebook.react.internal.turbomodule.core.TurboModuleManagerDelegate;
|
|
21
|
-
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
|
|
22
21
|
import com.facebook.react.module.annotations.ReactModule;
|
|
23
22
|
import com.facebook.react.module.model.ReactModuleInfo;
|
|
23
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
24
24
|
import java.util.ArrayList;
|
|
25
25
|
import java.util.HashMap;
|
|
26
26
|
import java.util.List;
|
|
@@ -123,14 +123,14 @@ public abstract class ReactPackageTurboModuleManagerDelegate extends TurboModule
|
|
|
123
123
|
reactModule.canOverrideExistingModule(),
|
|
124
124
|
true,
|
|
125
125
|
reactModule.isCxxModule(),
|
|
126
|
-
|
|
126
|
+
ReactModuleInfo.classIsTurboModule(moduleClass))
|
|
127
127
|
: new ReactModuleInfo(
|
|
128
128
|
moduleName,
|
|
129
129
|
moduleClass.getName(),
|
|
130
130
|
module.canOverrideExistingModule(),
|
|
131
131
|
true,
|
|
132
132
|
CxxModuleWrapper.class.isAssignableFrom(moduleClass),
|
|
133
|
-
|
|
133
|
+
ReactModuleInfo.classIsTurboModule(moduleClass));
|
|
134
134
|
|
|
135
135
|
reactModuleInfoMap.put(moduleName, moduleInfo);
|
|
136
136
|
moduleMap.put(moduleName, module);
|
|
@@ -15,7 +15,7 @@ import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
|
|
|
15
15
|
|
|
16
16
|
import androidx.annotation.Nullable;
|
|
17
17
|
import com.facebook.proguard.annotations.DoNotStrip;
|
|
18
|
-
import com.facebook.react.
|
|
18
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
19
19
|
import com.facebook.systrace.Systrace;
|
|
20
20
|
import com.facebook.systrace.SystraceMessage;
|
|
21
21
|
import java.lang.reflect.Method;
|
|
@@ -20,7 +20,6 @@ import com.facebook.debug.tags.ReactDebugOverlayTags;
|
|
|
20
20
|
import com.facebook.infer.annotation.Assertions;
|
|
21
21
|
import com.facebook.proguard.annotations.DoNotStrip;
|
|
22
22
|
import com.facebook.react.common.ReactConstants;
|
|
23
|
-
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
|
|
24
23
|
import com.facebook.react.module.model.ReactModuleInfo;
|
|
25
24
|
import com.facebook.systrace.SystraceMessage;
|
|
26
25
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
@@ -73,7 +72,7 @@ public class ModuleHolder {
|
|
|
73
72
|
nativeModule.canOverrideExistingModule(),
|
|
74
73
|
true,
|
|
75
74
|
CxxModuleWrapper.class.isAssignableFrom(nativeModule.getClass()),
|
|
76
|
-
|
|
75
|
+
ReactModuleInfo.classIsTurboModule(nativeModule.getClass()));
|
|
77
76
|
|
|
78
77
|
mModule = nativeModule;
|
|
79
78
|
PrinterHolder.getPrinter()
|
|
@@ -18,7 +18,7 @@ import com.facebook.react.bridge.ReadableArray;
|
|
|
18
18
|
import com.facebook.react.bridge.ReadableMap;
|
|
19
19
|
import com.facebook.react.bridge.WritableArray;
|
|
20
20
|
import com.facebook.react.bridge.WritableMap;
|
|
21
|
-
import com.facebook.react.
|
|
21
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
22
22
|
import java.lang.reflect.Method;
|
|
23
23
|
import java.util.ArrayList;
|
|
24
24
|
import java.util.HashSet;
|
|
@@ -19,12 +19,12 @@ import com.facebook.react.bridge.NativeModule;
|
|
|
19
19
|
import com.facebook.react.bridge.ReactNoCrashSoftException;
|
|
20
20
|
import com.facebook.react.bridge.ReactSoftExceptionLogger;
|
|
21
21
|
import com.facebook.react.bridge.RuntimeExecutor;
|
|
22
|
-
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
|
|
23
22
|
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModuleRegistry;
|
|
24
23
|
import com.facebook.react.turbomodule.core.CallInvokerHolderImpl;
|
|
25
24
|
import com.facebook.react.turbomodule.core.NativeMethodCallInvokerHolderImpl;
|
|
26
25
|
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder;
|
|
27
26
|
import com.facebook.react.turbomodule.core.interfaces.NativeMethodCallInvokerHolder;
|
|
27
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
28
28
|
import java.util.ArrayList;
|
|
29
29
|
import java.util.Collection;
|
|
30
30
|
import java.util.HashMap;
|
|
@@ -12,7 +12,7 @@ import com.facebook.infer.annotation.Nullsafe;
|
|
|
12
12
|
import com.facebook.jni.HybridData;
|
|
13
13
|
import com.facebook.proguard.annotations.DoNotStrip;
|
|
14
14
|
import com.facebook.react.bridge.NativeModule;
|
|
15
|
-
import com.facebook.react.
|
|
15
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
16
16
|
import java.util.ArrayList;
|
|
17
17
|
import java.util.List;
|
|
18
18
|
|
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
|
|
8
8
|
package com.facebook.react.module.model;
|
|
9
9
|
|
|
10
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
11
|
+
|
|
10
12
|
/**
|
|
11
13
|
* Data holder class holding native module specifications. {@link ReactModuleSpecProcessor} creates
|
|
12
14
|
* these so Java modules don't have to be instantiated at React Native start up.
|
|
@@ -80,4 +82,12 @@ public class ReactModuleInfo {
|
|
|
80
82
|
public boolean isTurboModule() {
|
|
81
83
|
return mIsTurboModule;
|
|
82
84
|
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Checks if the passed class is a TurboModule. Useful to populate the parameter [isTurboModule]
|
|
88
|
+
* in the constructor of ReactModuleInfo.
|
|
89
|
+
*/
|
|
90
|
+
public static boolean classIsTurboModule(Class<?> clazz) {
|
|
91
|
+
return TurboModule.class.isAssignableFrom(clazz);
|
|
92
|
+
}
|
|
83
93
|
}
|
|
@@ -161,13 +161,13 @@ public class ReactModuleSpecProcessor extends ProcessorBase {
|
|
|
161
161
|
builder.addStatement("$T map = new $T()", MAP_TYPE, INSTANTIATED_MAP_TYPE);
|
|
162
162
|
|
|
163
163
|
String turboModuleInterfaceCanonicalName =
|
|
164
|
-
"com.facebook.react.
|
|
164
|
+
"com.facebook.react.turbomodule.core.interfaces.TurboModule";
|
|
165
165
|
TypeMirror turboModuleInterface =
|
|
166
166
|
mElements.getTypeElement(turboModuleInterfaceCanonicalName).asType();
|
|
167
167
|
|
|
168
168
|
if (turboModuleInterface == null) {
|
|
169
169
|
throw new RuntimeException(
|
|
170
|
-
"com.facebook.react.
|
|
170
|
+
"com.facebook.react.turbomodule.core.interfaces.TurboModule interface not found.");
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
for (String nativeModule : nativeModules) {
|
|
@@ -19,12 +19,12 @@ import com.facebook.react.bridge.ReactApplicationContext;
|
|
|
19
19
|
import com.facebook.react.bridge.ReactContext;
|
|
20
20
|
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
21
21
|
import com.facebook.react.common.ReactConstants;
|
|
22
|
-
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
|
|
23
22
|
import com.facebook.react.module.annotations.ReactModule;
|
|
24
23
|
import com.facebook.react.modules.common.ModuleDataCleaner;
|
|
25
24
|
import com.facebook.react.modules.network.CookieJarContainer;
|
|
26
25
|
import com.facebook.react.modules.network.ForwardingCookieHandler;
|
|
27
26
|
import com.facebook.react.modules.network.OkHttpClientProvider;
|
|
27
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
28
28
|
import java.util.HashSet;
|
|
29
29
|
import okhttp3.JavaNetCookieJar;
|
|
30
30
|
import okhttp3.OkHttpClient;
|
package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java
CHANGED
|
@@ -18,8 +18,8 @@ import androidx.annotation.Nullable;
|
|
|
18
18
|
import com.facebook.fbreact.specs.NativePlatformConstantsAndroidSpec;
|
|
19
19
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
20
20
|
import com.facebook.react.common.build.ReactBuildConfig;
|
|
21
|
-
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
|
|
22
21
|
import com.facebook.react.module.annotations.ReactModule;
|
|
22
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
23
23
|
import java.util.HashMap;
|
|
24
24
|
import java.util.Map;
|
|
25
25
|
|
|
@@ -14,7 +14,6 @@ import com.facebook.react.bridge.NativeModule;
|
|
|
14
14
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
15
15
|
import com.facebook.react.devsupport.LogBoxModule;
|
|
16
16
|
import com.facebook.react.devsupport.interfaces.DevSupportManager;
|
|
17
|
-
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
|
|
18
17
|
import com.facebook.react.module.annotations.ReactModule;
|
|
19
18
|
import com.facebook.react.module.annotations.ReactModuleList;
|
|
20
19
|
import com.facebook.react.module.model.ReactModuleInfo;
|
|
@@ -103,7 +102,7 @@ class CoreReactPackage extends TurboReactPackage {
|
|
|
103
102
|
reactModule.canOverrideExistingModule(),
|
|
104
103
|
reactModule.needsEagerInit(),
|
|
105
104
|
reactModule.isCxxModule(),
|
|
106
|
-
|
|
105
|
+
ReactModuleInfo.classIsTurboModule(moduleClass)));
|
|
107
106
|
}
|
|
108
107
|
}
|
|
109
108
|
return () -> reactModuleInfoMap;
|
|
@@ -15,7 +15,6 @@ import com.facebook.react.animated.NativeAnimatedModule;
|
|
|
15
15
|
import com.facebook.react.bridge.ModuleSpec;
|
|
16
16
|
import com.facebook.react.bridge.NativeModule;
|
|
17
17
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
18
|
-
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModule;
|
|
19
18
|
import com.facebook.react.module.annotations.ReactModule;
|
|
20
19
|
import com.facebook.react.module.annotations.ReactModuleList;
|
|
21
20
|
import com.facebook.react.module.model.ReactModuleInfo;
|
|
@@ -47,7 +46,6 @@ import com.facebook.react.uimanager.ViewManager;
|
|
|
47
46
|
import com.facebook.react.views.drawer.ReactDrawerLayoutManager;
|
|
48
47
|
import com.facebook.react.views.image.ReactImageManager;
|
|
49
48
|
import com.facebook.react.views.modal.ReactModalHostManager;
|
|
50
|
-
import com.facebook.react.views.popupmenu.ReactPopupMenuManager;
|
|
51
49
|
import com.facebook.react.views.progressbar.ReactProgressBarViewManager;
|
|
52
50
|
import com.facebook.react.views.scroll.ReactHorizontalScrollContainerViewManager;
|
|
53
51
|
import com.facebook.react.views.scroll.ReactHorizontalScrollViewManager;
|
|
@@ -171,7 +169,6 @@ public class MainReactPackage extends TurboReactPackage implements ViewManagerOn
|
|
|
171
169
|
viewManagers.add(new ReactScrollViewManager());
|
|
172
170
|
viewManagers.add(new ReactSwitchManager());
|
|
173
171
|
viewManagers.add(new SwipeRefreshLayoutManager());
|
|
174
|
-
viewManagers.add(new ReactPopupMenuManager());
|
|
175
172
|
|
|
176
173
|
// Native equivalents
|
|
177
174
|
viewManagers.add(new FrescoBasedReactTextInlineImageViewManager());
|
|
@@ -213,7 +210,6 @@ public class MainReactPackage extends TurboReactPackage implements ViewManagerOn
|
|
|
213
210
|
appendMap(viewManagers, ReactSwitchManager.REACT_CLASS, ReactSwitchManager::new);
|
|
214
211
|
appendMap(
|
|
215
212
|
viewManagers, SwipeRefreshLayoutManager.REACT_CLASS, SwipeRefreshLayoutManager::new);
|
|
216
|
-
appendMap(viewManagers, ReactPopupMenuManager.REACT_CLASS, ReactPopupMenuManager::new);
|
|
217
213
|
appendMap(
|
|
218
214
|
viewManagers,
|
|
219
215
|
FrescoBasedReactTextInlineImageViewManager.REACT_CLASS,
|
|
@@ -300,7 +296,7 @@ public class MainReactPackage extends TurboReactPackage implements ViewManagerOn
|
|
|
300
296
|
reactModule.canOverrideExistingModule(),
|
|
301
297
|
reactModule.needsEagerInit(),
|
|
302
298
|
reactModule.isCxxModule(),
|
|
303
|
-
|
|
299
|
+
ReactModuleInfo.classIsTurboModule(moduleClass)));
|
|
304
300
|
}
|
|
305
301
|
}
|
|
306
302
|
return () -> reactModuleInfoMap;
|
package/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/interfaces/TurboModule.kt
CHANGED
|
@@ -6,15 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
package com.facebook.react.turbomodule.core.interfaces
|
|
9
|
+
/** All turbo modules should inherit from this interface */
|
|
10
|
+
public interface TurboModule {
|
|
11
|
+
/** Initialize the TurboModule. */
|
|
12
|
+
public fun initialize()
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* See description of https://github.com/facebook/react-native/pull/41412 for more context.
|
|
17
|
-
*/
|
|
18
|
-
@DeprecatedInNewArchitecture
|
|
19
|
-
public interface TurboModule :
|
|
20
|
-
com.facebook.react.internal.turbomodule.core.interfaces.TurboModule {}
|
|
14
|
+
/**
|
|
15
|
+
* Called during the turn down process of ReactHost. This method is called before React Native is
|
|
16
|
+
* stopped. Override this method to clean up resources used by the TurboModule.
|
|
17
|
+
*/
|
|
18
|
+
public fun invalidate()
|
|
19
|
+
}
|
|
@@ -67,8 +67,6 @@ CoreComponentsRegistry::sharedProviderRegistry() {
|
|
|
67
67
|
AndroidDrawerLayoutComponentDescriptor>());
|
|
68
68
|
providerRegistry->add(concreteComponentDescriptorProvider<
|
|
69
69
|
DebuggingOverlayComponentDescriptor>());
|
|
70
|
-
providerRegistry->add(concreteComponentDescriptorProvider<
|
|
71
|
-
AndroidPopupMenuComponentDescriptor>());
|
|
72
70
|
|
|
73
71
|
return providerRegistry;
|
|
74
72
|
}();
|
|
@@ -19,7 +19,7 @@ namespace facebook::react {
|
|
|
19
19
|
|
|
20
20
|
struct JTurboModule : jni::JavaClass<JTurboModule> {
|
|
21
21
|
static auto constexpr kJavaDescriptor =
|
|
22
|
-
"Lcom/facebook/react/
|
|
22
|
+
"Lcom/facebook/react/turbomodule/core/interfaces/TurboModule;";
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
class JSI_EXPORT JavaTurboModule : public TurboModule {
|
package/ReactCommon/react/nativemodule/samples/platform/android/NativeSampleTurboModuleSpec.java
CHANGED
|
@@ -19,7 +19,7 @@ import com.facebook.react.bridge.ReadableMap;
|
|
|
19
19
|
import com.facebook.react.bridge.WritableArray;
|
|
20
20
|
import com.facebook.react.bridge.WritableMap;
|
|
21
21
|
import com.facebook.react.common.build.ReactBuildConfig;
|
|
22
|
-
import com.facebook.react.
|
|
22
|
+
import com.facebook.react.turbomodule.core.interfaces.TurboModule;
|
|
23
23
|
import java.util.Arrays;
|
|
24
24
|
import java.util.HashSet;
|
|
25
25
|
import java.util.Map;
|
|
@@ -52,6 +52,10 @@ typedef std::shared_ptr<facebook::react::JSRuntimeFactory> (^RCTHostJSEngineProv
|
|
|
52
52
|
|
|
53
53
|
@property (nonatomic, weak, nullable) id<RCTHostRuntimeDelegate> runtimeDelegate;
|
|
54
54
|
|
|
55
|
+
@property (nonatomic, readonly) RCTSurfacePresenter *surfacePresenter;
|
|
56
|
+
|
|
57
|
+
@property (nonatomic, readonly) RCTModuleRegistry *moduleRegistry;
|
|
58
|
+
|
|
55
59
|
- (void)start;
|
|
56
60
|
|
|
57
61
|
- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args;
|
|
@@ -64,11 +68,11 @@ typedef std::shared_ptr<facebook::react::JSRuntimeFactory> (^RCTHostJSEngineProv
|
|
|
64
68
|
|
|
65
69
|
- (RCTFabricSurface *)createSurfaceWithModuleName:(NSString *)moduleName initialProperties:(NSDictionary *)properties;
|
|
66
70
|
|
|
67
|
-
- (RCTSurfacePresenter *)getSurfacePresenter;
|
|
71
|
+
- (RCTSurfacePresenter *)getSurfacePresenter __attribute__((deprecated("Use `surfacePresenter` property instead.")));
|
|
68
72
|
|
|
69
73
|
// Native module API
|
|
70
74
|
|
|
71
|
-
- (RCTModuleRegistry *)getModuleRegistry;
|
|
75
|
+
- (RCTModuleRegistry *)getModuleRegistry __attribute__((deprecated("Use `moduleRegistry` property instead.")));
|
|
72
76
|
|
|
73
77
|
@end
|
|
74
78
|
|
|
@@ -212,7 +212,7 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
|
|
|
212
212
|
mode:(DisplayMode)displayMode
|
|
213
213
|
initialProperties:(NSDictionary *)properties
|
|
214
214
|
{
|
|
215
|
-
RCTFabricSurface *surface = [[RCTFabricSurface alloc] initWithSurfacePresenter:
|
|
215
|
+
RCTFabricSurface *surface = [[RCTFabricSurface alloc] initWithSurfacePresenter:self.surfacePresenter
|
|
216
216
|
moduleName:moduleName
|
|
217
217
|
initialProperties:properties];
|
|
218
218
|
surface.surfaceHandler.setDisplayMode(displayMode);
|
|
@@ -235,16 +235,28 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
|
|
|
235
235
|
return [self createSurfaceWithModuleName:moduleName mode:DisplayMode::Visible initialProperties:properties];
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
-
- (RCTModuleRegistry *)
|
|
238
|
+
- (RCTModuleRegistry *)moduleRegistry
|
|
239
239
|
{
|
|
240
240
|
return _moduleRegistry;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
// Deprecated
|
|
244
|
+
- (RCTModuleRegistry *)getModuleRegistry
|
|
245
|
+
{
|
|
246
|
+
return self.moduleRegistry;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
- (RCTSurfacePresenter *)surfacePresenter
|
|
244
250
|
{
|
|
245
251
|
return [_instance surfacePresenter];
|
|
246
252
|
}
|
|
247
253
|
|
|
254
|
+
// Deprecated
|
|
255
|
+
- (RCTSurfacePresenter *)getSurfacePresenter
|
|
256
|
+
{
|
|
257
|
+
return self.surfacePresenter;
|
|
258
|
+
}
|
|
259
|
+
|
|
248
260
|
- (void)callFunctionOnJSModule:(NSString *)moduleName method:(NSString *)method args:(NSArray *)args
|
|
249
261
|
{
|
|
250
262
|
[_instance callFunctionOnJSModule:moduleName method:method args:args];
|
|
@@ -276,7 +288,7 @@ class RCTHostPageTargetDelegate : public facebook::react::jsinspector_modern::Pa
|
|
|
276
288
|
[_hostDelegate hostDidStart:self];
|
|
277
289
|
|
|
278
290
|
for (RCTFabricSurface *surface in [self _getAttachedSurfaces]) {
|
|
279
|
-
[surface resetWithSurfacePresenter:
|
|
291
|
+
[surface resetWithSurfacePresenter:self.surfacePresenter];
|
|
280
292
|
}
|
|
281
293
|
}
|
|
282
294
|
|
package/index.js
CHANGED
|
@@ -27,7 +27,6 @@ import typeof Clipboard from './Libraries/Components/Clipboard/Clipboard';
|
|
|
27
27
|
import typeof DrawerLayoutAndroid from './Libraries/Components/DrawerAndroid/DrawerLayoutAndroid';
|
|
28
28
|
import typeof Keyboard from './Libraries/Components/Keyboard/Keyboard';
|
|
29
29
|
import typeof KeyboardAvoidingView from './Libraries/Components/Keyboard/KeyboardAvoidingView';
|
|
30
|
-
import typeof PopupMenuAndroid from './Libraries/Components/PopupMenuAndroid/PopupMenuAndroid';
|
|
31
30
|
import typeof Pressable from './Libraries/Components/Pressable/Pressable';
|
|
32
31
|
import typeof ProgressBarAndroid from './Libraries/Components/ProgressBarAndroid/ProgressBarAndroid';
|
|
33
32
|
import typeof RefreshControl from './Libraries/Components/RefreshControl/RefreshControl';
|
|
@@ -135,10 +134,6 @@ module.exports = {
|
|
|
135
134
|
return require('./Libraries/Components/Keyboard/KeyboardAvoidingView')
|
|
136
135
|
.default;
|
|
137
136
|
},
|
|
138
|
-
get PopupMenuAndroid(): PopupMenuAndroid {
|
|
139
|
-
return require('./Libraries/Components/PopupMenuAndroid/PopupMenuAndroid')
|
|
140
|
-
.default;
|
|
141
|
-
},
|
|
142
137
|
get Modal(): Modal {
|
|
143
138
|
return require('./Libraries/Modal/Modal');
|
|
144
139
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.74.0-rc.
|
|
3
|
+
"version": "0.74.0-rc.2",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
"@react-native-community/cli-platform-android": "13.6.1",
|
|
103
103
|
"@react-native-community/cli-platform-ios": "13.6.1",
|
|
104
104
|
"@react-native/assets-registry": "0.74.0",
|
|
105
|
-
"@react-native/codegen": "0.74.
|
|
106
|
-
"@react-native/community-cli-plugin": "0.74.
|
|
105
|
+
"@react-native/codegen": "0.74.2",
|
|
106
|
+
"@react-native/community-cli-plugin": "0.74.4",
|
|
107
107
|
"@react-native/gradle-plugin": "0.74.1",
|
|
108
108
|
"@react-native/js-polyfills": "0.74.0",
|
|
109
109
|
"@react-native/normalize-colors": "0.74.1",
|
|
@@ -283,11 +283,7 @@ function findLibrariesFromReactNativeConfig(projectRoot) {
|
|
|
283
283
|
return [];
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
return extractLibrariesFromJSON(
|
|
287
|
-
configFile,
|
|
288
|
-
configFile.name,
|
|
289
|
-
codegenConfigFileDir,
|
|
290
|
-
);
|
|
286
|
+
return extractLibrariesFromJSON(configFile, codegenConfigFileDir);
|
|
291
287
|
});
|
|
292
288
|
}
|
|
293
289
|
|
|
@@ -7,6 +7,7 @@ require 'net/http'
|
|
|
7
7
|
require 'rexml/document'
|
|
8
8
|
|
|
9
9
|
HERMES_GITHUB_URL = "https://github.com/facebook/hermes.git"
|
|
10
|
+
ENV_BUILD_FROM_SOURCE = "RCT_BUILD_HERMES_FROM_SOURCE"
|
|
10
11
|
|
|
11
12
|
module HermesEngineSourceType
|
|
12
13
|
LOCAL_PREBUILT_TARBALL = :local_prebuilt_tarball
|
|
@@ -30,7 +31,7 @@ end
|
|
|
30
31
|
# - To use a specific tarball, install the dependencies with:
|
|
31
32
|
# `HERMES_ENGINE_TARBALL_PATH=<path_to_tarball> bundle exec pod install`
|
|
32
33
|
# - To force a build from source, install the dependencies with:
|
|
33
|
-
# `
|
|
34
|
+
# `RCT_BUILD_HERMES_FROM_SOURCE=true bundle exec pod install`
|
|
34
35
|
# If none of the two are provided, Cocoapods will check whether there is a tarball for the current version
|
|
35
36
|
# (either release or nightly). If not, it will fall back to building from source (the latest commit on main).
|
|
36
37
|
#
|
|
@@ -85,11 +86,11 @@ def hermes_commit_envvar_defined()
|
|
|
85
86
|
end
|
|
86
87
|
|
|
87
88
|
def force_build_from_tag(react_native_path)
|
|
88
|
-
return ENV[
|
|
89
|
+
return ENV[ENV_BUILD_FROM_SOURCE] === 'true' && File.exist?(hermestag_file(react_native_path))
|
|
89
90
|
end
|
|
90
91
|
|
|
91
92
|
def force_build_from_main(react_native_path)
|
|
92
|
-
return ENV[
|
|
93
|
+
return ENV[ENV_BUILD_FROM_SOURCE] === 'true' && !File.exist?(hermestag_file(react_native_path))
|
|
93
94
|
end
|
|
94
95
|
|
|
95
96
|
def release_artifact_exists(version)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/template/package.json
CHANGED
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"react": "18.2.0",
|
|
14
|
-
"react-native": "0.74.0-rc.
|
|
14
|
+
"react-native": "0.74.0-rc.2"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@babel/core": "^7.20.0",
|
|
18
18
|
"@babel/preset-env": "^7.20.0",
|
|
19
19
|
"@babel/runtime": "^7.20.0",
|
|
20
|
-
"@react-native/babel-preset": "0.74.
|
|
20
|
+
"@react-native/babel-preset": "0.74.2",
|
|
21
21
|
"@react-native/eslint-config": "0.74.1",
|
|
22
|
-
"@react-native/metro-config": "0.74.
|
|
22
|
+
"@react-native/metro-config": "0.74.2",
|
|
23
23
|
"@react-native/typescript-config": "0.74.1",
|
|
24
24
|
"@types/react": "^18.2.6",
|
|
25
25
|
"@types/react-test-renderer": "^18.0.0",
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @flow strict-local
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {HostComponent} from '../../Renderer/shims/ReactNativeTypes';
|
|
12
|
-
import type {SyntheticEvent} from '../../Types/CoreEventTypes';
|
|
13
|
-
import type {RefObject} from 'react';
|
|
14
|
-
|
|
15
|
-
import PopupMenuAndroidNativeComponent, {
|
|
16
|
-
Commands,
|
|
17
|
-
} from './PopupMenuAndroidNativeComponent';
|
|
18
|
-
import nullthrows from 'nullthrows';
|
|
19
|
-
import * as React from 'react';
|
|
20
|
-
import {useCallback, useImperativeHandle, useRef} from 'react';
|
|
21
|
-
|
|
22
|
-
type PopupMenuSelectionEvent = SyntheticEvent<
|
|
23
|
-
$ReadOnly<{
|
|
24
|
-
item: number,
|
|
25
|
-
}>,
|
|
26
|
-
>;
|
|
27
|
-
|
|
28
|
-
export type PopupMenuAndroidInstance = {
|
|
29
|
-
+show: () => void,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
type Props = {
|
|
33
|
-
menuItems: $ReadOnlyArray<string>,
|
|
34
|
-
onSelectionChange: number => void,
|
|
35
|
-
children: React.Node,
|
|
36
|
-
instanceRef: RefObject<?PopupMenuAndroidInstance>,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default function PopupMenuAndroid({
|
|
40
|
-
menuItems,
|
|
41
|
-
onSelectionChange,
|
|
42
|
-
children,
|
|
43
|
-
instanceRef,
|
|
44
|
-
}: Props): React.Node {
|
|
45
|
-
const nativeRef = useRef<React.ElementRef<HostComponent<mixed>> | null>(null);
|
|
46
|
-
const _onSelectionChange = useCallback(
|
|
47
|
-
(event: PopupMenuSelectionEvent) => {
|
|
48
|
-
onSelectionChange(event.nativeEvent.item);
|
|
49
|
-
},
|
|
50
|
-
[onSelectionChange],
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
useImperativeHandle(instanceRef, ItemViewabilityInstance => {
|
|
54
|
-
return {
|
|
55
|
-
show() {
|
|
56
|
-
Commands.show(nullthrows(nativeRef.current));
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
return (
|
|
62
|
-
<PopupMenuAndroidNativeComponent
|
|
63
|
-
ref={nativeRef}
|
|
64
|
-
onSelectionChange={_onSelectionChange}
|
|
65
|
-
menuItems={menuItems}>
|
|
66
|
-
{children}
|
|
67
|
-
</PopupMenuAndroidNativeComponent>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type * as React from 'react';
|
|
11
|
-
import {HostComponent} from '../../../types/public/ReactNativeTypes';
|
|
12
|
-
|
|
13
|
-
type PopupMenuAndroidInstance = {
|
|
14
|
-
show: () => void;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
type Props = {
|
|
18
|
-
menuItems: Array<string>;
|
|
19
|
-
onSelectionChange: (number) => void;
|
|
20
|
-
children: React.ReactNode | undefined;
|
|
21
|
-
instanceRef: React.ElementRef<HostComponent<PopupMenuAndroidInstance>>;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
declare class PopupMenuAndroid extends React.Component<Props> {}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @flow strict-local
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {RefObject} from 'react';
|
|
12
|
-
import type {Node} from 'react';
|
|
13
|
-
|
|
14
|
-
import * as React from 'react';
|
|
15
|
-
|
|
16
|
-
const UnimplementedView = require('../UnimplementedViews/UnimplementedView');
|
|
17
|
-
|
|
18
|
-
export type PopupMenuAndroidInstance = {
|
|
19
|
-
+show: () => void,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
type Props = {
|
|
23
|
-
menuItems: $ReadOnlyArray<string>,
|
|
24
|
-
onSelectionChange: number => void,
|
|
25
|
-
children: Node,
|
|
26
|
-
instanceRef: RefObject<?PopupMenuAndroidInstance>,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
function PopupMenuAndroid(props: Props): Node {
|
|
30
|
-
return <UnimplementedView />;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default PopupMenuAndroid;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @flow strict-local
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
export * from '../../../src/private/specs/components/PopupMenuAndroidNativeComponent';
|
|
12
|
-
import PopupMenuAndroidNativeComponent from '../../../src/private/specs/components/PopupMenuAndroidNativeComponent';
|
|
13
|
-
export default PopupMenuAndroidNativeComponent;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
package com.facebook.react.internal.turbomodule.core.interfaces
|
|
9
|
-
/** All turbo modules should inherit from this interface */
|
|
10
|
-
public interface TurboModule {
|
|
11
|
-
/** Initialize the TurboModule. */
|
|
12
|
-
public fun initialize()
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Called during the turn down process of ReactHost. This method is called before React Native is
|
|
16
|
-
* stopped. Override this method to clean up resources used by the TurboModule.
|
|
17
|
-
*/
|
|
18
|
-
public fun invalidate()
|
|
19
|
-
}
|
package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/PopupMenuSelectionEvent.kt
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
@file:Suppress("DEPRECATION") // We want to use RCTEventEmitter for interop purposes
|
|
9
|
-
|
|
10
|
-
package com.facebook.react.views.popupmenu
|
|
11
|
-
|
|
12
|
-
import com.facebook.react.bridge.Arguments
|
|
13
|
-
import com.facebook.react.bridge.WritableMap
|
|
14
|
-
import com.facebook.react.uimanager.events.Event
|
|
15
|
-
import com.facebook.react.uimanager.events.RCTEventEmitter
|
|
16
|
-
|
|
17
|
-
public class PopupMenuSelectionEvent(surfaceId: Int, viewId: Int, private val item: Int) :
|
|
18
|
-
Event<PopupMenuSelectionEvent>(surfaceId, viewId) {
|
|
19
|
-
|
|
20
|
-
override fun getEventName(): String {
|
|
21
|
-
return EVENT_NAME
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
override fun getEventData(): WritableMap {
|
|
25
|
-
val eventData: WritableMap = Arguments.createMap()
|
|
26
|
-
eventData.putInt("target", viewTag)
|
|
27
|
-
eventData.putDouble("item", item.toDouble())
|
|
28
|
-
return eventData
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
override fun dispatch(rctEventEmitter: RCTEventEmitter) {
|
|
32
|
-
rctEventEmitter.receiveEvent(viewTag, eventName, eventData)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public companion object {
|
|
36
|
-
public const val EVENT_NAME: String = "topSelectionChange"
|
|
37
|
-
}
|
|
38
|
-
}
|
package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuContainer.kt
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
package com.facebook.react.views.popupmenu
|
|
9
|
-
|
|
10
|
-
import android.content.Context
|
|
11
|
-
import android.os.Build
|
|
12
|
-
import android.view.Menu
|
|
13
|
-
import android.widget.FrameLayout
|
|
14
|
-
import android.widget.PopupMenu
|
|
15
|
-
import com.facebook.react.bridge.ReactContext
|
|
16
|
-
import com.facebook.react.bridge.ReadableArray
|
|
17
|
-
import com.facebook.react.uimanager.UIManagerHelper
|
|
18
|
-
|
|
19
|
-
public class ReactPopupMenuContainer(context: Context) : FrameLayout(context) {
|
|
20
|
-
private var menuItems: ReadableArray? = null
|
|
21
|
-
|
|
22
|
-
public fun setMenuItems(items: ReadableArray?) {
|
|
23
|
-
menuItems = items
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public fun showPopupMenu() {
|
|
27
|
-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
|
|
28
|
-
val view = getChildAt(0)
|
|
29
|
-
val popupMenu = PopupMenu(context, view)
|
|
30
|
-
var menu = popupMenu.menu
|
|
31
|
-
val items = menuItems
|
|
32
|
-
if (items != null) {
|
|
33
|
-
for (i in 0 until items.size()) {
|
|
34
|
-
menu.add(Menu.NONE, Menu.NONE, i, items.getString(i))
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
popupMenu.setOnMenuItemClickListener { menuItem ->
|
|
38
|
-
val reactContext = context as ReactContext
|
|
39
|
-
val eventDispatcher = UIManagerHelper.getEventDispatcherForReactTag(reactContext, id)
|
|
40
|
-
if (eventDispatcher != null) {
|
|
41
|
-
val surfaceId = UIManagerHelper.getSurfaceId(reactContext)
|
|
42
|
-
eventDispatcher.dispatchEvent(PopupMenuSelectionEvent(surfaceId, id, menuItem.order))
|
|
43
|
-
}
|
|
44
|
-
true
|
|
45
|
-
}
|
|
46
|
-
popupMenu.show()
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
package/ReactAndroid/src/main/java/com/facebook/react/views/popupmenu/ReactPopupMenuManager.kt
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
package com.facebook.react.views.popupmenu
|
|
9
|
-
|
|
10
|
-
import com.facebook.react.bridge.ReadableArray
|
|
11
|
-
import com.facebook.react.module.annotations.ReactModule
|
|
12
|
-
import com.facebook.react.uimanager.ThemedReactContext
|
|
13
|
-
import com.facebook.react.uimanager.ViewGroupManager
|
|
14
|
-
import com.facebook.react.uimanager.annotations.ReactProp
|
|
15
|
-
import com.facebook.react.viewmanagers.AndroidPopupMenuManagerInterface
|
|
16
|
-
|
|
17
|
-
@ReactModule(name = ReactPopupMenuManager.REACT_CLASS)
|
|
18
|
-
public class ReactPopupMenuManager :
|
|
19
|
-
ViewGroupManager<ReactPopupMenuContainer>(),
|
|
20
|
-
AndroidPopupMenuManagerInterface<ReactPopupMenuContainer> {
|
|
21
|
-
override fun createViewInstance(reactContext: ThemedReactContext): ReactPopupMenuContainer {
|
|
22
|
-
return ReactPopupMenuContainer(reactContext)
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
@ReactProp(name = "menuItems")
|
|
26
|
-
override fun setMenuItems(view: ReactPopupMenuContainer, menuItems: ReadableArray?) {
|
|
27
|
-
view.setMenuItems(menuItems)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
override fun getName(): String {
|
|
31
|
-
return REACT_CLASS
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
override fun receiveCommand(
|
|
35
|
-
view: ReactPopupMenuContainer,
|
|
36
|
-
commandId: String,
|
|
37
|
-
items: ReadableArray?
|
|
38
|
-
) {
|
|
39
|
-
when (commandId) {
|
|
40
|
-
"show" -> show(view)
|
|
41
|
-
else -> {
|
|
42
|
-
// no-op
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
override fun show(popupMenu: ReactPopupMenuContainer) {
|
|
48
|
-
popupMenu.showPopupMenu()
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public companion object {
|
|
52
|
-
public const val REACT_CLASS: String = "AndroidPopupMenu"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @flow strict-local
|
|
8
|
-
* @format
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {ViewProps} from '../../../../Libraries/Components/View/ViewPropTypes';
|
|
12
|
-
import type {HostComponent} from '../../../../Libraries/Renderer/shims/ReactNativeTypes';
|
|
13
|
-
import type {
|
|
14
|
-
DirectEventHandler,
|
|
15
|
-
Int32,
|
|
16
|
-
} from '../../../../Libraries/Types/CodegenTypes';
|
|
17
|
-
|
|
18
|
-
import codegenNativeCommands from '../../../../Libraries/Utilities/codegenNativeCommands';
|
|
19
|
-
import codegenNativeComponent from '../../../../Libraries/Utilities/codegenNativeComponent';
|
|
20
|
-
import * as React from 'react';
|
|
21
|
-
|
|
22
|
-
type PopupMenuSelectionEvent = $ReadOnly<{
|
|
23
|
-
item: Int32,
|
|
24
|
-
}>;
|
|
25
|
-
|
|
26
|
-
type NativeProps = $ReadOnly<{
|
|
27
|
-
...ViewProps,
|
|
28
|
-
|
|
29
|
-
//Props
|
|
30
|
-
menuItems?: ?$ReadOnlyArray<string>,
|
|
31
|
-
|
|
32
|
-
onSelectionChange?: DirectEventHandler<PopupMenuSelectionEvent>,
|
|
33
|
-
}>;
|
|
34
|
-
|
|
35
|
-
type ComponentType = HostComponent<NativeProps>;
|
|
36
|
-
|
|
37
|
-
interface NativeCommands {
|
|
38
|
-
+show: (viewRef: React.ElementRef<ComponentType>) => void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
42
|
-
supportedCommands: ['show'],
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
export default (codegenNativeComponent<NativeProps>(
|
|
46
|
-
'AndroidPopupMenu',
|
|
47
|
-
): HostComponent<NativeProps>);
|