react-native-tvos 0.76.0-0rc3 → 0.76.0-0rc5
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 -14
- package/Libraries/AppDelegate/RCTRootViewFactory.h +5 -23
- package/Libraries/AppDelegate/RCTRootViewFactory.mm +19 -25
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/setUpDeveloperTools.js +5 -1
- package/Libraries/Utilities/HMRClient.js +6 -5
- package/React/Base/RCTVersion.m +1 -1
- package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm +2 -2
- package/React/Views/RCTBorderDrawing.m +6 -3
- package/ReactAndroid/api/ReactAndroid.api +3 -3
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/publish.gradle +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/flipper/ReactNativeFlipper.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/packagerconnection/PackagerConnectionSettings.kt +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/modal/ReactModalHostView.kt +26 -16
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp +1 -4
- package/ReactCommon/react/renderer/animations/utils.h +45 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.h +5 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTHost.mm +11 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h +5 -0
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +1 -2
- package/package.json +10 -10
- package/scripts/cocoapods/new_architecture.rb +16 -2
- package/scripts/cocoapods/utils.rb +2 -9
- 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
|
@@ -285,19 +285,6 @@
|
|
|
285
285
|
return [weakSelf sourceURLForBridge:bridge];
|
|
286
286
|
};
|
|
287
287
|
|
|
288
|
-
configuration.hostDidStartBlock = ^(RCTHost *_Nonnull host) {
|
|
289
|
-
[weakSelf hostDidStart:host];
|
|
290
|
-
};
|
|
291
|
-
|
|
292
|
-
configuration.hostDidReceiveJSErrorStackBlock =
|
|
293
|
-
^(RCTHost *_Nonnull host,
|
|
294
|
-
NSArray<NSDictionary<NSString *, id> *> *_Nonnull stack,
|
|
295
|
-
NSString *_Nonnull message,
|
|
296
|
-
NSUInteger exceptionId,
|
|
297
|
-
BOOL isFatal) {
|
|
298
|
-
[weakSelf host:host didReceiveJSErrorStack:stack message:message exceptionId:exceptionId isFatal:isFatal];
|
|
299
|
-
};
|
|
300
|
-
|
|
301
288
|
if ([self respondsToSelector:@selector(extraModulesForBridge:)]) {
|
|
302
289
|
configuration.extraModulesForBridge = ^NSArray<id<RCTBridgeModule>> *_Nonnull(RCTBridge *_Nonnull bridge)
|
|
303
290
|
{
|
|
@@ -319,7 +306,7 @@
|
|
|
319
306
|
};
|
|
320
307
|
}
|
|
321
308
|
|
|
322
|
-
return [[RCTRootViewFactory alloc]
|
|
309
|
+
return [[RCTRootViewFactory alloc] initWithTurboModuleDelegate:self hostDelegate:self configuration:configuration];
|
|
323
310
|
}
|
|
324
311
|
|
|
325
312
|
#pragma mark - Feature Flags
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
@protocol RCTCxxBridgeDelegate;
|
|
13
13
|
@protocol RCTComponentViewFactoryComponentProvider;
|
|
14
14
|
@protocol RCTTurboModuleManagerDelegate;
|
|
15
|
+
@protocol RCTHostDelegate;
|
|
15
16
|
@class RCTBridge;
|
|
16
17
|
@class RCTHost;
|
|
17
18
|
@class RCTRootView;
|
|
@@ -30,13 +31,6 @@ typedef NSURL *_Nullable (^RCTBundleURLBlock)(void);
|
|
|
30
31
|
typedef NSArray<id<RCTBridgeModule>> *_Nonnull (^RCTExtraModulesForBridgeBlock)(RCTBridge *bridge);
|
|
31
32
|
typedef NSDictionary<NSString *, Class> *_Nonnull (^RCTExtraLazyModuleClassesForBridge)(RCTBridge *bridge);
|
|
32
33
|
typedef BOOL (^RCTBridgeDidNotFindModuleBlock)(RCTBridge *bridge, NSString *moduleName);
|
|
33
|
-
typedef void (^RCTHostDidStartBlock)(RCTHost *host);
|
|
34
|
-
typedef void (^RCTHostDidReceiveJSErrorStackBlock)(
|
|
35
|
-
RCTHost *host,
|
|
36
|
-
NSArray<NSDictionary<NSString *, id> *> *stack,
|
|
37
|
-
NSString *message,
|
|
38
|
-
NSUInteger exceptionId,
|
|
39
|
-
BOOL isFatal);
|
|
40
34
|
|
|
41
35
|
#pragma mark - RCTRootViewFactory Configuration
|
|
42
36
|
@interface RCTRootViewFactoryConfiguration : NSObject
|
|
@@ -147,22 +141,6 @@ typedef void (^RCTHostDidReceiveJSErrorStackBlock)(
|
|
|
147
141
|
*/
|
|
148
142
|
@property (nonatomic, nullable) RCTBridgeDidNotFindModuleBlock bridgeDidNotFindModule;
|
|
149
143
|
|
|
150
|
-
/**
|
|
151
|
-
* Called when `RCTHost` started.
|
|
152
|
-
* @parameter: host - The started `RCTHost`.
|
|
153
|
-
*/
|
|
154
|
-
@property (nonatomic, nullable) RCTHostDidStartBlock hostDidStartBlock;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Called when `RCTHost` received JS error.
|
|
158
|
-
* @parameter: host - `RCTHost` which received js error.
|
|
159
|
-
* @parameter: stack - JS error stack.
|
|
160
|
-
* @parameter: message - Error message.
|
|
161
|
-
* @parameter: exceptionId - Exception ID.
|
|
162
|
-
* @parameter: isFatal - YES if JS error is fatal.
|
|
163
|
-
*/
|
|
164
|
-
@property (nonatomic, nullable) RCTHostDidReceiveJSErrorStackBlock hostDidReceiveJSErrorStackBlock;
|
|
165
|
-
|
|
166
144
|
@end
|
|
167
145
|
|
|
168
146
|
#pragma mark - RCTRootViewFactory
|
|
@@ -187,6 +165,10 @@ typedef void (^RCTHostDidReceiveJSErrorStackBlock)(
|
|
|
187
165
|
|
|
188
166
|
- (instancetype)initWithConfiguration:(RCTRootViewFactoryConfiguration *)configuration;
|
|
189
167
|
|
|
168
|
+
- (instancetype)initWithTurboModuleDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
|
|
169
|
+
hostDelegate:(id<RCTHostDelegate>)hostdelegate
|
|
170
|
+
configuration:(RCTRootViewFactoryConfiguration *)configuration;
|
|
171
|
+
|
|
190
172
|
/**
|
|
191
173
|
* This method can be used to create new RCTRootViews on demand.
|
|
192
174
|
*
|
|
@@ -83,7 +83,7 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
|
|
83
83
|
|
|
84
84
|
@end
|
|
85
85
|
|
|
86
|
-
@interface RCTRootViewFactory () <RCTContextContainerHandling
|
|
86
|
+
@interface RCTRootViewFactory () <RCTContextContainerHandling> {
|
|
87
87
|
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
|
|
88
88
|
facebook::react::ContextContainer::Shared _contextContainer;
|
|
89
89
|
}
|
|
@@ -95,15 +95,18 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
|
|
95
95
|
@end
|
|
96
96
|
|
|
97
97
|
@implementation RCTRootViewFactory {
|
|
98
|
-
RCTRootViewFactoryConfiguration *_configuration;
|
|
99
98
|
__weak id<RCTTurboModuleManagerDelegate> _turboModuleManagerDelegate;
|
|
99
|
+
__weak id<RCTHostDelegate> _hostDelegate;
|
|
100
|
+
RCTRootViewFactoryConfiguration *_configuration;
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
- (instancetype)
|
|
103
|
-
|
|
103
|
+
- (instancetype)initWithTurboModuleDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
|
|
104
|
+
hostDelegate:(id<RCTHostDelegate>)hostdelegate
|
|
105
|
+
configuration:(RCTRootViewFactoryConfiguration *)configuration
|
|
104
106
|
{
|
|
105
107
|
if (self = [super init]) {
|
|
106
108
|
_configuration = configuration;
|
|
109
|
+
_hostDelegate = hostdelegate;
|
|
107
110
|
_contextContainer = std::make_shared<const facebook::react::ContextContainer>();
|
|
108
111
|
_reactNativeConfig = std::make_shared<const facebook::react::EmptyReactNativeConfig>();
|
|
109
112
|
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
|
|
@@ -112,6 +115,17 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
|
|
112
115
|
return self;
|
|
113
116
|
}
|
|
114
117
|
|
|
118
|
+
- (instancetype)initWithConfiguration:(RCTRootViewFactoryConfiguration *)configuration
|
|
119
|
+
andTurboModuleManagerDelegate:(id<RCTTurboModuleManagerDelegate>)turboModuleManagerDelegate
|
|
120
|
+
{
|
|
121
|
+
id<RCTHostDelegate> hostDelegate = [turboModuleManagerDelegate conformsToProtocol:@protocol(RCTHostDelegate)]
|
|
122
|
+
? (id<RCTHostDelegate>)turboModuleManagerDelegate
|
|
123
|
+
: nil;
|
|
124
|
+
return [self initWithTurboModuleDelegate:turboModuleManagerDelegate
|
|
125
|
+
hostDelegate:hostDelegate
|
|
126
|
+
configuration:configuration];
|
|
127
|
+
}
|
|
128
|
+
|
|
115
129
|
- (instancetype)initWithConfiguration:(RCTRootViewFactoryConfiguration *)configuration
|
|
116
130
|
{
|
|
117
131
|
return [self initWithConfiguration:configuration andTurboModuleManagerDelegate:nil];
|
|
@@ -191,26 +205,6 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
|
|
191
205
|
return rootView;
|
|
192
206
|
}
|
|
193
207
|
|
|
194
|
-
#pragma mark - RCTHostDelegate
|
|
195
|
-
|
|
196
|
-
- (void)hostDidStart:(RCTHost *)host
|
|
197
|
-
{
|
|
198
|
-
if (self->_configuration.hostDidStartBlock) {
|
|
199
|
-
self->_configuration.hostDidStartBlock(host);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
- (void)host:(RCTHost *)host
|
|
204
|
-
didReceiveJSErrorStack:(NSArray<NSDictionary<NSString *, id> *> *)stack
|
|
205
|
-
message:(NSString *)message
|
|
206
|
-
exceptionId:(NSUInteger)exceptionId
|
|
207
|
-
isFatal:(BOOL)isFatal
|
|
208
|
-
{
|
|
209
|
-
if (self->_configuration.hostDidReceiveJSErrorStackBlock) {
|
|
210
|
-
self->_configuration.hostDidReceiveJSErrorStackBlock(host, stack, message, exceptionId, isFatal);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
208
|
#pragma mark - RCTCxxBridgeDelegate
|
|
215
209
|
- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
|
|
216
210
|
{
|
|
@@ -269,7 +263,7 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
|
|
269
263
|
__weak __typeof(self) weakSelf = self;
|
|
270
264
|
RCTHost *reactHost =
|
|
271
265
|
[[RCTHost alloc] initWithBundleURLProvider:self->_configuration.bundleURLBlock
|
|
272
|
-
hostDelegate:
|
|
266
|
+
hostDelegate:_hostDelegate
|
|
273
267
|
turboModuleManagerDelegate:_turboModuleManagerDelegate
|
|
274
268
|
jsEngineProvider:^std::shared_ptr<facebook::react::JSRuntimeFactory>() {
|
|
275
269
|
return [weakSelf createJSRuntimeFactory];
|
|
@@ -42,9 +42,13 @@ if (__DEV__) {
|
|
|
42
42
|
if (!Platform.isTesting) {
|
|
43
43
|
const HMRClient = require('../Utilities/HMRClient');
|
|
44
44
|
|
|
45
|
+
// [0.76 only] When under React Native DevTools, log "JavaScript logs will
|
|
46
|
+
// be removed from Metro..." warning, and continue to forward logs.
|
|
45
47
|
if (global.__FUSEBOX_HAS_FULL_CONSOLE_SUPPORT__) {
|
|
46
48
|
HMRClient.unstable_notifyFuseboxConsoleEnabled();
|
|
47
|
-
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (console._isPolyfilled) {
|
|
48
52
|
// We assume full control over the console and send JavaScript logs to Metro.
|
|
49
53
|
[
|
|
50
54
|
'trace',
|
|
@@ -153,11 +153,12 @@ const HMRClient: HMRClientNativeInterface = {
|
|
|
153
153
|
level: 'info',
|
|
154
154
|
data: [
|
|
155
155
|
'\n' +
|
|
156
|
-
'\
|
|
157
|
-
' \
|
|
158
|
-
'
|
|
159
|
-
'
|
|
160
|
-
'
|
|
156
|
+
'\u001B[7m' +
|
|
157
|
+
' \u001B[1m💡 JavaScript logs will be removed from Metro in React ' +
|
|
158
|
+
'Native 0.77!\u001B[22m Please use React Native DevTools as your ' +
|
|
159
|
+
'default tool. Tip: Type \u001B[1mj\u001B[22m in the terminal to ' +
|
|
160
|
+
'open (requires Google Chrome or Microsoft Edge).' +
|
|
161
|
+
'\u001B[27m' +
|
|
161
162
|
'\n',
|
|
162
163
|
],
|
|
163
164
|
}),
|
package/React/Base/RCTVersion.m
CHANGED
package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTPullToRefreshViewComponentView.mm
CHANGED
|
@@ -112,11 +112,11 @@ using namespace facebook::react;
|
|
|
112
112
|
needsUpdateTitle = YES;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
[super updateProps:props oldProps:oldProps];
|
|
116
|
+
|
|
115
117
|
if (needsUpdateTitle) {
|
|
116
118
|
[self _updateTitle];
|
|
117
119
|
}
|
|
118
|
-
|
|
119
|
-
[super updateProps:props oldProps:oldProps];
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
#pragma mark -
|
|
@@ -182,7 +182,7 @@ static CGPathRef RCTPathCreateOuterOutline(BOOL drawToEdge, CGRect rect, RCTCorn
|
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
static UIGraphicsImageRenderer *
|
|
185
|
-
|
|
185
|
+
RCTMakeUIGraphicsImageRenderer(CGSize size, CGColorRef backgroundColor, BOOL hasCornerRadii, BOOL drawToEdge)
|
|
186
186
|
{
|
|
187
187
|
const CGFloat alpha = CGColorGetAlpha(backgroundColor);
|
|
188
188
|
const BOOL opaque = (drawToEdge || !hasCornerRadii) && alpha == 1.0;
|
|
@@ -231,7 +231,9 @@ static UIImage *RCTGetSolidBorderImage(
|
|
|
231
231
|
} : viewSize;
|
|
232
232
|
|
|
233
233
|
UIGraphicsImageRenderer *const imageRenderer =
|
|
234
|
-
|
|
234
|
+
RCTMakeUIGraphicsImageRenderer(size, backgroundColor, hasCornerRadii, drawToEdge);
|
|
235
|
+
|
|
236
|
+
CGColorRetain(backgroundColor);
|
|
235
237
|
UIImage *image = [imageRenderer imageWithActions:^(UIGraphicsImageRendererContext *_Nonnull rendererContext) {
|
|
236
238
|
const CGContextRef context = rendererContext.CGContext;
|
|
237
239
|
const CGRect rect = {.size = size};
|
|
@@ -242,6 +244,7 @@ static UIImage *RCTGetSolidBorderImage(
|
|
|
242
244
|
CGContextAddPath(context, path);
|
|
243
245
|
CGContextFillPath(context);
|
|
244
246
|
}
|
|
247
|
+
CGColorRelease(backgroundColor);
|
|
245
248
|
|
|
246
249
|
CGContextAddPath(context, path);
|
|
247
250
|
CGPathRelease(path);
|
|
@@ -481,7 +484,7 @@ static UIImage *RCTGetDashedOrDottedBorderImage(
|
|
|
481
484
|
|
|
482
485
|
const BOOL hasCornerRadii = RCTCornerRadiiAreAboveThreshold(cornerRadii);
|
|
483
486
|
UIGraphicsImageRenderer *const imageRenderer =
|
|
484
|
-
|
|
487
|
+
RCTMakeUIGraphicsImageRenderer(viewSize, backgroundColor, hasCornerRadii, drawToEdge);
|
|
485
488
|
return [imageRenderer imageWithActions:^(UIGraphicsImageRendererContext *_Nonnull rendererContext) {
|
|
486
489
|
const CGContextRef context = rendererContext.CGContext;
|
|
487
490
|
const CGRect rect = {.size = viewSize};
|
|
@@ -3798,13 +3798,13 @@ public abstract class com/facebook/react/packagerconnection/NotificationOnlyHand
|
|
|
3798
3798
|
public final fun onRequest (Ljava/lang/Object;Lcom/facebook/react/packagerconnection/Responder;)V
|
|
3799
3799
|
}
|
|
3800
3800
|
|
|
3801
|
-
public
|
|
3801
|
+
public class com/facebook/react/packagerconnection/PackagerConnectionSettings {
|
|
3802
3802
|
public fun <init> (Landroid/content/Context;)V
|
|
3803
3803
|
public final fun getAdditionalOptionsForPackager ()Ljava/util/Map;
|
|
3804
|
-
public
|
|
3804
|
+
public fun getDebugServerHost ()Ljava/lang/String;
|
|
3805
3805
|
public final fun getPackageName ()Ljava/lang/String;
|
|
3806
3806
|
public final fun setAdditionalOptionForPackager (Ljava/lang/String;Ljava/lang/String;)V
|
|
3807
|
-
public
|
|
3807
|
+
public fun setDebugServerHost (Ljava/lang/String;)V
|
|
3808
3808
|
}
|
|
3809
3809
|
|
|
3810
3810
|
public final class com/facebook/react/packagerconnection/ReconnectingWebSocket : okhttp3/WebSocketListener {
|
|
@@ -20,7 +20,7 @@ def sonatypeUsername = findProperty('SONATYPE_USERNAME')
|
|
|
20
20
|
def sonatypePassword = findProperty('SONATYPE_PASSWORD')
|
|
21
21
|
|
|
22
22
|
def reactAndroidProjectDir = project(':packages:react-native:ReactAndroid').projectDir
|
|
23
|
-
def mavenTempLocalUrl = 'file:///
|
|
23
|
+
def mavenTempLocalUrl = 'file:///Users/expo/workingdir/build/maven_local'
|
|
24
24
|
// Rewritten when copying this to ReactAndroid/publish.gradle
|
|
25
25
|
|
|
26
26
|
publishing {
|
|
@@ -103,4 +103,4 @@ publishing {
|
|
|
103
103
|
} else {
|
|
104
104
|
logger.info('Signing disabled as the PGP key was not found')
|
|
105
105
|
}
|
|
106
|
-
}
|
|
106
|
+
}
|
|
@@ -19,7 +19,7 @@ import com.facebook.react.ReactInstanceManager
|
|
|
19
19
|
message =
|
|
20
20
|
"ReactNative/Flipper integration is deprecated. Please remove the call to initializeFlipper from your MainApplication.java",
|
|
21
21
|
replaceWith = ReplaceWith(""),
|
|
22
|
-
level = DeprecationLevel.
|
|
22
|
+
level = DeprecationLevel.ERROR)
|
|
23
23
|
public object ReactNativeFlipper {
|
|
24
24
|
@Suppress("UNUSED_PARAMETER")
|
|
25
25
|
@JvmStatic
|
|
@@ -27,7 +27,7 @@ public object ReactNativeFlipper {
|
|
|
27
27
|
message =
|
|
28
28
|
"ReactNative/Flipper integration is deprecated. Please remove the call to initializeFlipper from your MainApplication.java",
|
|
29
29
|
replaceWith = ReplaceWith(""),
|
|
30
|
-
level = DeprecationLevel.
|
|
30
|
+
level = DeprecationLevel.ERROR)
|
|
31
31
|
public fun initializeFlipper(context: Context, reactInstanceManager: ReactInstanceManager) {
|
|
32
32
|
// no-op
|
|
33
33
|
}
|
|
@@ -15,13 +15,13 @@ import android.preference.PreferenceManager
|
|
|
15
15
|
import com.facebook.common.logging.FLog
|
|
16
16
|
import com.facebook.react.modules.systeminfo.AndroidInfoHelpers
|
|
17
17
|
|
|
18
|
-
public class PackagerConnectionSettings(private val appContext: Context) {
|
|
18
|
+
public open class PackagerConnectionSettings(private val appContext: Context) {
|
|
19
19
|
private val preferences: SharedPreferences =
|
|
20
20
|
PreferenceManager.getDefaultSharedPreferences(appContext)
|
|
21
21
|
public val packageName: String = appContext.packageName
|
|
22
22
|
private val _additionalOptionsForPackager: MutableMap<String, String> = mutableMapOf()
|
|
23
23
|
|
|
24
|
-
public var debugServerHost: String
|
|
24
|
+
public open var debugServerHost: String
|
|
25
25
|
get() {
|
|
26
26
|
// Check host setting first. If empty try to detect emulator type and use default
|
|
27
27
|
// hostname for those
|
|
@@ -27,6 +27,7 @@ import android.view.WindowManager
|
|
|
27
27
|
import android.view.accessibility.AccessibilityEvent
|
|
28
28
|
import android.widget.FrameLayout
|
|
29
29
|
import androidx.annotation.UiThread
|
|
30
|
+
import com.facebook.common.logging.FLog
|
|
30
31
|
import com.facebook.react.R
|
|
31
32
|
import com.facebook.react.bridge.GuardedRunnable
|
|
32
33
|
import com.facebook.react.bridge.LifecycleEventListener
|
|
@@ -34,6 +35,7 @@ import com.facebook.react.bridge.ReactContext
|
|
|
34
35
|
import com.facebook.react.bridge.UiThreadUtil
|
|
35
36
|
import com.facebook.react.bridge.WritableMap
|
|
36
37
|
import com.facebook.react.bridge.WritableNativeMap
|
|
38
|
+
import com.facebook.react.common.ReactConstants
|
|
37
39
|
import com.facebook.react.common.annotations.VisibleForTesting
|
|
38
40
|
import com.facebook.react.config.ReactFeatureFlags
|
|
39
41
|
import com.facebook.react.modules.core.ReactAndroidHWInputDeviceHelper
|
|
@@ -313,29 +315,37 @@ public class ReactModalHostView(context: ThemedReactContext) :
|
|
|
313
315
|
val dialogWindow =
|
|
314
316
|
checkNotNull(dialog.window) { "dialog must have window when we call updateProperties" }
|
|
315
317
|
val currentActivity = getCurrentActivity()
|
|
316
|
-
if (currentActivity == null || currentActivity.isFinishing) {
|
|
318
|
+
if (currentActivity == null || currentActivity.isFinishing || currentActivity.isDestroyed) {
|
|
317
319
|
// If the activity has disappeared, then we shouldn't update the window associated to the
|
|
318
320
|
// Dialog.
|
|
319
321
|
return
|
|
320
322
|
}
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
323
|
+
try {
|
|
324
|
+
val activityWindow = currentActivity.window
|
|
325
|
+
if (activityWindow != null) {
|
|
326
|
+
val activityWindowFlags = activityWindow.attributes.flags
|
|
327
|
+
if ((activityWindowFlags and WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0) {
|
|
328
|
+
dialogWindow.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
|
329
|
+
} else {
|
|
330
|
+
dialogWindow.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
|
331
|
+
}
|
|
328
332
|
}
|
|
329
|
-
}
|
|
330
333
|
|
|
331
|
-
|
|
334
|
+
dialogWindow.setStatusBarTranslucency(statusBarTranslucent)
|
|
332
335
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
336
|
+
if (transparent) {
|
|
337
|
+
dialogWindow.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND)
|
|
338
|
+
} else {
|
|
339
|
+
dialogWindow.setDimAmount(0.5f)
|
|
340
|
+
dialogWindow.setFlags(
|
|
341
|
+
WindowManager.LayoutParams.FLAG_DIM_BEHIND, WindowManager.LayoutParams.FLAG_DIM_BEHIND)
|
|
342
|
+
}
|
|
343
|
+
} catch (e: IllegalArgumentException) {
|
|
344
|
+
// This is to prevent a crash from the following error, without a clear repro steps:
|
|
345
|
+
// java.lang.IllegalArgumentException: View=DecorView@c94931b[XxxActivity] not attached to
|
|
346
|
+
// window manager
|
|
347
|
+
FLog.e(
|
|
348
|
+
ReactConstants.TAG, "ReactModalHostView: error while setting window flags: ", e.message)
|
|
339
349
|
}
|
|
340
350
|
}
|
|
341
351
|
|
|
@@ -790,10 +790,7 @@ LayoutAnimationKeyFrameManager::pullTransaction(
|
|
|
790
790
|
finalConflictingMutations.end(),
|
|
791
791
|
&shouldFirstComeBeforeSecondMutation);
|
|
792
792
|
|
|
793
|
-
|
|
794
|
-
immediateMutations.begin(),
|
|
795
|
-
immediateMutations.end(),
|
|
796
|
-
&shouldFirstComeBeforeSecondRemovesOnly);
|
|
793
|
+
handleShouldFirstComeBeforeSecondRemovesOnly(immediateMutations);
|
|
797
794
|
|
|
798
795
|
animation.keyFrames = keyFramesToAnimate;
|
|
799
796
|
inflightAnimations_.push_back(std::move(animation));
|
|
@@ -24,6 +24,40 @@ static inline bool shouldFirstComeBeforeSecondRemovesOnly(
|
|
|
24
24
|
(lhs.index > rhs.index);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
static inline void handleShouldFirstComeBeforeSecondRemovesOnly(
|
|
28
|
+
ShadowViewMutation::List& list) noexcept {
|
|
29
|
+
std::unordered_map<std::string, std::vector<ShadowViewMutation>>
|
|
30
|
+
removeMutationsByTag;
|
|
31
|
+
ShadowViewMutation::List finalList;
|
|
32
|
+
for (auto& mutation : list) {
|
|
33
|
+
if (mutation.type == ShadowViewMutation::Type::Remove) {
|
|
34
|
+
auto key = std::to_string(mutation.parentShadowView.tag);
|
|
35
|
+
removeMutationsByTag[key].push_back(mutation);
|
|
36
|
+
} else {
|
|
37
|
+
finalList.push_back(mutation);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (removeMutationsByTag.size() == 0) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
for (auto& mutationsPair : removeMutationsByTag) {
|
|
46
|
+
if (mutationsPair.second.size() > 1) {
|
|
47
|
+
std::stable_sort(
|
|
48
|
+
mutationsPair.second.begin(),
|
|
49
|
+
mutationsPair.second.end(),
|
|
50
|
+
&shouldFirstComeBeforeSecondRemovesOnly);
|
|
51
|
+
}
|
|
52
|
+
finalList.insert(
|
|
53
|
+
finalList.begin(),
|
|
54
|
+
mutationsPair.second.begin(),
|
|
55
|
+
mutationsPair.second.end());
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
list = finalList;
|
|
59
|
+
}
|
|
60
|
+
|
|
27
61
|
static inline bool shouldFirstComeBeforeSecondMutation(
|
|
28
62
|
const ShadowViewMutation& lhs,
|
|
29
63
|
const ShadowViewMutation& rhs) noexcept {
|
|
@@ -55,6 +89,17 @@ static inline bool shouldFirstComeBeforeSecondMutation(
|
|
|
55
89
|
lhs.type == ShadowViewMutation::Type::Insert) {
|
|
56
90
|
return false;
|
|
57
91
|
}
|
|
92
|
+
|
|
93
|
+
// Remove comes before Update
|
|
94
|
+
if (lhs.type == ShadowViewMutation::Type::Remove &&
|
|
95
|
+
rhs.type == ShadowViewMutation::Type::Update) {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
if (rhs.type == ShadowViewMutation::Type::Remove &&
|
|
99
|
+
lhs.type == ShadowViewMutation::Type::Update) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
|
|
58
103
|
} else {
|
|
59
104
|
// Make sure that removes on the same level are sorted - highest indices
|
|
60
105
|
// must come first.
|
|
@@ -35,6 +35,11 @@ typedef NSURL *_Nullable (^RCTHostBundleURLProvider)(void);
|
|
|
35
35
|
|
|
36
36
|
- (void)hostDidStart:(RCTHost *)host;
|
|
37
37
|
|
|
38
|
+
@optional
|
|
39
|
+
- (void)loadBundleAtURL:(NSURL *)sourceURL
|
|
40
|
+
onProgress:(RCTSourceLoadProgressBlock)onProgress
|
|
41
|
+
onComplete:(RCTSourceLoadBlock)loadCallback;
|
|
42
|
+
|
|
38
43
|
@end
|
|
39
44
|
|
|
40
45
|
@protocol RCTHostRuntimeDelegate <NSObject>
|
|
@@ -329,6 +329,17 @@ class RCTHostHostTargetDelegate : public facebook::react::jsinspector_modern::Ho
|
|
|
329
329
|
[self.runtimeDelegate host:self didInitializeRuntime:runtime];
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
+
- (void)loadBundleAtURL:(NSURL *)sourceURL
|
|
333
|
+
onProgress:(RCTSourceLoadProgressBlock)onProgress
|
|
334
|
+
onComplete:(RCTSourceLoadBlock)loadCallback
|
|
335
|
+
{
|
|
336
|
+
if ([_hostDelegate respondsToSelector:@selector(loadBundleAtURL:onProgress:onComplete:)]) {
|
|
337
|
+
[_hostDelegate loadBundleAtURL:sourceURL onProgress:onProgress onComplete:loadCallback];
|
|
338
|
+
} else {
|
|
339
|
+
[RCTJavaScriptLoader loadBundleAtURL:sourceURL onProgress:onProgress onComplete:loadCallback];
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
332
343
|
#pragma mark - RCTContextContainerHandling
|
|
333
344
|
|
|
334
345
|
- (void)didCreateContextContainer:(std::shared_ptr<facebook::react::ContextContainer>)contextContainer
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#import <UIKit/UIKit.h>
|
|
9
9
|
|
|
10
10
|
#import <React/RCTDefines.h>
|
|
11
|
+
#import <React/RCTJavaScriptLoader.h>
|
|
11
12
|
#import <jsinspector-modern/ReactCdp.h>
|
|
12
13
|
#import <react/runtime/JSRuntimeFactory.h>
|
|
13
14
|
#import <react/runtime/ReactInstance.h>
|
|
@@ -44,6 +45,10 @@ RCT_EXTERN void RCTInstanceSetRuntimeDiagnosticFlags(NSString *_Nullable flags);
|
|
|
44
45
|
|
|
45
46
|
- (void)instance:(RCTInstance *)instance didInitializeRuntime:(facebook::jsi::Runtime &)runtime;
|
|
46
47
|
|
|
48
|
+
- (void)loadBundleAtURL:(NSURL *)sourceURL
|
|
49
|
+
onProgress:(RCTSourceLoadProgressBlock)onProgress
|
|
50
|
+
onComplete:(RCTSourceLoadBlock)loadCallback;
|
|
51
|
+
|
|
47
52
|
@end
|
|
48
53
|
|
|
49
54
|
/**
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
#import <React/RCTDisplayLink.h>
|
|
26
26
|
#import <React/RCTEventDispatcherProtocol.h>
|
|
27
27
|
#import <React/RCTFollyConvert.h>
|
|
28
|
-
#import <React/RCTJavaScriptLoader.h>
|
|
29
28
|
#import <React/RCTLog.h>
|
|
30
29
|
#import <React/RCTLogBox.h>
|
|
31
30
|
#import <React/RCTModuleData.h>
|
|
@@ -428,7 +427,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
|
|
|
428
427
|
#endif
|
|
429
428
|
|
|
430
429
|
__weak __typeof(self) weakSelf = self;
|
|
431
|
-
[
|
|
430
|
+
[_delegate loadBundleAtURL:sourceURL
|
|
432
431
|
onProgress:^(RCTLoadingProgress *progressData) {
|
|
433
432
|
__typeof(self) strongSelf = weakSelf;
|
|
434
433
|
if (!strongSelf) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-tvos",
|
|
3
|
-
"version": "0.76.0-
|
|
3
|
+
"version": "0.76.0-0rc5",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -110,13 +110,13 @@
|
|
|
110
110
|
},
|
|
111
111
|
"dependencies": {
|
|
112
112
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
113
|
-
"@react-native/assets-registry": "0.76.0-rc.
|
|
114
|
-
"@react-native/codegen": "0.76.0-rc.
|
|
115
|
-
"@react-native/community-cli-plugin": "0.76.0-rc.
|
|
116
|
-
"@react-native/gradle-plugin": "0.76.0-rc.
|
|
117
|
-
"@react-native/js-polyfills": "0.76.0-rc.
|
|
118
|
-
"@react-native/normalize-colors": "0.76.0-rc.
|
|
119
|
-
"@react-native-tvos/virtualized-lists": "0.76.0-
|
|
113
|
+
"@react-native/assets-registry": "0.76.0-rc.5",
|
|
114
|
+
"@react-native/codegen": "0.76.0-rc.5",
|
|
115
|
+
"@react-native/community-cli-plugin": "0.76.0-rc.5",
|
|
116
|
+
"@react-native/gradle-plugin": "0.76.0-rc.5",
|
|
117
|
+
"@react-native/js-polyfills": "0.76.0-rc.5",
|
|
118
|
+
"@react-native/normalize-colors": "0.76.0-rc.5",
|
|
119
|
+
"@react-native-tvos/virtualized-lists": "0.76.0-0rc5",
|
|
120
120
|
"abort-controller": "^3.0.0",
|
|
121
121
|
"anser": "^1.4.9",
|
|
122
122
|
"ansi-regex": "^5.0.0",
|
|
@@ -132,8 +132,8 @@
|
|
|
132
132
|
"jest-environment-node": "^29.6.3",
|
|
133
133
|
"jsc-android": "^250231.0.0",
|
|
134
134
|
"memoize-one": "^5.0.0",
|
|
135
|
-
"metro-runtime": "^0.81.0
|
|
136
|
-
"metro-source-map": "^0.81.0
|
|
135
|
+
"metro-runtime": "^0.81.0",
|
|
136
|
+
"metro-source-map": "^0.81.0",
|
|
137
137
|
"mkdirp": "^0.5.1",
|
|
138
138
|
"nullthrows": "^1.1.1",
|
|
139
139
|
"pretty-format": "^29.7.0",
|
|
@@ -12,19 +12,33 @@ class NewArchitectureHelper
|
|
|
12
12
|
@@NewArchWarningEmitted = false # Used not to spam warnings to the user.
|
|
13
13
|
|
|
14
14
|
def self.set_clang_cxx_language_standard_if_needed(installer)
|
|
15
|
+
cxxBuildsettingsName = "CLANG_CXX_LANGUAGE_STANDARD"
|
|
15
16
|
projects = installer.aggregate_targets
|
|
16
17
|
.map{ |t| t.user_project }
|
|
17
18
|
.uniq{ |p| p.path }
|
|
18
19
|
|
|
19
20
|
projects.each do |project|
|
|
20
|
-
Pod::UI.puts("Setting
|
|
21
|
+
Pod::UI.puts("Setting #{cxxBuildsettingsName} to #{ Helpers::Constants::cxx_language_standard } on #{ project.path }")
|
|
21
22
|
|
|
22
23
|
project.build_configurations.each do |config|
|
|
23
|
-
config.build_settings[
|
|
24
|
+
config.build_settings[cxxBuildsettingsName] = Helpers::Constants::cxx_language_standard
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
project.save()
|
|
27
28
|
end
|
|
29
|
+
|
|
30
|
+
installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
|
|
31
|
+
target_installation_result.native_target.build_configurations.each do |config|
|
|
32
|
+
config.build_settings[cxxBuildsettingsName] = Helpers::Constants::cxx_language_standard
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Override targets that would set spec.xcconfig to define c++ version
|
|
37
|
+
installer.aggregate_targets.each do |aggregate_target|
|
|
38
|
+
aggregate_target.xcconfigs.each do |config_name, config_file|
|
|
39
|
+
config_file.attributes[cxxBuildsettingsName] = Helpers::Constants::cxx_language_standard
|
|
40
|
+
end
|
|
41
|
+
end
|
|
28
42
|
end
|
|
29
43
|
|
|
30
44
|
def self.computeFlags(is_new_arch_enabled)
|
|
@@ -236,16 +236,9 @@ class ReactNativePodsUtils
|
|
|
236
236
|
if !file_manager.exist?("#{file_path}.local")
|
|
237
237
|
# When installing pods with a yarn alias, yarn creates a fake yarn and node executables
|
|
238
238
|
# in a temporary folder.
|
|
239
|
-
# Using `
|
|
240
|
-
# exclude the temporary ones.
|
|
239
|
+
# Using `node --print "process.argv[0]";` we are able to retrieve the actual path from which node is running.
|
|
241
240
|
# see https://github.com/facebook/react-native/issues/43285 for more info
|
|
242
|
-
node_binary = `
|
|
243
|
-
path.gsub!("node is ", "")
|
|
244
|
-
}.select { |b|
|
|
245
|
-
return !b.start_with?("/var")
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
node_binary = node_binary[0]
|
|
241
|
+
node_binary = `node --print "process.argv[0]";`
|
|
249
242
|
system("echo 'export NODE_BINARY=#{node_binary}' > #{file_path}.local")
|
|
250
243
|
end
|
|
251
244
|
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|