react-native-tvos 0.74.0-0rc2 → 0.74.1-0
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+Protected.h +16 -0
- package/Libraries/AppDelegate/RCTAppDelegate.mm +32 -1
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +1 -0
- package/Libraries/Components/Touchable/TouchableBounce.js +1 -0
- package/Libraries/Components/Touchable/TouchableOpacity.js +1 -0
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/Libraries/ReactNative/AppContainer-dev.js +6 -1
- package/Libraries/ReactNative/RendererImplementation.js +2 -0
- package/README.md +29 -9
- package/React/Base/RCTUtils.m +28 -8
- package/React/Base/RCTVersion.m +2 -2
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +2 -4
- package/React/CoreModules/RCTDevMenu.mm +1 -1
- package/React/CoreModules/RCTDevSettings.mm +9 -4
- package/React/CoreModules/RCTTVNavigationEventEmitter.mm +4 -0
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.h +4 -0
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +16 -6
- package/React/Fabric/Mounting/ComponentViews/Modal/RCTModalHostViewComponentView.mm +45 -0
- package/React/Fabric/Mounting/ComponentViews/Root/RCTRootComponentView.mm +22 -2
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +7 -3
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +2 -0
- package/React/Fabric/RCTScheduler.h +2 -0
- package/React/Fabric/RCTScheduler.mm +6 -0
- package/React/Fabric/RCTSurfacePresenter.mm +5 -0
- package/React/Modules/RCTUIManager.m +8 -9
- package/React/Views/RCTComponentData.m +14 -1
- package/React/Views/RCTModalHostViewController.m +26 -0
- package/React/Views/ScrollView/RCTScrollView.m +1 -1
- package/ReactAndroid/api/ReactAndroid.api +1 -2
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivity.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +24 -9
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +15 -0
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +19 -7
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +31 -11
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +7 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +7 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +34 -12
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +7 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +15 -22
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +10 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.java +1 -3
- package/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +38 -3
- package/ReactAndroid/src/main/jni/react/fabric/Binding.h +8 -0
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +43 -15
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +10 -4
- package/ReactCommon/ReactCommon.podspec +1 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/jsc/JSCRuntime.cpp +2 -0
- package/ReactCommon/jsinspector-modern/React-jsinspector.podspec +2 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +13 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +16 -6
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +62 -26
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +8 -4
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +13 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +4 -2
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +16 -6
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +7 -3
- package/ReactCommon/react/renderer/mounting/MountingTransaction.cpp +13 -0
- package/ReactCommon/react/renderer/mounting/MountingTransaction.h +9 -0
- package/ReactCommon/react/renderer/scheduler/Scheduler.cpp +7 -2
- package/ReactCommon/react/renderer/scheduler/SchedulerDelegate.h +11 -0
- package/package.json +13 -13
- package/scripts/cocoapods/privacy_manifest_utils.rb +172 -0
- package/scripts/cocoapods/utils.rb +19 -3
- package/scripts/react_native_pods.rb +12 -2
- package/sdks/.hermesversion +1 -1
- 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/src/private/featureflags/NativeReactNativeFeatureFlags.js +4 -2
- package/src/private/featureflags/ReactNativeFeatureFlags.js +16 -6
- package/template/package.json +5 -5
- package/third-party-podspecs/RCT-Folly.podspec +1 -0
- package/types/public/ReactNativeTVTypes.d.ts +4 -8
- package/ReactAndroid/src/main/java/com/facebook/react/ReactAndroidHWInputDeviceHelper.java +0 -98
|
@@ -354,6 +354,11 @@ static BackgroundExecutor RCTGetBackgroundExecutor()
|
|
|
354
354
|
#pragma mark - RCTSchedulerDelegate
|
|
355
355
|
|
|
356
356
|
- (void)schedulerDidFinishTransaction:(MountingCoordinator::Shared)mountingCoordinator
|
|
357
|
+
{
|
|
358
|
+
// no-op, we will flush the transaction from schedulerShouldRenderTransactions
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
- (void)schedulerShouldRenderTransactions:(MountingCoordinator::Shared)mountingCoordinator
|
|
357
362
|
{
|
|
358
363
|
[_mountingManager scheduleTransaction:mountingCoordinator];
|
|
359
364
|
}
|
|
@@ -1678,8 +1678,8 @@ static UIView *_jsResponder;
|
|
|
1678
1678
|
{
|
|
1679
1679
|
self = [super init];
|
|
1680
1680
|
if (self) {
|
|
1681
|
-
|
|
1682
|
-
|
|
1681
|
+
_uiManager = uiManager;
|
|
1682
|
+
_registry = registry;
|
|
1683
1683
|
}
|
|
1684
1684
|
return self;
|
|
1685
1685
|
}
|
|
@@ -1697,26 +1697,27 @@ static UIView *_jsResponder;
|
|
|
1697
1697
|
- (id)objectForKey:(id)key
|
|
1698
1698
|
{
|
|
1699
1699
|
if (![key isKindOfClass:[NSNumber class]]) {
|
|
1700
|
-
return
|
|
1700
|
+
return NULL;
|
|
1701
1701
|
}
|
|
1702
1702
|
|
|
1703
1703
|
NSNumber *index = (NSNumber *)key;
|
|
1704
|
-
UIView *view = [
|
|
1704
|
+
UIView *view = _registry[index];
|
|
1705
1705
|
if (view) {
|
|
1706
1706
|
return [RCTUIManager paperViewOrCurrentView:view];
|
|
1707
1707
|
}
|
|
1708
|
-
view =
|
|
1708
|
+
view = [_uiManager viewForReactTag:index];
|
|
1709
1709
|
if (view) {
|
|
1710
1710
|
return [RCTUIManager paperViewOrCurrentView:view];
|
|
1711
1711
|
}
|
|
1712
|
-
return
|
|
1712
|
+
return NULL;
|
|
1713
1713
|
}
|
|
1714
1714
|
|
|
1715
1715
|
- (void)removeObjectForKey:(id)key
|
|
1716
1716
|
{
|
|
1717
1717
|
if (![key isKindOfClass:[NSNumber class]]) {
|
|
1718
|
-
return
|
|
1718
|
+
return;
|
|
1719
1719
|
}
|
|
1720
|
+
|
|
1720
1721
|
NSNumber *tag = (NSNumber *)key;
|
|
1721
1722
|
|
|
1722
1723
|
if (_registry[key]) {
|
|
@@ -1724,8 +1725,6 @@ static UIView *_jsResponder;
|
|
|
1724
1725
|
[mutableRegistry removeObjectForKey:tag];
|
|
1725
1726
|
} else if ([_uiManager viewForReactTag:tag]) {
|
|
1726
1727
|
[_uiManager removeViewFromRegistry:tag];
|
|
1727
|
-
} else {
|
|
1728
|
-
[super removeObjectForKey:key];
|
|
1729
1728
|
}
|
|
1730
1729
|
}
|
|
1731
1730
|
|
|
@@ -418,7 +418,20 @@ static RCTPropBlock createNSInvocationSetter(NSMethodSignature *typeSignature, S
|
|
|
418
418
|
+ (NSDictionary<NSString *, id> *)constantsForViewMangerClass:(Class)managerClass
|
|
419
419
|
{
|
|
420
420
|
if ([managerClass instancesRespondToSelector:@selector(constantsToExport)]) {
|
|
421
|
-
|
|
421
|
+
BOOL shouldRunOnMainThread = NO;
|
|
422
|
+
|
|
423
|
+
if ([managerClass respondsToSelector:@selector(requiresMainQueueSetup)]) {
|
|
424
|
+
shouldRunOnMainThread = [managerClass requiresMainQueueSetup];
|
|
425
|
+
}
|
|
426
|
+
if (shouldRunOnMainThread) {
|
|
427
|
+
__block NSDictionary<NSString *, id> *constants;
|
|
428
|
+
RCTUnsafeExecuteOnMainQueueSync(^{
|
|
429
|
+
constants = [[managerClass new] constantsToExport];
|
|
430
|
+
});
|
|
431
|
+
return constants;
|
|
432
|
+
} else {
|
|
433
|
+
return [[managerClass new] constantsToExport];
|
|
434
|
+
}
|
|
422
435
|
}
|
|
423
436
|
return @{};
|
|
424
437
|
}
|
|
@@ -34,6 +34,32 @@
|
|
|
34
34
|
return self;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
- (void)viewDidAppear:(BOOL)animated
|
|
38
|
+
{
|
|
39
|
+
#if TARGET_OS_TV
|
|
40
|
+
[self.modalHostView enableEventHandlers];
|
|
41
|
+
#endif
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
- (void)viewWillDisappear:(BOOL)animated
|
|
45
|
+
{
|
|
46
|
+
#if TARGET_OS_TV
|
|
47
|
+
[self.modalHostView disableEventHandlers];
|
|
48
|
+
if (self.modalHostView.onRequestClose) {
|
|
49
|
+
self.modalHostView.onRequestClose(nil);
|
|
50
|
+
}
|
|
51
|
+
#endif
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
- (void)viewDidDisappear:(BOOL)animated
|
|
55
|
+
{
|
|
56
|
+
#if TARGET_OS_TV
|
|
57
|
+
if (self.modalHostView.onDismiss) {
|
|
58
|
+
self.modalHostView.onDismiss(nil);
|
|
59
|
+
}
|
|
60
|
+
#endif
|
|
61
|
+
}
|
|
62
|
+
|
|
37
63
|
- (void)viewDidLayoutSubviews
|
|
38
64
|
{
|
|
39
65
|
[super viewDidLayoutSubviews];
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
#import "RCTConvert.h"
|
|
13
13
|
#import "RCTLog.h"
|
|
14
14
|
#import "RCTScrollEvent.h"
|
|
15
|
-
#import "RCTTVNavigationEventNotification.h"
|
|
16
15
|
#import "RCTUIManager.h"
|
|
17
16
|
#import "RCTUIManagerObserverCoordinator.h"
|
|
18
17
|
#import "RCTUIManagerUtils.h"
|
|
@@ -23,6 +22,7 @@
|
|
|
23
22
|
|
|
24
23
|
#if TARGET_OS_TV
|
|
25
24
|
#import "RCTTVRemoteHandler.h"
|
|
25
|
+
#import "RCTTVNavigationEventNotification.h"
|
|
26
26
|
#endif
|
|
27
27
|
|
|
28
28
|
#if !TARGET_OS_TV
|
|
@@ -92,7 +92,7 @@ public abstract class com/facebook/react/ReactActivity : androidx/appcompat/app/
|
|
|
92
92
|
protected fun <init> ()V
|
|
93
93
|
protected fun createReactActivityDelegate ()Lcom/facebook/react/ReactActivityDelegate;
|
|
94
94
|
protected fun getMainComponentName ()Ljava/lang/String;
|
|
95
|
-
public fun getReactDelegate ()
|
|
95
|
+
public fun getReactDelegate ()Lcom/facebook/react/ReactDelegate;
|
|
96
96
|
protected final fun getReactInstanceManager ()Lcom/facebook/react/ReactInstanceManager;
|
|
97
97
|
protected final fun getReactNativeHost ()Lcom/facebook/react/ReactNativeHost;
|
|
98
98
|
public fun invokeDefaultOnBackPressed ()V
|
|
@@ -7697,4 +7697,3 @@ public class com/facebook/react/views/view/ViewGroupClickEvent : com/facebook/re
|
|
|
7697
7697
|
protected fun getEventData ()Lcom/facebook/react/bridge/WritableMap;
|
|
7698
7698
|
public fun getEventName ()Ljava/lang/String;
|
|
7699
7699
|
}
|
|
7700
|
-
|
|
@@ -65,8 +65,8 @@ public abstract class ReactActivity extends AppCompatActivity
|
|
|
65
65
|
mDelegate.onDestroy();
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
public
|
|
69
|
-
mDelegate.getReactDelegate();
|
|
68
|
+
public @Nullable ReactDelegate getReactDelegate() {
|
|
69
|
+
return mDelegate.getReactDelegate();
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
@Override
|
|
@@ -15,6 +15,7 @@ import android.view.KeyEvent;
|
|
|
15
15
|
import androidx.annotation.NonNull;
|
|
16
16
|
import androidx.annotation.Nullable;
|
|
17
17
|
import com.facebook.infer.annotation.Assertions;
|
|
18
|
+
import com.facebook.react.bridge.UiThreadUtil;
|
|
18
19
|
import com.facebook.react.config.ReactFeatureFlags;
|
|
19
20
|
import com.facebook.react.devsupport.DisabledDevSupportManager;
|
|
20
21
|
import com.facebook.react.devsupport.DoubleTapReloadRecognizer;
|
|
@@ -99,7 +100,7 @@ public class ReactDelegate {
|
|
|
99
100
|
&& mReactHost.getDevSupportManager() != null) {
|
|
100
101
|
return mReactHost.getDevSupportManager();
|
|
101
102
|
} else if (getReactNativeHost().hasInstance()
|
|
102
|
-
&& getReactNativeHost().
|
|
103
|
+
&& getReactNativeHost().getReactInstanceManager() != null) {
|
|
103
104
|
return getReactNativeHost().getReactInstanceManager().getDevSupportManager();
|
|
104
105
|
} else {
|
|
105
106
|
return null;
|
|
@@ -241,17 +242,31 @@ public class ReactDelegate {
|
|
|
241
242
|
|
|
242
243
|
public void reload() {
|
|
243
244
|
DevSupportManager devSupportManager = getDevSupportManager();
|
|
244
|
-
if (devSupportManager
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
245
|
+
if (devSupportManager == null) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// Reload in RELEASE mode
|
|
250
|
+
if (devSupportManager instanceof DisabledDevSupportManager) {
|
|
251
|
+
// Do not reload the bundle from JS as there is no bundler running in release mode.
|
|
252
|
+
if (ReactFeatureFlags.enableBridgelessArchitecture) {
|
|
253
|
+
if (mReactHost != null) {
|
|
254
|
+
mReactHost.reload("ReactDelegate.reload()");
|
|
255
|
+
}
|
|
251
256
|
} else {
|
|
252
|
-
|
|
257
|
+
UiThreadUtil.runOnUiThread(
|
|
258
|
+
() -> {
|
|
259
|
+
if (mReactNativeHost.hasInstance()
|
|
260
|
+
&& mReactNativeHost.getReactInstanceManager() != null) {
|
|
261
|
+
mReactNativeHost.getReactInstanceManager().recreateReactContextInBackground();
|
|
262
|
+
}
|
|
263
|
+
});
|
|
253
264
|
}
|
|
265
|
+
return;
|
|
254
266
|
}
|
|
267
|
+
|
|
268
|
+
// Reload in DEBUG mode
|
|
269
|
+
devSupportManager.handleReloadJS();
|
|
255
270
|
}
|
|
256
271
|
|
|
257
272
|
public void loadApp() {
|
package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt
CHANGED
|
@@ -11,6 +11,8 @@ package com.facebook.react.defaults
|
|
|
11
11
|
|
|
12
12
|
import com.facebook.react.common.annotations.VisibleForTesting
|
|
13
13
|
import com.facebook.react.config.ReactFeatureFlags
|
|
14
|
+
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
|
|
15
|
+
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlagsDefaults
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* A utility class that serves as an entry point for users setup the New Architecture.
|
|
@@ -45,6 +47,19 @@ public object DefaultNewArchitectureEntryPoint {
|
|
|
45
47
|
ReactFeatureFlags.unstable_useTurboModuleInterop = bridgelessEnabled
|
|
46
48
|
ReactFeatureFlags.enableFabricPendingEventQueue = fabricEnabled
|
|
47
49
|
|
|
50
|
+
if (bridgelessEnabled) {
|
|
51
|
+
ReactNativeFeatureFlags.override(
|
|
52
|
+
object : ReactNativeFeatureFlagsDefaults() {
|
|
53
|
+
override fun useModernRuntimeScheduler(): Boolean = true
|
|
54
|
+
|
|
55
|
+
override fun enableMicrotasks(): Boolean = true
|
|
56
|
+
|
|
57
|
+
override fun batchRenderingUpdatesInEventLoop(): Boolean = true
|
|
58
|
+
|
|
59
|
+
override fun androidEnablePendingFabricTransactions(): Boolean = true
|
|
60
|
+
})
|
|
61
|
+
}
|
|
62
|
+
|
|
48
63
|
privateFabricEnabled = fabricEnabled
|
|
49
64
|
privateTurboModulesEnabled = turboModulesEnabled
|
|
50
65
|
privateConcurrentReactEnabled = fabricEnabled
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<b86e9fd5499308ce65b389342eb436a2>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -34,6 +34,24 @@ public object ReactNativeFeatureFlags {
|
|
|
34
34
|
@JvmStatic
|
|
35
35
|
public fun commonTestFlag(): Boolean = accessor.commonTestFlag()
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* To be used with batchRenderingUpdatesInEventLoop. When enbled, the Android mounting layer will concatenate pending transactions to ensure they're applied atomatically
|
|
39
|
+
*/
|
|
40
|
+
@JvmStatic
|
|
41
|
+
public fun androidEnablePendingFabricTransactions(): Boolean = accessor.androidEnablePendingFabricTransactions()
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.
|
|
45
|
+
*/
|
|
46
|
+
@JvmStatic
|
|
47
|
+
public fun batchRenderingUpdatesInEventLoop(): Boolean = accessor.batchRenderingUpdatesInEventLoop()
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* When enabled, ReactInstanceManager will clean up Fabric surfaces on destroy().
|
|
51
|
+
*/
|
|
52
|
+
@JvmStatic
|
|
53
|
+
public fun destroyFabricSurfacesInReactInstanceManager(): Boolean = accessor.destroyFabricSurfacesInReactInstanceManager()
|
|
54
|
+
|
|
37
55
|
/**
|
|
38
56
|
* Enables the use of a background executor to compute layout and commit updates on Fabric (this system is deprecated and should not be used).
|
|
39
57
|
*/
|
|
@@ -52,12 +70,6 @@ public object ReactNativeFeatureFlags {
|
|
|
52
70
|
@JvmStatic
|
|
53
71
|
public fun enableMicrotasks(): Boolean = accessor.enableMicrotasks()
|
|
54
72
|
|
|
55
|
-
/**
|
|
56
|
-
* When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.
|
|
57
|
-
*/
|
|
58
|
-
@JvmStatic
|
|
59
|
-
public fun batchRenderingUpdatesInEventLoop(): Boolean = accessor.batchRenderingUpdatesInEventLoop()
|
|
60
|
-
|
|
61
73
|
/**
|
|
62
74
|
* Uses new, deduplicated logic for constructing Android Spannables from text fragments
|
|
63
75
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<c0a85b92bca9bb03f28af67224239c09>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -21,10 +21,12 @@ package com.facebook.react.internal.featureflags
|
|
|
21
21
|
|
|
22
22
|
public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccessor {
|
|
23
23
|
private var commonTestFlagCache: Boolean? = null
|
|
24
|
+
private var androidEnablePendingFabricTransactionsCache: Boolean? = null
|
|
25
|
+
private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
|
|
26
|
+
private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
|
|
24
27
|
private var enableBackgroundExecutorCache: Boolean? = null
|
|
25
28
|
private var useModernRuntimeSchedulerCache: Boolean? = null
|
|
26
29
|
private var enableMicrotasksCache: Boolean? = null
|
|
27
|
-
private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
|
|
28
30
|
private var enableSpannableBuildingUnificationCache: Boolean? = null
|
|
29
31
|
private var enableCustomDrawOrderFabricCache: Boolean? = null
|
|
30
32
|
private var enableFixForClippedSubviewsCrashCache: Boolean? = null
|
|
@@ -40,6 +42,33 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
|
|
40
42
|
return cached
|
|
41
43
|
}
|
|
42
44
|
|
|
45
|
+
override fun androidEnablePendingFabricTransactions(): Boolean {
|
|
46
|
+
var cached = androidEnablePendingFabricTransactionsCache
|
|
47
|
+
if (cached == null) {
|
|
48
|
+
cached = ReactNativeFeatureFlagsCxxInterop.androidEnablePendingFabricTransactions()
|
|
49
|
+
androidEnablePendingFabricTransactionsCache = cached
|
|
50
|
+
}
|
|
51
|
+
return cached
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
override fun batchRenderingUpdatesInEventLoop(): Boolean {
|
|
55
|
+
var cached = batchRenderingUpdatesInEventLoopCache
|
|
56
|
+
if (cached == null) {
|
|
57
|
+
cached = ReactNativeFeatureFlagsCxxInterop.batchRenderingUpdatesInEventLoop()
|
|
58
|
+
batchRenderingUpdatesInEventLoopCache = cached
|
|
59
|
+
}
|
|
60
|
+
return cached
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
override fun destroyFabricSurfacesInReactInstanceManager(): Boolean {
|
|
64
|
+
var cached = destroyFabricSurfacesInReactInstanceManagerCache
|
|
65
|
+
if (cached == null) {
|
|
66
|
+
cached = ReactNativeFeatureFlagsCxxInterop.destroyFabricSurfacesInReactInstanceManager()
|
|
67
|
+
destroyFabricSurfacesInReactInstanceManagerCache = cached
|
|
68
|
+
}
|
|
69
|
+
return cached
|
|
70
|
+
}
|
|
71
|
+
|
|
43
72
|
override fun enableBackgroundExecutor(): Boolean {
|
|
44
73
|
var cached = enableBackgroundExecutorCache
|
|
45
74
|
if (cached == null) {
|
|
@@ -67,15 +96,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
|
|
67
96
|
return cached
|
|
68
97
|
}
|
|
69
98
|
|
|
70
|
-
override fun batchRenderingUpdatesInEventLoop(): Boolean {
|
|
71
|
-
var cached = batchRenderingUpdatesInEventLoopCache
|
|
72
|
-
if (cached == null) {
|
|
73
|
-
cached = ReactNativeFeatureFlagsCxxInterop.batchRenderingUpdatesInEventLoop()
|
|
74
|
-
batchRenderingUpdatesInEventLoopCache = cached
|
|
75
|
-
}
|
|
76
|
-
return cached
|
|
77
|
-
}
|
|
78
|
-
|
|
79
99
|
override fun enableSpannableBuildingUnification(): Boolean {
|
|
80
100
|
var cached = enableSpannableBuildingUnificationCache
|
|
81
101
|
if (cached == null) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<5fece1bcbbd750b82b8e4b125c57101e>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -30,14 +30,18 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
|
|
30
30
|
|
|
31
31
|
@DoNotStrip @JvmStatic public external fun commonTestFlag(): Boolean
|
|
32
32
|
|
|
33
|
+
@DoNotStrip @JvmStatic public external fun androidEnablePendingFabricTransactions(): Boolean
|
|
34
|
+
|
|
35
|
+
@DoNotStrip @JvmStatic public external fun batchRenderingUpdatesInEventLoop(): Boolean
|
|
36
|
+
|
|
37
|
+
@DoNotStrip @JvmStatic public external fun destroyFabricSurfacesInReactInstanceManager(): Boolean
|
|
38
|
+
|
|
33
39
|
@DoNotStrip @JvmStatic public external fun enableBackgroundExecutor(): Boolean
|
|
34
40
|
|
|
35
41
|
@DoNotStrip @JvmStatic public external fun useModernRuntimeScheduler(): Boolean
|
|
36
42
|
|
|
37
43
|
@DoNotStrip @JvmStatic public external fun enableMicrotasks(): Boolean
|
|
38
44
|
|
|
39
|
-
@DoNotStrip @JvmStatic public external fun batchRenderingUpdatesInEventLoop(): Boolean
|
|
40
|
-
|
|
41
45
|
@DoNotStrip @JvmStatic public external fun enableSpannableBuildingUnification(): Boolean
|
|
42
46
|
|
|
43
47
|
@DoNotStrip @JvmStatic public external fun enableCustomDrawOrderFabric(): Boolean
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<4462edcf10a85654be7c71a7438a2288>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -25,14 +25,18 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
|
|
25
25
|
|
|
26
26
|
override fun commonTestFlag(): Boolean = false
|
|
27
27
|
|
|
28
|
+
override fun androidEnablePendingFabricTransactions(): Boolean = false
|
|
29
|
+
|
|
30
|
+
override fun batchRenderingUpdatesInEventLoop(): Boolean = false
|
|
31
|
+
|
|
32
|
+
override fun destroyFabricSurfacesInReactInstanceManager(): Boolean = false
|
|
33
|
+
|
|
28
34
|
override fun enableBackgroundExecutor(): Boolean = false
|
|
29
35
|
|
|
30
36
|
override fun useModernRuntimeScheduler(): Boolean = false
|
|
31
37
|
|
|
32
38
|
override fun enableMicrotasks(): Boolean = false
|
|
33
39
|
|
|
34
|
-
override fun batchRenderingUpdatesInEventLoop(): Boolean = false
|
|
35
|
-
|
|
36
40
|
override fun enableSpannableBuildingUnification(): Boolean = false
|
|
37
41
|
|
|
38
42
|
override fun enableCustomDrawOrderFabric(): Boolean = false
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<e02f6a9473a98f27ee44ff303db9e0b7>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -25,10 +25,12 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
|
|
25
25
|
private val accessedFeatureFlags = mutableSetOf<String>()
|
|
26
26
|
|
|
27
27
|
private var commonTestFlagCache: Boolean? = null
|
|
28
|
+
private var androidEnablePendingFabricTransactionsCache: Boolean? = null
|
|
29
|
+
private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
|
|
30
|
+
private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
|
|
28
31
|
private var enableBackgroundExecutorCache: Boolean? = null
|
|
29
32
|
private var useModernRuntimeSchedulerCache: Boolean? = null
|
|
30
33
|
private var enableMicrotasksCache: Boolean? = null
|
|
31
|
-
private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
|
|
32
34
|
private var enableSpannableBuildingUnificationCache: Boolean? = null
|
|
33
35
|
private var enableCustomDrawOrderFabricCache: Boolean? = null
|
|
34
36
|
private var enableFixForClippedSubviewsCrashCache: Boolean? = null
|
|
@@ -45,6 +47,36 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
|
|
45
47
|
return cached
|
|
46
48
|
}
|
|
47
49
|
|
|
50
|
+
override fun androidEnablePendingFabricTransactions(): Boolean {
|
|
51
|
+
var cached = androidEnablePendingFabricTransactionsCache
|
|
52
|
+
if (cached == null) {
|
|
53
|
+
cached = currentProvider.androidEnablePendingFabricTransactions()
|
|
54
|
+
accessedFeatureFlags.add("androidEnablePendingFabricTransactions")
|
|
55
|
+
androidEnablePendingFabricTransactionsCache = cached
|
|
56
|
+
}
|
|
57
|
+
return cached
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
override fun batchRenderingUpdatesInEventLoop(): Boolean {
|
|
61
|
+
var cached = batchRenderingUpdatesInEventLoopCache
|
|
62
|
+
if (cached == null) {
|
|
63
|
+
cached = currentProvider.batchRenderingUpdatesInEventLoop()
|
|
64
|
+
accessedFeatureFlags.add("batchRenderingUpdatesInEventLoop")
|
|
65
|
+
batchRenderingUpdatesInEventLoopCache = cached
|
|
66
|
+
}
|
|
67
|
+
return cached
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
override fun destroyFabricSurfacesInReactInstanceManager(): Boolean {
|
|
71
|
+
var cached = destroyFabricSurfacesInReactInstanceManagerCache
|
|
72
|
+
if (cached == null) {
|
|
73
|
+
cached = currentProvider.destroyFabricSurfacesInReactInstanceManager()
|
|
74
|
+
accessedFeatureFlags.add("destroyFabricSurfacesInReactInstanceManager")
|
|
75
|
+
destroyFabricSurfacesInReactInstanceManagerCache = cached
|
|
76
|
+
}
|
|
77
|
+
return cached
|
|
78
|
+
}
|
|
79
|
+
|
|
48
80
|
override fun enableBackgroundExecutor(): Boolean {
|
|
49
81
|
var cached = enableBackgroundExecutorCache
|
|
50
82
|
if (cached == null) {
|
|
@@ -75,16 +107,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
|
|
75
107
|
return cached
|
|
76
108
|
}
|
|
77
109
|
|
|
78
|
-
override fun batchRenderingUpdatesInEventLoop(): Boolean {
|
|
79
|
-
var cached = batchRenderingUpdatesInEventLoopCache
|
|
80
|
-
if (cached == null) {
|
|
81
|
-
cached = currentProvider.batchRenderingUpdatesInEventLoop()
|
|
82
|
-
accessedFeatureFlags.add("batchRenderingUpdatesInEventLoop")
|
|
83
|
-
batchRenderingUpdatesInEventLoopCache = cached
|
|
84
|
-
}
|
|
85
|
-
return cached
|
|
86
|
-
}
|
|
87
|
-
|
|
88
110
|
override fun enableSpannableBuildingUnification(): Boolean {
|
|
89
111
|
var cached = enableSpannableBuildingUnificationCache
|
|
90
112
|
if (cached == null) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<9190129a45a19b25dd23126f05b03356>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -25,14 +25,18 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
25
25
|
public interface ReactNativeFeatureFlagsProvider {
|
|
26
26
|
@DoNotStrip public fun commonTestFlag(): Boolean
|
|
27
27
|
|
|
28
|
+
@DoNotStrip public fun androidEnablePendingFabricTransactions(): Boolean
|
|
29
|
+
|
|
30
|
+
@DoNotStrip public fun batchRenderingUpdatesInEventLoop(): Boolean
|
|
31
|
+
|
|
32
|
+
@DoNotStrip public fun destroyFabricSurfacesInReactInstanceManager(): Boolean
|
|
33
|
+
|
|
28
34
|
@DoNotStrip public fun enableBackgroundExecutor(): Boolean
|
|
29
35
|
|
|
30
36
|
@DoNotStrip public fun useModernRuntimeScheduler(): Boolean
|
|
31
37
|
|
|
32
38
|
@DoNotStrip public fun enableMicrotasks(): Boolean
|
|
33
39
|
|
|
34
|
-
@DoNotStrip public fun batchRenderingUpdatesInEventLoop(): Boolean
|
|
35
|
-
|
|
36
40
|
@DoNotStrip public fun enableSpannableBuildingUnification(): Boolean
|
|
37
41
|
|
|
38
42
|
@DoNotStrip public fun enableCustomDrawOrderFabric(): Boolean
|
|
@@ -92,25 +92,20 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) :
|
|
|
92
92
|
throw UnsupportedOperationException("Unimplemented method 'initialize'")
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
override fun getReactQueueConfiguration(): ReactQueueConfiguration
|
|
96
|
-
|
|
97
|
-
}
|
|
95
|
+
override fun getReactQueueConfiguration(): ReactQueueConfiguration =
|
|
96
|
+
reactHost.reactQueueConfiguration!!
|
|
98
97
|
|
|
99
|
-
override fun <T : JavaScriptModule> getJSModule(jsInterface: Class<T>): T
|
|
100
|
-
|
|
101
|
-
}
|
|
98
|
+
override fun <T : JavaScriptModule> getJSModule(jsInterface: Class<T>): T =
|
|
99
|
+
reactHost.currentReactContext?.getJSModule(jsInterface)!!
|
|
102
100
|
|
|
103
|
-
override fun <T : NativeModule> hasNativeModule(nativeModuleInterface: Class<T>): Boolean
|
|
104
|
-
|
|
105
|
-
}
|
|
101
|
+
override fun <T : NativeModule> hasNativeModule(nativeModuleInterface: Class<T>): Boolean =
|
|
102
|
+
reactHost.hasNativeModule(nativeModuleInterface)
|
|
106
103
|
|
|
107
|
-
override fun <T : NativeModule> getNativeModule(nativeModuleInterface: Class<T>): T?
|
|
108
|
-
|
|
109
|
-
}
|
|
104
|
+
override fun <T : NativeModule> getNativeModule(nativeModuleInterface: Class<T>): T? =
|
|
105
|
+
reactHost.getNativeModule(nativeModuleInterface)
|
|
110
106
|
|
|
111
|
-
override fun getNativeModule(moduleName: String): NativeModule?
|
|
112
|
-
|
|
113
|
-
}
|
|
107
|
+
override fun getNativeModule(moduleName: String): NativeModule? =
|
|
108
|
+
reactHost.getNativeModule(moduleName)
|
|
114
109
|
|
|
115
110
|
@Deprecated(
|
|
116
111
|
message =
|
|
@@ -119,9 +114,7 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) :
|
|
|
119
114
|
throw UnsupportedOperationException("Unimplemented method 'getJSIModule'")
|
|
120
115
|
}
|
|
121
116
|
|
|
122
|
-
override fun getNativeModules(): Collection<NativeModule>
|
|
123
|
-
throw UnsupportedOperationException("Unimplemented method 'getNativeModules'")
|
|
124
|
-
}
|
|
117
|
+
override fun getNativeModules(): Collection<NativeModule> = reactHost.getNativeModules()
|
|
125
118
|
|
|
126
119
|
override fun extendNativeModules(modules: NativeModuleRegistry) {
|
|
127
120
|
throw UnsupportedOperationException("Unimplemented method 'extendNativeModules'")
|
|
@@ -145,12 +138,12 @@ public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) :
|
|
|
145
138
|
}
|
|
146
139
|
|
|
147
140
|
@Deprecated(message = "This API is unsupported in the New Architecture.")
|
|
148
|
-
override fun getJavaScriptContextHolder(): JavaScriptContextHolder {
|
|
149
|
-
|
|
141
|
+
override fun getJavaScriptContextHolder(): JavaScriptContextHolder? {
|
|
142
|
+
return reactHost.getJavaScriptContextHolder()
|
|
150
143
|
}
|
|
151
144
|
|
|
152
|
-
override fun getRuntimeExecutor(): RuntimeExecutor {
|
|
153
|
-
|
|
145
|
+
override fun getRuntimeExecutor(): RuntimeExecutor? {
|
|
146
|
+
return reactHost.getRuntimeExecutor()
|
|
154
147
|
}
|
|
155
148
|
|
|
156
149
|
override fun getRuntimeScheduler(): RuntimeScheduler {
|
|
@@ -592,6 +592,16 @@ public class ReactHostImpl implements ReactHost {
|
|
|
592
592
|
return null;
|
|
593
593
|
}
|
|
594
594
|
|
|
595
|
+
/* package */
|
|
596
|
+
@Nullable
|
|
597
|
+
NativeModule getNativeModule(String nativeModuleName) {
|
|
598
|
+
final ReactInstance reactInstance = mReactInstanceTaskRef.get().getResult();
|
|
599
|
+
if (reactInstance != null) {
|
|
600
|
+
return reactInstance.getNativeModule(nativeModuleName);
|
|
601
|
+
}
|
|
602
|
+
return null;
|
|
603
|
+
}
|
|
604
|
+
|
|
595
605
|
/* package */
|
|
596
606
|
@Nullable
|
|
597
607
|
RuntimeExecutor getRuntimeExecutor() {
|
|
@@ -90,8 +90,6 @@ public class ReactModalHostView extends ViewGroup implements LifecycleEventListe
|
|
|
90
90
|
private boolean mPropertyRequiresNewDialog;
|
|
91
91
|
private @Nullable DialogInterface.OnShowListener mOnShowListener;
|
|
92
92
|
private @Nullable OnRequestCloseListener mOnRequestCloseListener;
|
|
93
|
-
private final ReactAndroidHWInputDeviceHelper mAndroidHWInputDeviceHelper =
|
|
94
|
-
new ReactAndroidHWInputDeviceHelper();
|
|
95
93
|
|
|
96
94
|
public ReactModalHostView(ThemedReactContext context) {
|
|
97
95
|
super(context);
|
|
@@ -305,7 +303,7 @@ public class ReactModalHostView extends ViewGroup implements LifecycleEventListe
|
|
|
305
303
|
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
|
|
306
304
|
// Modal needs to send the key event to its own TV event handler
|
|
307
305
|
// https://github.com/react-native-tvos/react-native-tvos/issues/609
|
|
308
|
-
mAndroidHWInputDeviceHelper.handleKeyEvent(event, mHostView.mReactContext);
|
|
306
|
+
mHostView.mAndroidHWInputDeviceHelper.handleKeyEvent(event, mHostView.mReactContext);
|
|
309
307
|
if (event.getAction() == KeyEvent.ACTION_UP) {
|
|
310
308
|
// We need to stop the BACK button and ESCAPE key from closing the dialog by default
|
|
311
309
|
// so we capture that event and instead inform JS so that it can make the decision as
|