react-native-tvos 0.79.1-1 → 0.79.3-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/RCTReactNativeFactory.mm +8 -0
- package/Libraries/Blob/URL.js +13 -1
- package/Libraries/Core/ReactNativeVersion.js +2 -2
- package/README.md +3 -1
- package/React/Base/RCTRootView.h +7 -1
- package/React/Base/RCTRootView.m +38 -0
- package/React/Base/RCTRootViewInternal.h +1 -0
- package/React/Base/RCTTVRemoteSelectHandler.m +2 -1
- package/React/Base/RCTVersion.m +2 -2
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.h +6 -0
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +37 -0
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI-generated.cpp +12 -0
- package/React/FBReactNativeSpec/FBReactNativeSpecJSI.h +18 -0
- package/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm +18 -4
- package/React/Fabric/Mounting/ComponentViews/Switch/RCTSwitchComponentView.mm +1 -1
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +3 -5
- package/React/Views/RCTTVView.m +4 -4
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +13 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +21 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +23 -1
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsOverrides_RNOSS_Stable_Android.kt +4 -0
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +5 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/style/BorderRadiusStyle.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +0 -3
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +29 -1
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +7 -1
- package/ReactCommon/cxxreact/ReactNativeVersion.h +2 -2
- package/ReactCommon/jsc/React-jsc.podspec +1 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +9 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +11 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +45 -9
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +6 -2
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +9 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +19 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +3 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +11 -1
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +5 -1
- package/ReactCommon/react/renderer/core/ShadowNode.cpp +14 -4
- package/ReactCommon/react/renderer/core/ShadowNode.h +6 -0
- package/ReactCommon/react/renderer/mounting/updateMountedFlag.cpp +6 -0
- package/ReactCommon/react/runtime/TimerManager.cpp +6 -4
- package/ReactCommon/react/runtime/TimerManager.h +3 -1
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +0 -1
- package/ReactCommon/react/runtime/tests/cxx/ReactInstanceTest.cpp +9 -5
- package/package.json +8 -8
- package/scripts/codegen/generate-artifacts-executor.js +53 -18
- 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/ReactNativeFeatureFlags.js +11 -1
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +3 -1
- package/types/index.d.ts +1 -1
- package/types/tsconfig.test.json +16 -0
|
@@ -314,6 +314,14 @@ class RCTAppDelegateBridgelessFeatureFlags : public ReactNativeFeatureFlagsDefau
|
|
|
314
314
|
{
|
|
315
315
|
return true;
|
|
316
316
|
}
|
|
317
|
+
bool updateRuntimeShadowNodeReferencesOnCommit() override
|
|
318
|
+
{
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
bool useShadowNodeStateOnClone() override
|
|
322
|
+
{
|
|
323
|
+
return true;
|
|
324
|
+
}
|
|
317
325
|
};
|
|
318
326
|
|
|
319
327
|
- (void)_setUpFeatureFlags
|
package/Libraries/Blob/URL.js
CHANGED
|
@@ -81,7 +81,19 @@ export class URL {
|
|
|
81
81
|
let baseUrl = null;
|
|
82
82
|
if (!base || validateBaseUrl(url)) {
|
|
83
83
|
this._url = url;
|
|
84
|
-
if (
|
|
84
|
+
if (this._url.includes('#')) {
|
|
85
|
+
const split = this._url.split('#');
|
|
86
|
+
const beforeHash = split[0];
|
|
87
|
+
const website = beforeHash.split('://')[1];
|
|
88
|
+
if (!website.includes('/')) {
|
|
89
|
+
this._url = split.join('/#');
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (
|
|
94
|
+
!this._url.endsWith('/') &&
|
|
95
|
+
!(this._url.includes('?') || this._url.includes('#'))
|
|
96
|
+
) {
|
|
85
97
|
this._url += '/';
|
|
86
98
|
}
|
|
87
99
|
} else {
|
package/README.md
CHANGED
|
@@ -262,7 +262,9 @@ class Game2048 extends React.Component {
|
|
|
262
262
|
|
|
263
263
|
- _LogBox_: The LogBox error/warning display (which replaced YellowBox in 0.63) is working as expected on TV platforms, after a few adjustments to make the controls accessible to the focus engine.
|
|
264
264
|
|
|
265
|
-
- _Dev Menu support_:
|
|
265
|
+
- _Dev Menu support_:
|
|
266
|
+
- The developer menu provided by React Native itself works on TV. On the Apple TV simulator, cmd-D will bring up the developer menu, just like on iOS. To bring it up on a real Apple TV device, make a long press on the play/pause button on the remote. (Please do not shake the Apple TV device, that will not work :) ). Android TV dev menu behavior is the same as on Android phone.
|
|
267
|
+
- The Expo dev menu (provided by the [Expo dev client package](https://docs.expo.dev/versions/latest/sdk/dev-client/)) is *not* supported on TV.
|
|
266
268
|
|
|
267
269
|
- _TV remote animations on Apple TV_: `RCTTVView` native code implements Apple-recommended parallax animations to help guide the eye as the user navigates through views. The animations can be disabled or adjusted with new optional view properties.
|
|
268
270
|
|
package/React/Base/RCTRootView.h
CHANGED
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
extern NSString * _Nonnull const RCTTVEnableMenuKeyNotification;
|
|
15
15
|
extern NSString * _Nonnull const RCTTVDisableMenuKeyNotification;
|
|
16
16
|
|
|
17
|
+
#if TARGET_OS_TV
|
|
18
|
+
#import "RCTTVRemoteSelectHandler.h"
|
|
19
|
+
#endif
|
|
17
20
|
|
|
18
21
|
@protocol RCTRootViewDelegate;
|
|
19
22
|
|
|
@@ -51,8 +54,11 @@ extern
|
|
|
51
54
|
* like any ordinary UIView. You can have multiple RCTRootViews on screen at
|
|
52
55
|
* once, all controlled by the same JavaScript application.
|
|
53
56
|
*/
|
|
57
|
+
#if TARGET_OS_TV
|
|
58
|
+
@interface RCTRootView : UIView <RCTTVRemoteSelectHandlerDelegate>
|
|
59
|
+
#else
|
|
54
60
|
@interface RCTRootView : UIView
|
|
55
|
-
|
|
61
|
+
#endif
|
|
56
62
|
/**
|
|
57
63
|
* - Designated initializer -
|
|
58
64
|
*/
|
package/React/Base/RCTRootView.m
CHANGED
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
#if TARGET_OS_TV
|
|
32
32
|
#import "RCTTVNavigationEventEmitter.h"
|
|
33
33
|
#import "RCTTVRemoteHandler.h"
|
|
34
|
+
#import "RCTTVRemoteSelectHandler.h"
|
|
35
|
+
#import <React/RCTTVNavigationEventNotification.h>
|
|
34
36
|
#endif
|
|
35
37
|
|
|
36
38
|
#if RCT_DEV
|
|
@@ -98,6 +100,7 @@ NSString *const RCTContentDidAppearNotification = @"RCTContentDidAppearNotificat
|
|
|
98
100
|
#endif
|
|
99
101
|
|
|
100
102
|
self.tvRemoteHandler = [[RCTTVRemoteHandler alloc] initWithView:self];
|
|
103
|
+
self.tvRemoteSelectHandler = [[RCTTVRemoteSelectHandler alloc] initWithView:self];
|
|
101
104
|
#endif
|
|
102
105
|
|
|
103
106
|
[self showLoadingView];
|
|
@@ -424,10 +427,45 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
|
|
424
427
|
{
|
|
425
428
|
#if TARGET_OS_TV
|
|
426
429
|
self.tvRemoteHandler = nil;
|
|
430
|
+
self.tvRemoteSelectHandler = nil;
|
|
427
431
|
#endif
|
|
428
432
|
[_contentView invalidate];
|
|
429
433
|
}
|
|
430
434
|
|
|
435
|
+
#if TARGET_OS_TV
|
|
436
|
+
|
|
437
|
+
#pragma mark -
|
|
438
|
+
#pragma mark RCTTVRemoteSelectHandlerDelegate methods
|
|
439
|
+
|
|
440
|
+
- (void)animatePressIn {
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
- (void)animatePressOut {
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
- (void)emitPressInEvent {
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
- (void)emitPressOutEvent {
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
- (void)sendSelectNotification
|
|
453
|
+
{
|
|
454
|
+
[[NSNotificationCenter defaultCenter] postNavigationPressEventWithType:RCTTVRemoteEventSelect keyAction:RCTTVRemoteEventKeyActionUp tag:self.reactTag target:self.reactTag];
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
- (void)sendLongSelectBeganNotification
|
|
458
|
+
{
|
|
459
|
+
[[NSNotificationCenter defaultCenter] postNavigationPressEventWithType:RCTTVRemoteEventLongSelect keyAction:RCTTVRemoteEventKeyActionDown tag:self.reactTag target:self.reactTag];
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
- (void)sendLongSelectEndedNotification
|
|
463
|
+
{
|
|
464
|
+
[[NSNotificationCenter defaultCenter] postNavigationPressEventWithType:RCTTVRemoteEventLongSelect keyAction:RCTTVRemoteEventKeyActionUp tag:self.reactTag target:self.reactTag];
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
#endif
|
|
468
|
+
|
|
431
469
|
@end
|
|
432
470
|
|
|
433
471
|
@implementation RCTRootView (Deprecated)
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
*/
|
|
27
27
|
#if TARGET_OS_TV
|
|
28
28
|
@property (nonatomic, strong, nullable) RCTTVRemoteHandler *tvRemoteHandler;
|
|
29
|
+
@property (nonatomic, strong, nullable) RCTTVRemoteSelectHandler *tvRemoteSelectHandler;
|
|
29
30
|
@property (nonatomic, weak) UIView *reactPreferredFocusedView;
|
|
30
31
|
@property (nonatomic, copy, nullable) NSArray<id<UIFocusEnvironment>> *reactPreferredFocusEnvironments;
|
|
31
32
|
#endif
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
// Press recognizer should allow long press recognizer to work (but not the reverse)
|
|
38
38
|
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
|
|
39
|
-
return gestureRecognizer ==
|
|
39
|
+
return gestureRecognizer == self.pressRecognizer && otherGestureRecognizer == self.longPressRecognizer;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
#pragma mark -
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
UILongPressGestureRecognizer *longPressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
|
|
55
55
|
longPressRecognizer.allowedPressTypes = @[ @(UIPressTypeSelect) ];
|
|
56
56
|
longPressRecognizer.minimumPressDuration = 0.5;
|
|
57
|
+
longPressRecognizer.delegate = self;
|
|
57
58
|
|
|
58
59
|
[self.view addGestureRecognizer:longPressRecognizer];
|
|
59
60
|
self.longPressRecognizer = longPressRecognizer;
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -23,8 +23,8 @@ NSDictionary* RCTGetReactNativeVersion(void)
|
|
|
23
23
|
__rnVersion = @{
|
|
24
24
|
RCTVersionMajor: @(0),
|
|
25
25
|
RCTVersionMinor: @(79),
|
|
26
|
-
RCTVersionPatch: @(
|
|
27
|
-
RCTVersionPrerelease: @"
|
|
26
|
+
RCTVersionPatch: @(3),
|
|
27
|
+
RCTVersionPrerelease: @"0",
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
30
|
return __rnVersion;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
#if TARGET_OS_TV
|
|
16
16
|
#import <React/RCTTVRemoteHandler.h>
|
|
17
|
+
#import <React/RCTTVRemoteSelectHandler.h>
|
|
17
18
|
#endif
|
|
18
19
|
|
|
19
20
|
NS_ASSUME_NONNULL_BEGIN
|
|
@@ -25,7 +26,11 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
25
26
|
*
|
|
26
27
|
* WARNING: In the future, RCTRootView will be deprecated in favor of RCTSurfaceHostingView.
|
|
27
28
|
*/
|
|
29
|
+
#if TARGET_OS_TV
|
|
30
|
+
@interface RCTSurfaceHostingProxyRootView : RCTSurfaceHostingView <RCTTVRemoteSelectHandlerDelegate>
|
|
31
|
+
#else
|
|
28
32
|
@interface RCTSurfaceHostingProxyRootView : RCTSurfaceHostingView
|
|
33
|
+
#endif
|
|
29
34
|
|
|
30
35
|
#pragma mark RCTRootView compatibility - keep these sync'ed with RCTRootView.h
|
|
31
36
|
|
|
@@ -44,6 +49,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
44
49
|
@property (nonatomic, assign) CGSize minimumSize;
|
|
45
50
|
#if TARGET_OS_TV
|
|
46
51
|
@property (nonatomic, strong, nullable) RCTTVRemoteHandler *tvRemoteHandler;
|
|
52
|
+
@property (nonatomic, strong, nullable) RCTTVRemoteSelectHandler *tvRemoteSelectHandler;
|
|
47
53
|
@property (nonatomic, weak, nullable) UIView *reactPreferredFocusedView;
|
|
48
54
|
@property (nonatomic, copy, nullable) NSArray<id<UIFocusEnvironment>> *reactPreferredFocusEnvironments;
|
|
49
55
|
#endif
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
#import "RCTSurface.h"
|
|
21
21
|
#import "UIView+React.h"
|
|
22
22
|
|
|
23
|
+
#if TARGET_OS_TV
|
|
24
|
+
#import <React/RCTTVNavigationEventNotification.h>
|
|
25
|
+
#endif
|
|
26
|
+
|
|
23
27
|
static RCTSurfaceSizeMeasureMode convertToSurfaceSizeMeasureMode(RCTRootViewSizeFlexibility sizeFlexibility)
|
|
24
28
|
{
|
|
25
29
|
switch (sizeFlexibility) {
|
|
@@ -61,9 +65,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
|
61
65
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
|
62
66
|
|
|
63
67
|
#if TARGET_OS_TV
|
|
68
|
+
|
|
64
69
|
- (void)dealloc
|
|
65
70
|
{
|
|
66
71
|
self.tvRemoteHandler = nil;
|
|
72
|
+
self.tvRemoteSelectHandler = nil;
|
|
67
73
|
}
|
|
68
74
|
|
|
69
75
|
- (NSArray<id<UIFocusEnvironment>> *)preferredFocusEnvironments {
|
|
@@ -78,6 +84,36 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
|
|
78
84
|
}
|
|
79
85
|
return [super preferredFocusEnvironments];
|
|
80
86
|
}
|
|
87
|
+
|
|
88
|
+
#pragma mark -
|
|
89
|
+
#pragma mark RCTTVRemoteSelectHandlerDelegate methods
|
|
90
|
+
|
|
91
|
+
- (void)animatePressIn {
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
- (void)animatePressOut {
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
- (void)emitPressInEvent {
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
- (void)emitPressOutEvent {
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
- (void)sendSelectNotification
|
|
104
|
+
{
|
|
105
|
+
[[NSNotificationCenter defaultCenter] postNavigationPressEventWithType:RCTTVRemoteEventSelect keyAction:RCTTVRemoteEventKeyActionUp tag:self.reactTag target:self.reactTag];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
- (void)sendLongSelectBeganNotification
|
|
109
|
+
{
|
|
110
|
+
[[NSNotificationCenter defaultCenter] postNavigationPressEventWithType:RCTTVRemoteEventLongSelect keyAction:RCTTVRemoteEventKeyActionDown tag:self.reactTag target:self.reactTag];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
- (void)sendLongSelectEndedNotification
|
|
114
|
+
{
|
|
115
|
+
[[NSNotificationCenter defaultCenter] postNavigationPressEventWithType:RCTTVRemoteEventLongSelect keyAction:RCTTVRemoteEventKeyActionUp tag:self.reactTag target:self.reactTag];
|
|
116
|
+
}
|
|
81
117
|
#endif
|
|
82
118
|
|
|
83
119
|
|
|
@@ -145,6 +181,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder)
|
|
|
145
181
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
146
182
|
#if TARGET_OS_TV
|
|
147
183
|
self.tvRemoteHandler = [[RCTTVRemoteHandler alloc] initWithView:[self contentView]];
|
|
184
|
+
self.tvRemoteSelectHandler = [[RCTTVRemoteSelectHandler alloc] initWithView:self];
|
|
148
185
|
#endif
|
|
149
186
|
});
|
|
150
187
|
}
|
|
@@ -191,6 +191,11 @@ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_traceTu
|
|
|
191
191
|
rt
|
|
192
192
|
);
|
|
193
193
|
}
|
|
194
|
+
static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
195
|
+
return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->updateRuntimeShadowNodeReferencesOnCommit(
|
|
196
|
+
rt
|
|
197
|
+
);
|
|
198
|
+
}
|
|
194
199
|
static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
195
200
|
return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->useAlwaysAvailableJSErrorHandling(
|
|
196
201
|
rt
|
|
@@ -221,6 +226,11 @@ static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useRawP
|
|
|
221
226
|
rt
|
|
222
227
|
);
|
|
223
228
|
}
|
|
229
|
+
static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useShadowNodeStateOnClone(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
230
|
+
return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->useShadowNodeStateOnClone(
|
|
231
|
+
rt
|
|
232
|
+
);
|
|
233
|
+
}
|
|
224
234
|
static jsi::Value __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModuleInterop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
225
235
|
return static_cast<NativeReactNativeFeatureFlagsCxxSpecJSI *>(&turboModule)->useTurboModuleInterop(
|
|
226
236
|
rt
|
|
@@ -270,12 +280,14 @@ NativeReactNativeFeatureFlagsCxxSpecJSI::NativeReactNativeFeatureFlagsCxxSpecJSI
|
|
|
270
280
|
methodMap_["removeTurboModuleManagerDelegateMutex"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_removeTurboModuleManagerDelegateMutex};
|
|
271
281
|
methodMap_["throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS};
|
|
272
282
|
methodMap_["traceTurboModulePromiseRejectionsOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_traceTurboModulePromiseRejectionsOnAndroid};
|
|
283
|
+
methodMap_["updateRuntimeShadowNodeReferencesOnCommit"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_updateRuntimeShadowNodeReferencesOnCommit};
|
|
273
284
|
methodMap_["useAlwaysAvailableJSErrorHandling"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useAlwaysAvailableJSErrorHandling};
|
|
274
285
|
methodMap_["useEditTextStockAndroidFocusBehavior"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useEditTextStockAndroidFocusBehavior};
|
|
275
286
|
methodMap_["useFabricInterop"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useFabricInterop};
|
|
276
287
|
methodMap_["useNativeViewConfigsInBridgelessMode"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useNativeViewConfigsInBridgelessMode};
|
|
277
288
|
methodMap_["useOptimizedEventBatchingOnAndroid"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useOptimizedEventBatchingOnAndroid};
|
|
278
289
|
methodMap_["useRawPropsJsiValue"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useRawPropsJsiValue};
|
|
290
|
+
methodMap_["useShadowNodeStateOnClone"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useShadowNodeStateOnClone};
|
|
279
291
|
methodMap_["useTurboModuleInterop"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModuleInterop};
|
|
280
292
|
methodMap_["useTurboModules"] = MethodMetadata {0, __hostFunction_NativeReactNativeFeatureFlagsCxxSpecJSI_useTurboModules};
|
|
281
293
|
}
|
|
@@ -56,12 +56,14 @@ public:
|
|
|
56
56
|
virtual bool removeTurboModuleManagerDelegateMutex(jsi::Runtime &rt) = 0;
|
|
57
57
|
virtual bool throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOS(jsi::Runtime &rt) = 0;
|
|
58
58
|
virtual bool traceTurboModulePromiseRejectionsOnAndroid(jsi::Runtime &rt) = 0;
|
|
59
|
+
virtual bool updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt) = 0;
|
|
59
60
|
virtual bool useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt) = 0;
|
|
60
61
|
virtual bool useEditTextStockAndroidFocusBehavior(jsi::Runtime &rt) = 0;
|
|
61
62
|
virtual bool useFabricInterop(jsi::Runtime &rt) = 0;
|
|
62
63
|
virtual bool useNativeViewConfigsInBridgelessMode(jsi::Runtime &rt) = 0;
|
|
63
64
|
virtual bool useOptimizedEventBatchingOnAndroid(jsi::Runtime &rt) = 0;
|
|
64
65
|
virtual bool useRawPropsJsiValue(jsi::Runtime &rt) = 0;
|
|
66
|
+
virtual bool useShadowNodeStateOnClone(jsi::Runtime &rt) = 0;
|
|
65
67
|
virtual bool useTurboModuleInterop(jsi::Runtime &rt) = 0;
|
|
66
68
|
virtual bool useTurboModules(jsi::Runtime &rt) = 0;
|
|
67
69
|
|
|
@@ -382,6 +384,14 @@ private:
|
|
|
382
384
|
return bridging::callFromJs<bool>(
|
|
383
385
|
rt, &T::traceTurboModulePromiseRejectionsOnAndroid, jsInvoker_, instance_);
|
|
384
386
|
}
|
|
387
|
+
bool updateRuntimeShadowNodeReferencesOnCommit(jsi::Runtime &rt) override {
|
|
388
|
+
static_assert(
|
|
389
|
+
bridging::getParameterCount(&T::updateRuntimeShadowNodeReferencesOnCommit) == 1,
|
|
390
|
+
"Expected updateRuntimeShadowNodeReferencesOnCommit(...) to have 1 parameters");
|
|
391
|
+
|
|
392
|
+
return bridging::callFromJs<bool>(
|
|
393
|
+
rt, &T::updateRuntimeShadowNodeReferencesOnCommit, jsInvoker_, instance_);
|
|
394
|
+
}
|
|
385
395
|
bool useAlwaysAvailableJSErrorHandling(jsi::Runtime &rt) override {
|
|
386
396
|
static_assert(
|
|
387
397
|
bridging::getParameterCount(&T::useAlwaysAvailableJSErrorHandling) == 1,
|
|
@@ -430,6 +440,14 @@ private:
|
|
|
430
440
|
return bridging::callFromJs<bool>(
|
|
431
441
|
rt, &T::useRawPropsJsiValue, jsInvoker_, instance_);
|
|
432
442
|
}
|
|
443
|
+
bool useShadowNodeStateOnClone(jsi::Runtime &rt) override {
|
|
444
|
+
static_assert(
|
|
445
|
+
bridging::getParameterCount(&T::useShadowNodeStateOnClone) == 1,
|
|
446
|
+
"Expected useShadowNodeStateOnClone(...) to have 1 parameters");
|
|
447
|
+
|
|
448
|
+
return bridging::callFromJs<bool>(
|
|
449
|
+
rt, &T::useShadowNodeStateOnClone, jsInvoker_, instance_);
|
|
450
|
+
}
|
|
433
451
|
bool useTurboModuleInterop(jsi::Runtime &rt) override {
|
|
434
452
|
static_assert(
|
|
435
453
|
bridging::getParameterCount(&T::useTurboModuleInterop) == 1,
|
|
@@ -170,10 +170,24 @@ static NSString *const kRCTLegacyInteropChildIndexKey = @"index";
|
|
|
170
170
|
|
|
171
171
|
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
172
172
|
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
173
|
+
if (_adapter && index == _adapter.paperView.reactSubviews.count) {
|
|
174
|
+
// This is a new child view that is being added to the end of the children array.
|
|
175
|
+
// After the children is added, we need to call didUpdateReactSubviews to make sure that it is rendered.
|
|
176
|
+
// Without this change, the new child will not be rendered right away because the didUpdateReactSubviews is not
|
|
177
|
+
// called and the `finalizeUpdate` is not invoked.
|
|
178
|
+
if ([childComponentView isKindOfClass:[RCTLegacyViewManagerInteropComponentView class]]) {
|
|
179
|
+
UIView *target = ((RCTLegacyViewManagerInteropComponentView *)childComponentView).contentView;
|
|
180
|
+
[_adapter.paperView insertReactSubview:target atIndex:index];
|
|
181
|
+
} else {
|
|
182
|
+
[_adapter.paperView insertReactSubview:childComponentView atIndex:index];
|
|
183
|
+
}
|
|
184
|
+
[_adapter.paperView didUpdateReactSubviews];
|
|
185
|
+
} else {
|
|
186
|
+
[_viewsToBeMounted addObject:@{
|
|
187
|
+
kRCTLegacyInteropChildIndexKey : [NSNumber numberWithInteger:index],
|
|
188
|
+
kRCTLegacyInteropChildComponentKey : childComponentView
|
|
189
|
+
}];
|
|
190
|
+
}
|
|
177
191
|
}
|
|
178
192
|
|
|
179
193
|
- (void)unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
@@ -68,7 +68,7 @@ using namespace facebook::react;
|
|
|
68
68
|
const auto &newSwitchProps = static_cast<const SwitchProps &>(*props);
|
|
69
69
|
|
|
70
70
|
// `value`
|
|
71
|
-
if (oldSwitchProps.value != newSwitchProps.value) {
|
|
71
|
+
if (!_isInitialValueSet || oldSwitchProps.value != newSwitchProps.value) {
|
|
72
72
|
BOOL shouldAnimate = _isInitialValueSet == YES;
|
|
73
73
|
[_switchView setOn:newSwitchProps.value animated:shouldAnimate];
|
|
74
74
|
}
|
|
@@ -587,23 +587,21 @@ const CGFloat BACKGROUND_COLOR_ZPOSITION = -1024.0f;
|
|
|
587
587
|
}
|
|
588
588
|
|
|
589
589
|
if (context.nextFocusedView == self) {
|
|
590
|
-
if(_eventEmitter) _eventEmitter->onFocus();
|
|
591
|
-
|
|
592
590
|
[self becomeFirstResponder];
|
|
593
591
|
[self enableDirectionalFocusGuides];
|
|
594
592
|
[coordinator addCoordinatedAnimations:^(void){
|
|
595
|
-
|
|
593
|
+
if (self->_eventEmitter) self->_eventEmitter->onFocus();
|
|
596
594
|
[self sendFocusNotification:context];
|
|
595
|
+
[self addParallaxMotionEffects];
|
|
597
596
|
} completion:^(void){}];
|
|
598
597
|
// Without this check, onBlur would also trigger when `TVFocusGuideView` transfers focus to its children.
|
|
599
598
|
// [self isTVFocusGuide] is false when autofocus and destinations are not used, so we cannot use that.
|
|
600
599
|
// Generally speaking, it would happen for any non-collapsable `View`.
|
|
601
600
|
} else if (context.previouslyFocusedView == self) {
|
|
602
|
-
if (_eventEmitter) _eventEmitter->onBlur();
|
|
603
|
-
|
|
604
601
|
[self disableDirectionalFocusGuides];
|
|
605
602
|
[coordinator addCoordinatedAnimations:^(void){
|
|
606
603
|
[self removeParallaxMotionEffects];
|
|
604
|
+
if (self->_eventEmitter) self->_eventEmitter->onBlur();
|
|
607
605
|
[self sendBlurNotification:context];
|
|
608
606
|
} completion:^(void){}];
|
|
609
607
|
[self resignFirstResponder];
|
package/React/Views/RCTTVView.m
CHANGED
|
@@ -304,22 +304,22 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
if (context.nextFocusedView == self) {
|
|
307
|
-
if (self.onFocus) self.onFocus(nil);
|
|
308
307
|
[self becomeFirstResponder];
|
|
309
308
|
[self enableDirectionalFocusGuides];
|
|
310
309
|
[coordinator addCoordinatedAnimations:^(void){
|
|
311
|
-
|
|
310
|
+
if (self.onFocus) self.onFocus(nil);
|
|
312
311
|
[self sendFocusNotification:context];
|
|
312
|
+
[self addParallaxMotionEffects];
|
|
313
313
|
} completion:^(void){}];
|
|
314
314
|
// Without this check, onBlur would also trigger when `TVFocusGuideView` transfers focus to its children.
|
|
315
315
|
// [self isTVFocusGuide] is false when autofocus and destinations are not used, so we cannot use that.
|
|
316
316
|
// Generally speaking, it would happen for any non-collapsable `View`.
|
|
317
317
|
} else if (context.previouslyFocusedView == self ) {
|
|
318
|
-
if (self.onBlur) self.onBlur(nil);
|
|
319
318
|
[self disableDirectionalFocusGuides];
|
|
320
319
|
[coordinator addCoordinatedAnimations:^(void){
|
|
321
|
-
[self sendBlurNotification:context];
|
|
322
320
|
[self removeParallaxMotionEffects];
|
|
321
|
+
if (self.onBlur) self.onBlur(nil);
|
|
322
|
+
[self sendBlurNotification:context];
|
|
323
323
|
} completion:^(void){}];
|
|
324
324
|
[self resignFirstResponder];
|
|
325
325
|
}
|
|
@@ -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<<b263bdcbc1258f7d5c56e69732ba9076>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -238,6 +238,12 @@ public object ReactNativeFeatureFlags {
|
|
|
238
238
|
@JvmStatic
|
|
239
239
|
public fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = accessor.traceTurboModulePromiseRejectionsOnAndroid()
|
|
240
240
|
|
|
241
|
+
/**
|
|
242
|
+
* When enabled, runtime shadow node references will be updated during the commit. This allows running RSNRU from any thread without corrupting the renderer state.
|
|
243
|
+
*/
|
|
244
|
+
@JvmStatic
|
|
245
|
+
public fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = accessor.updateRuntimeShadowNodeReferencesOnCommit()
|
|
246
|
+
|
|
241
247
|
/**
|
|
242
248
|
* In Bridgeless mode, use the always available javascript error reporting pipeline.
|
|
243
249
|
*/
|
|
@@ -274,6 +280,12 @@ public object ReactNativeFeatureFlags {
|
|
|
274
280
|
@JvmStatic
|
|
275
281
|
public fun useRawPropsJsiValue(): Boolean = accessor.useRawPropsJsiValue()
|
|
276
282
|
|
|
283
|
+
/**
|
|
284
|
+
* Use the state stored on the source shadow node when cloning it instead of reading in the most recent state on the shadow node family.
|
|
285
|
+
*/
|
|
286
|
+
@JvmStatic
|
|
287
|
+
public fun useShadowNodeStateOnClone(): Boolean = accessor.useShadowNodeStateOnClone()
|
|
288
|
+
|
|
277
289
|
/**
|
|
278
290
|
* In Bridgeless mode, should legacy NativeModules use the TurboModule system?
|
|
279
291
|
*/
|
|
@@ -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<<0496ecf3d1e5d8a2e6d4d594aca806d0>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -55,12 +55,14 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
|
|
55
55
|
private var removeTurboModuleManagerDelegateMutexCache: Boolean? = null
|
|
56
56
|
private var throwExceptionInsteadOfDeadlockOnTurboModuleSetupDuringSyncRenderIOSCache: Boolean? = null
|
|
57
57
|
private var traceTurboModulePromiseRejectionsOnAndroidCache: Boolean? = null
|
|
58
|
+
private var updateRuntimeShadowNodeReferencesOnCommitCache: Boolean? = null
|
|
58
59
|
private var useAlwaysAvailableJSErrorHandlingCache: Boolean? = null
|
|
59
60
|
private var useEditTextStockAndroidFocusBehaviorCache: Boolean? = null
|
|
60
61
|
private var useFabricInteropCache: Boolean? = null
|
|
61
62
|
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
|
|
62
63
|
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
|
|
63
64
|
private var useRawPropsJsiValueCache: Boolean? = null
|
|
65
|
+
private var useShadowNodeStateOnCloneCache: Boolean? = null
|
|
64
66
|
private var useTurboModuleInteropCache: Boolean? = null
|
|
65
67
|
private var useTurboModulesCache: Boolean? = null
|
|
66
68
|
|
|
@@ -379,6 +381,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
|
|
379
381
|
return cached
|
|
380
382
|
}
|
|
381
383
|
|
|
384
|
+
override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean {
|
|
385
|
+
var cached = updateRuntimeShadowNodeReferencesOnCommitCache
|
|
386
|
+
if (cached == null) {
|
|
387
|
+
cached = ReactNativeFeatureFlagsCxxInterop.updateRuntimeShadowNodeReferencesOnCommit()
|
|
388
|
+
updateRuntimeShadowNodeReferencesOnCommitCache = cached
|
|
389
|
+
}
|
|
390
|
+
return cached
|
|
391
|
+
}
|
|
392
|
+
|
|
382
393
|
override fun useAlwaysAvailableJSErrorHandling(): Boolean {
|
|
383
394
|
var cached = useAlwaysAvailableJSErrorHandlingCache
|
|
384
395
|
if (cached == null) {
|
|
@@ -433,6 +444,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
|
|
|
433
444
|
return cached
|
|
434
445
|
}
|
|
435
446
|
|
|
447
|
+
override fun useShadowNodeStateOnClone(): Boolean {
|
|
448
|
+
var cached = useShadowNodeStateOnCloneCache
|
|
449
|
+
if (cached == null) {
|
|
450
|
+
cached = ReactNativeFeatureFlagsCxxInterop.useShadowNodeStateOnClone()
|
|
451
|
+
useShadowNodeStateOnCloneCache = cached
|
|
452
|
+
}
|
|
453
|
+
return cached
|
|
454
|
+
}
|
|
455
|
+
|
|
436
456
|
override fun useTurboModuleInterop(): Boolean {
|
|
437
457
|
var cached = useTurboModuleInteropCache
|
|
438
458
|
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<<c4f3b0cee8b9b4b9cebb589801e1dd15>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -98,6 +98,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
|
|
98
98
|
|
|
99
99
|
@DoNotStrip @JvmStatic public external fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean
|
|
100
100
|
|
|
101
|
+
@DoNotStrip @JvmStatic public external fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean
|
|
102
|
+
|
|
101
103
|
@DoNotStrip @JvmStatic public external fun useAlwaysAvailableJSErrorHandling(): Boolean
|
|
102
104
|
|
|
103
105
|
@DoNotStrip @JvmStatic public external fun useEditTextStockAndroidFocusBehavior(): Boolean
|
|
@@ -110,6 +112,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
|
|
110
112
|
|
|
111
113
|
@DoNotStrip @JvmStatic public external fun useRawPropsJsiValue(): Boolean
|
|
112
114
|
|
|
115
|
+
@DoNotStrip @JvmStatic public external fun useShadowNodeStateOnClone(): Boolean
|
|
116
|
+
|
|
113
117
|
@DoNotStrip @JvmStatic public external fun useTurboModuleInterop(): Boolean
|
|
114
118
|
|
|
115
119
|
@DoNotStrip @JvmStatic public external fun useTurboModules(): 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<<a8900217ae0385947b619c8fa0834942>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -93,6 +93,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
|
|
93
93
|
|
|
94
94
|
override fun traceTurboModulePromiseRejectionsOnAndroid(): Boolean = false
|
|
95
95
|
|
|
96
|
+
override fun updateRuntimeShadowNodeReferencesOnCommit(): Boolean = false
|
|
97
|
+
|
|
96
98
|
override fun useAlwaysAvailableJSErrorHandling(): Boolean = false
|
|
97
99
|
|
|
98
100
|
override fun useEditTextStockAndroidFocusBehavior(): Boolean = true
|
|
@@ -105,6 +107,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
|
|
105
107
|
|
|
106
108
|
override fun useRawPropsJsiValue(): Boolean = false
|
|
107
109
|
|
|
110
|
+
override fun useShadowNodeStateOnClone(): Boolean = false
|
|
111
|
+
|
|
108
112
|
override fun useTurboModuleInterop(): Boolean = false
|
|
109
113
|
|
|
110
114
|
override fun useTurboModules(): Boolean = false
|