react-native 0.73.0-rc.1 → 0.73.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/AppDelegate/RCTAppDelegate.mm +1 -1
- package/Libraries/AppDelegate/React-RCTAppDelegate.podspec +6 -2
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/LogBox/Data/LogBoxData.js +2 -1
- package/Libraries/NativeComponent/NativeComponentRegistry.js +10 -4
- package/Libraries/promiseRejectionTrackingOptions.js +21 -7
- package/React/Base/RCTBridgeProxy.mm +11 -3
- package/React/Base/RCTConstants.h +1 -1
- package/React/Base/RCTConstants.m +1 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/RCTSurfaceRootShadowView.h +1 -1
- package/React/Base/Surface/RCTSurfaceRootShadowView.m +1 -1
- package/React/CoreModules/RCTDeviceInfo.mm +1 -1
- package/React/CoreModules/React-CoreModules.podspec +1 -1
- package/React/Modules/RCTUIManager.h +7 -0
- package/React/Modules/RCTUIManager.m +1 -1
- package/React/UIUtils/RCTUIUtils.h +1 -1
- package/React/Views/RCTComponentData.m +1 -1
- package/React/Views/RCTLayout.h +1 -1
- package/React/Views/RCTRootShadowView.h +1 -1
- package/React/Views/RCTRootShadowView.m +1 -1
- package/React/Views/RCTShadowView.m +1 -1
- package/React/Views/ScrollView/RCTScrollView.m +1 -1
- package/React/Views/UIView+React.m +30 -23
- package/React-Core.podspec +1 -1
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactApplication.kt +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +0 -1
- package/ReactAndroid/src/main/java/com/facebook/react/{interfaces/ReactHost.kt → ReactHost.kt} +2 -3
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/UnstableReactNativeAPI.kt +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHost.kt +58 -8
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactNativeHost.kt +16 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/devloading/DevLoadingModule.java +3 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.java +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/CoreReactPackage.java +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/shell/MainReactPackage.java +5 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/FabricViewStateManager.java +95 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java +25 -6
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +33 -23
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/hermes/executor/HermesExecutorFactory.cpp +10 -7
- package/ReactCommon/react/bridging/Object.h +1 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm +8 -0
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.h +3 -1
- package/ReactCommon/react/renderer/components/legacyviewmanagerinterop/RCTLegacyViewManagerInteropCoordinator.mm +42 -10
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +17 -17
- package/gradle/libs.versions.toml +1 -1
- package/package.json +4 -4
- package/scripts/cocoapods/utils.rb +4 -23
- package/scripts/codegen/generate-legacy-interop-components.js +8 -2
- package/sdks/hermes-engine/hermes-engine.podspec +7 -1
- package/sdks/hermes-engine/hermes-utils.rb +9 -6
- package/sdks/hermes-engine/utils/replace_hermes_version.js +8 -8
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/Gemfile +2 -1
- package/template/android/app/build.gradle +1 -1
- package/template/android/app/src/main/java/com/helloworld/MainApplication.kt +3 -10
- package/template/index.js +0 -9
- package/template/package.json +1 -1
- package/third-party-podspecs/glog.podspec +14 -1
|
@@ -192,7 +192,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
|
|
|
192
192
|
interfaceOrientation:(UIInterfaceOrientation)previousInterfaceOrientation
|
|
193
193
|
traitCollection:(UITraitCollection *)previousTraitCollection API_AVAILABLE(ios(13.0))
|
|
194
194
|
{
|
|
195
|
-
[[NSNotificationCenter defaultCenter] postNotificationName:
|
|
195
|
+
[[NSNotificationCenter defaultCenter] postNotificationName:RCTWindowFrameDidChangeNotification object:self];
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
#pragma mark - RCTCxxBridgeDelegate
|
|
@@ -117,15 +117,19 @@ Pod::Spec.new do |s|
|
|
|
117
117
|
s.dependency "React-debug"
|
|
118
118
|
s.dependency "React-rendererdebug"
|
|
119
119
|
|
|
120
|
+
rel_path_from_pods_root_to_app = Pathname.new(ENV['APP_PATH']).relative_path_from(Pod::Config.instance.installation_root)
|
|
121
|
+
rel_path_from_pods_to_app = Pathname.new(ENV['APP_PATH']).relative_path_from(File.join(Pod::Config.instance.installation_root, 'Pods'))
|
|
122
|
+
|
|
123
|
+
|
|
120
124
|
s.script_phases = {
|
|
121
125
|
:name => "Generate Legacy Components Interop",
|
|
122
126
|
:script => "
|
|
123
127
|
WITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"
|
|
124
128
|
source $WITH_ENVIRONMENT
|
|
125
|
-
${NODE_BINARY} ${REACT_NATIVE_PATH}/scripts/codegen/generate-legacy-interop-components.js -p #{
|
|
129
|
+
${NODE_BINARY} ${REACT_NATIVE_PATH}/scripts/codegen/generate-legacy-interop-components.js -p #{rel_path_from_pods_to_app} -o ${REACT_NATIVE_PATH}/Libraries/AppDelegate
|
|
126
130
|
",
|
|
127
131
|
:execution_position => :before_compile,
|
|
128
|
-
:input_files => ["#{
|
|
132
|
+
:input_files => ["#{rel_path_from_pods_root_to_app}/react-native.config.js"],
|
|
129
133
|
:output_files => ["${REACT_NATIVE_PATH}/Libraries/AppDelegate/RCTLegacyInteropComponents.mm"],
|
|
130
134
|
}
|
|
131
135
|
end
|
|
@@ -30,6 +30,7 @@ export type LogData = $ReadOnly<{|
|
|
|
30
30
|
message: Message,
|
|
31
31
|
category: Category,
|
|
32
32
|
componentStack: ComponentStack,
|
|
33
|
+
stack?: string,
|
|
33
34
|
|}>;
|
|
34
35
|
|
|
35
36
|
export type Observer = (
|
|
@@ -198,7 +199,7 @@ export function addLog(log: LogData): void {
|
|
|
198
199
|
// otherwise spammy logs would pause rendering.
|
|
199
200
|
setImmediate(() => {
|
|
200
201
|
try {
|
|
201
|
-
const stack = parseErrorStack(errorForStackTrace?.stack);
|
|
202
|
+
const stack = parseErrorStack(log.stack ?? errorForStackTrace?.stack);
|
|
202
203
|
|
|
203
204
|
appendNewLog(
|
|
204
205
|
new LogBoxLog({
|
|
@@ -55,14 +55,20 @@ export function get<Config>(
|
|
|
55
55
|
): HostComponent<Config> {
|
|
56
56
|
ReactNativeViewConfigRegistry.register(name, () => {
|
|
57
57
|
const {native, strict, verify} = getRuntimeConfig?.(name) ?? {
|
|
58
|
-
native:
|
|
58
|
+
native: !global.RN$Bridgeless,
|
|
59
59
|
strict: false,
|
|
60
60
|
verify: false,
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
let viewConfig;
|
|
64
|
+
if (native) {
|
|
65
|
+
viewConfig = getNativeComponentAttributes(name);
|
|
66
|
+
} else {
|
|
67
|
+
viewConfig = createViewConfig(viewConfigProvider());
|
|
68
|
+
if (viewConfig == null) {
|
|
69
|
+
viewConfig = getNativeComponentAttributes(name);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
66
72
|
|
|
67
73
|
if (verify) {
|
|
68
74
|
const nativeViewConfig = native
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
import typeof {enable} from 'promise/setimmediate/rejection-tracking';
|
|
12
12
|
|
|
13
|
+
import LogBox from './LogBox/LogBox';
|
|
14
|
+
|
|
13
15
|
let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
|
|
14
16
|
allRejections: true,
|
|
15
17
|
onUnhandled: (id, rejection = {}) => {
|
|
@@ -34,17 +36,29 @@ let rejectionTrackingOptions: $NonMaybeType<Parameters<enable>[0]> = {
|
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
|
|
37
|
-
const warning =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
const warning = `Possible unhandled promise rejection (id: ${id}):\n${
|
|
40
|
+
message ?? ''
|
|
41
|
+
}`;
|
|
42
|
+
if (__DEV__) {
|
|
43
|
+
LogBox.addLog({
|
|
44
|
+
level: 'warn',
|
|
45
|
+
message: {
|
|
46
|
+
content: warning,
|
|
47
|
+
substitutions: [],
|
|
48
|
+
},
|
|
49
|
+
componentStack: [],
|
|
50
|
+
stack,
|
|
51
|
+
category: 'possible_unhandled_promise_rejection',
|
|
52
|
+
});
|
|
53
|
+
} else {
|
|
54
|
+
console.warn(warning);
|
|
55
|
+
}
|
|
42
56
|
},
|
|
43
57
|
onHandled: id => {
|
|
44
58
|
const warning =
|
|
45
|
-
`Promise
|
|
59
|
+
`Promise rejection handled (id: ${id})\n` +
|
|
46
60
|
'This means you can ignore any previous messages of the form ' +
|
|
47
|
-
`"Possible
|
|
61
|
+
`"Possible unhandled promise rejection (id: ${id}):"`;
|
|
48
62
|
console.warn(warning);
|
|
49
63
|
},
|
|
50
64
|
};
|
|
@@ -351,6 +351,11 @@ using namespace facebook;
|
|
|
351
351
|
return (RCTUIManager *)_uiManagerProxy;
|
|
352
352
|
}
|
|
353
353
|
|
|
354
|
+
- (RCTBridgeProxy *)object
|
|
355
|
+
{
|
|
356
|
+
return self;
|
|
357
|
+
}
|
|
358
|
+
|
|
354
359
|
/**
|
|
355
360
|
* NSProxy setup
|
|
356
361
|
*/
|
|
@@ -387,12 +392,14 @@ using namespace facebook;
|
|
|
387
392
|
|
|
388
393
|
@implementation RCTUIManagerProxy {
|
|
389
394
|
RCTViewRegistry *_viewRegistry;
|
|
395
|
+
NSMutableDictionary<NSNumber *, UIView *> *_legacyViewRegistry;
|
|
390
396
|
}
|
|
391
397
|
- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
|
|
392
398
|
{
|
|
393
399
|
self = [super self];
|
|
394
400
|
if (self) {
|
|
395
401
|
_viewRegistry = viewRegistry;
|
|
402
|
+
_legacyViewRegistry = [NSMutableDictionary new];
|
|
396
403
|
}
|
|
397
404
|
return self;
|
|
398
405
|
}
|
|
@@ -404,20 +411,21 @@ using namespace facebook;
|
|
|
404
411
|
{
|
|
405
412
|
[self logWarning:@"Please migrate to RCTViewRegistry: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED."
|
|
406
413
|
cmd:_cmd];
|
|
407
|
-
return [_viewRegistry viewForReactTag:reactTag]
|
|
414
|
+
return [_viewRegistry viewForReactTag:reactTag] ? [_viewRegistry viewForReactTag:reactTag]
|
|
415
|
+
: [_legacyViewRegistry objectForKey:reactTag];
|
|
408
416
|
}
|
|
409
417
|
|
|
410
418
|
- (void)addUIBlock:(RCTViewManagerUIBlock)block
|
|
411
419
|
{
|
|
412
420
|
[self
|
|
413
421
|
logWarning:
|
|
414
|
-
@"This method isn't implemented faithfully
|
|
422
|
+
@"This method isn't implemented faithfully. Please migrate to RCTViewRegistry if possible: @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED."
|
|
415
423
|
cmd:_cmd];
|
|
416
424
|
__weak __typeof(self) weakSelf = self;
|
|
417
425
|
RCTExecuteOnMainQueue(^{
|
|
418
426
|
__typeof(self) strongSelf = weakSelf;
|
|
419
427
|
if (strongSelf) {
|
|
420
|
-
block((RCTUIManager *)strongSelf,
|
|
428
|
+
block((RCTUIManager *)strongSelf, strongSelf->_legacyViewRegistry);
|
|
421
429
|
}
|
|
422
430
|
});
|
|
423
431
|
}
|
|
@@ -12,7 +12,7 @@ RCT_EXTERN NSString *const RCTPlatformName;
|
|
|
12
12
|
RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotification;
|
|
13
13
|
RCT_EXTERN NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey;
|
|
14
14
|
|
|
15
|
-
RCT_EXTERN NSString *const
|
|
15
|
+
RCT_EXTERN NSString *const RCTWindowFrameDidChangeNotification;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* This notification fires when the bridge initializes.
|
|
@@ -12,7 +12,7 @@ NSString *const RCTPlatformName = @"ios";
|
|
|
12
12
|
NSString *const RCTUserInterfaceStyleDidChangeNotification = @"RCTUserInterfaceStyleDidChangeNotification";
|
|
13
13
|
NSString *const RCTUserInterfaceStyleDidChangeNotificationTraitCollectionKey = @"traitCollection";
|
|
14
14
|
|
|
15
|
-
NSString *const
|
|
15
|
+
NSString *const RCTWindowFrameDidChangeNotification = @"RCTWindowFrameDidChangeNotification";
|
|
16
16
|
|
|
17
17
|
NSString *const RCTJavaScriptDidFailToLoadNotification = @"RCTJavaScriptDidFailToLoadNotification";
|
|
18
18
|
NSString *const RCTJavaScriptDidLoadNotification = @"RCTJavaScriptDidLoadNotification";
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -18,7 +18,7 @@ end
|
|
|
18
18
|
|
|
19
19
|
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
20
20
|
folly_version = '2022.05.16.00'
|
|
21
|
-
socket_rocket_version = '0.6.
|
|
21
|
+
socket_rocket_version = '0.6.1'
|
|
22
22
|
|
|
23
23
|
header_search_paths = [
|
|
24
24
|
"\"$(PODS_TARGET_SRCROOT)/React/CoreModules\"",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
#import <React/RCTBridge.h>
|
|
11
11
|
#import <React/RCTBridgeModule.h>
|
|
12
|
+
#import <React/RCTBridgeProxy.h>
|
|
12
13
|
#import <React/RCTInvalidating.h>
|
|
13
14
|
#import <React/RCTRootView.h>
|
|
14
15
|
#import <React/RCTViewManager.h>
|
|
@@ -173,6 +174,12 @@ RCT_EXTERN NSString *const RCTUIManagerWillUpdateViewsDueToContentSizeMultiplier
|
|
|
173
174
|
|
|
174
175
|
@end
|
|
175
176
|
|
|
177
|
+
@interface RCTBridgeProxy (RCTUIManager)
|
|
178
|
+
|
|
179
|
+
@property (nonatomic, readonly) RCTUIManager *uiManager;
|
|
180
|
+
|
|
181
|
+
@end
|
|
182
|
+
|
|
176
183
|
RCT_EXTERN NSMutableDictionary<NSString *, id> *RCTModuleConstantsForDestructuredComponent(
|
|
177
184
|
NSMutableDictionary<NSString *, NSDictionary *> *directEvents,
|
|
178
185
|
NSMutableDictionary<NSString *, NSDictionary *> *bubblingEvents,
|
|
@@ -534,7 +534,7 @@ static NSDictionary *deviceOrientationEventBody(UIDeviceOrientation orientation)
|
|
|
534
534
|
{
|
|
535
535
|
RCTAssertUIManagerQueue();
|
|
536
536
|
|
|
537
|
-
|
|
537
|
+
NSPointerArray *affectedShadowViews = [NSPointerArray weakObjectsPointerArray];
|
|
538
538
|
[rootShadowView layoutWithAffectedShadowViews:affectedShadowViews];
|
|
539
539
|
|
|
540
540
|
if (!affectedShadowViews.count) {
|
|
@@ -25,7 +25,7 @@ extern __attribute__((visibility("default"))) RCTDimensions RCTGetDimensions(CGF
|
|
|
25
25
|
|
|
26
26
|
// Get font size multiplier for font base size (Large) by content size category
|
|
27
27
|
extern __attribute__((visibility("default"))) CGFloat RCTGetMultiplierForContentSizeCategory(
|
|
28
|
-
UIContentSizeCategory category);
|
|
28
|
+
UIContentSizeCategory category) __deprecated;
|
|
29
29
|
|
|
30
30
|
#ifdef __cplusplus
|
|
31
31
|
}
|
|
@@ -71,7 +71,7 @@ static SEL selectorForType(NSString *type)
|
|
|
71
71
|
object:nil
|
|
72
72
|
userInfo:@{@"module" : _bridgelessViewManager}];
|
|
73
73
|
}
|
|
74
|
-
return _manager
|
|
74
|
+
return _manager ? _manager : _bridgelessViewManager;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
package/React/Views/RCTLayout.h
CHANGED
|
@@ -31,7 +31,7 @@ typedef struct CG_BOXABLE RCTLayoutMetrics RCTLayoutMetrics;
|
|
|
31
31
|
|
|
32
32
|
struct RCTLayoutContext {
|
|
33
33
|
CGPoint absolutePosition;
|
|
34
|
-
__unsafe_unretained
|
|
34
|
+
__unsafe_unretained NSPointerArray *_Nonnull affectedShadowViews;
|
|
35
35
|
__unsafe_unretained NSHashTable<NSString *> *_Nonnull other;
|
|
36
36
|
};
|
|
37
37
|
typedef struct CG_BOXABLE RCTLayoutContext RCTLayoutContext;
|
|
@@ -304,7 +304,7 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
|
|
|
304
304
|
{
|
|
305
305
|
if (!RCTLayoutMetricsEqualToLayoutMetrics(self.layoutMetrics, layoutMetrics)) {
|
|
306
306
|
self.layoutMetrics = layoutMetrics;
|
|
307
|
-
[layoutContext.affectedShadowViews
|
|
307
|
+
[layoutContext.affectedShadowViews addPointer:((__bridge void *)self)];
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
310
|
|
|
@@ -1058,7 +1058,7 @@ RCT_SET_AND_PRESERVE_OFFSET(setScrollIndicatorInsets, scrollIndicatorInsets, UIE
|
|
|
1058
1058
|
}
|
|
1059
1059
|
|
|
1060
1060
|
CGPoint offset = scrollView.contentOffset;
|
|
1061
|
-
if ([
|
|
1061
|
+
if ([self reactLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft) {
|
|
1062
1062
|
offset.x = scrollView.contentSize.width - scrollView.frame.size.width - offset.x;
|
|
1063
1063
|
}
|
|
1064
1064
|
|
|
@@ -204,7 +204,10 @@
|
|
|
204
204
|
self.center = position;
|
|
205
205
|
self.bounds = bounds;
|
|
206
206
|
|
|
207
|
-
|
|
207
|
+
id transformOrigin = objc_getAssociatedObject(self, @selector(reactTransformOrigin));
|
|
208
|
+
if (transformOrigin) {
|
|
209
|
+
updateTransform(self);
|
|
210
|
+
}
|
|
208
211
|
}
|
|
209
212
|
|
|
210
213
|
#pragma mark - Transforms
|
|
@@ -242,31 +245,35 @@
|
|
|
242
245
|
|
|
243
246
|
static void updateTransform(UIView *view)
|
|
244
247
|
{
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
248
|
+
CATransform3D transform;
|
|
249
|
+
id rawTansformOrigin = objc_getAssociatedObject(view, @selector(reactTransformOrigin));
|
|
250
|
+
if (rawTansformOrigin) {
|
|
251
|
+
CGSize size = view.bounds.size;
|
|
252
|
+
CGFloat anchorPointX = 0;
|
|
253
|
+
CGFloat anchorPointY = 0;
|
|
254
|
+
CGFloat anchorPointZ = 0;
|
|
255
|
+
RCTTransformOrigin transformOrigin;
|
|
256
|
+
[rawTansformOrigin getValue:&transformOrigin];
|
|
257
|
+
if (transformOrigin.x.unit == YGUnitPoint) {
|
|
258
|
+
anchorPointX = transformOrigin.x.value - size.width * 0.5;
|
|
259
|
+
} else if (transformOrigin.x.unit == YGUnitPercent) {
|
|
260
|
+
anchorPointX = (transformOrigin.x.value * 0.01 - 0.5) * size.width;
|
|
261
|
+
}
|
|
257
262
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
263
|
+
if (transformOrigin.y.unit == YGUnitPoint) {
|
|
264
|
+
anchorPointY = transformOrigin.y.value - size.height * 0.5;
|
|
265
|
+
} else if (transformOrigin.y.unit == YGUnitPercent) {
|
|
266
|
+
anchorPointY = (transformOrigin.y.value * 0.01 - 0.5) * size.height;
|
|
267
|
+
}
|
|
268
|
+
anchorPointZ = transformOrigin.z;
|
|
269
|
+
transform = CATransform3DConcat(
|
|
270
|
+
view.reactTransform, CATransform3DMakeTranslation(anchorPointX, anchorPointY, anchorPointZ));
|
|
271
|
+
transform =
|
|
272
|
+
CATransform3DConcat(CATransform3DMakeTranslation(-anchorPointX, -anchorPointY, -anchorPointZ), transform);
|
|
273
|
+
} else {
|
|
274
|
+
transform = view.reactTransform;
|
|
262
275
|
}
|
|
263
276
|
|
|
264
|
-
anchorPointZ = transformOrigin.z;
|
|
265
|
-
|
|
266
|
-
CATransform3D transform = CATransform3DMakeTranslation(anchorPointX, anchorPointY, anchorPointZ);
|
|
267
|
-
transform = CATransform3DConcat(view.reactTransform, transform);
|
|
268
|
-
transform = CATransform3DTranslate(transform, -anchorPointX, -anchorPointY, -anchorPointZ);
|
|
269
|
-
|
|
270
277
|
view.layer.transform = transform;
|
|
271
278
|
// Enable edge antialiasing in rotation, skew, or perspective transforms
|
|
272
279
|
view.layer.allowsEdgeAntialiasing = transform.m12 != 0.0f || transform.m21 != 0.0f || transform.m34 != 0.0f;
|
package/React-Core.podspec
CHANGED
|
@@ -18,7 +18,7 @@ end
|
|
|
18
18
|
|
|
19
19
|
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_CFG_NO_COROUTINES=1 -Wno-comma -Wno-shorten-64-to-32'
|
|
20
20
|
folly_version = '2022.05.16.00'
|
|
21
|
-
socket_rocket_version = '0.6.
|
|
21
|
+
socket_rocket_version = '0.6.1'
|
|
22
22
|
boost_compiler_flags = '-Wno-documentation'
|
|
23
23
|
|
|
24
24
|
use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
|
|
@@ -19,7 +19,6 @@ import androidx.annotation.Nullable;
|
|
|
19
19
|
import com.facebook.infer.annotation.Assertions;
|
|
20
20
|
import com.facebook.react.bridge.Callback;
|
|
21
21
|
import com.facebook.react.config.ReactFeatureFlags;
|
|
22
|
-
import com.facebook.react.interfaces.ReactHost;
|
|
23
22
|
import com.facebook.react.modules.core.PermissionListener;
|
|
24
23
|
|
|
25
24
|
/**
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
package com.facebook.react
|
|
9
9
|
|
|
10
10
|
import com.facebook.react.common.annotations.UnstableReactNativeAPI
|
|
11
|
-
import com.facebook.react.interfaces.ReactHost
|
|
12
11
|
|
|
13
12
|
@OptIn(UnstableReactNativeAPI::class)
|
|
14
13
|
/** Interface that represents an instance of a React Native application */
|
|
@@ -16,7 +16,6 @@ import androidx.annotation.Nullable;
|
|
|
16
16
|
import com.facebook.infer.annotation.Assertions;
|
|
17
17
|
import com.facebook.react.config.ReactFeatureFlags;
|
|
18
18
|
import com.facebook.react.devsupport.DoubleTapReloadRecognizer;
|
|
19
|
-
import com.facebook.react.interfaces.ReactHost;
|
|
20
19
|
import com.facebook.react.interfaces.fabric.ReactSurface;
|
|
21
20
|
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
|
|
22
21
|
|
package/ReactAndroid/src/main/java/com/facebook/react/{interfaces/ReactHost.kt → ReactHost.kt}
RENAMED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
package com.facebook.react
|
|
8
|
+
package com.facebook.react
|
|
9
9
|
|
|
10
10
|
import android.app.Activity
|
|
11
11
|
import android.content.Context
|
|
@@ -13,8 +13,8 @@ import android.os.Bundle
|
|
|
13
13
|
import com.facebook.react.bridge.ReactContext
|
|
14
14
|
import com.facebook.react.bridge.queue.ReactQueueConfiguration
|
|
15
15
|
import com.facebook.react.common.LifecycleState
|
|
16
|
-
import com.facebook.react.common.annotations.UnstableReactNativeAPI
|
|
17
16
|
import com.facebook.react.devsupport.interfaces.DevSupportManager
|
|
17
|
+
import com.facebook.react.interfaces.TaskInterface
|
|
18
18
|
import com.facebook.react.interfaces.fabric.ReactSurface
|
|
19
19
|
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
|
|
20
20
|
|
|
@@ -25,7 +25,6 @@ import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler
|
|
|
25
25
|
*
|
|
26
26
|
* The implementation of this interface should be Thread Safe
|
|
27
27
|
*/
|
|
28
|
-
@UnstableReactNativeAPI
|
|
29
28
|
interface ReactHost {
|
|
30
29
|
|
|
31
30
|
/** The current [LifecycleState] for React Host */
|
|
@@ -71,7 +71,7 @@ public class ReactContext extends ContextWrapper {
|
|
|
71
71
|
private @Nullable JSExceptionHandler mExceptionHandlerWrapper;
|
|
72
72
|
private @Nullable WeakReference<Activity> mCurrentActivity;
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
protected @Nullable InteropModuleRegistry mInteropModuleRegistry;
|
|
75
75
|
private boolean mIsInitialized = false;
|
|
76
76
|
|
|
77
77
|
public ReactContext(Context base) {
|
package/ReactAndroid/src/main/java/com/facebook/react/common/annotations/UnstableReactNativeAPI.kt
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
package com.facebook.react.common.annotations
|
|
9
9
|
|
|
10
10
|
@Retention(AnnotationRetention.RUNTIME)
|
|
11
|
-
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
|
|
11
|
+
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
|
|
12
12
|
@RequiresOptIn(
|
|
13
13
|
level = RequiresOptIn.Level.ERROR,
|
|
14
14
|
message = "This API is experimental and is likely to change or to be removed in the future")
|
|
@@ -8,20 +8,41 @@
|
|
|
8
8
|
package com.facebook.react.defaults
|
|
9
9
|
|
|
10
10
|
import android.content.Context
|
|
11
|
+
import com.facebook.react.JSEngineResolutionAlgorithm
|
|
12
|
+
import com.facebook.react.ReactHost
|
|
13
|
+
import com.facebook.react.ReactNativeHost
|
|
11
14
|
import com.facebook.react.ReactPackage
|
|
12
15
|
import com.facebook.react.bridge.JSBundleLoader
|
|
13
16
|
import com.facebook.react.common.annotations.UnstableReactNativeAPI
|
|
14
17
|
import com.facebook.react.fabric.ComponentFactory
|
|
15
|
-
import com.facebook.react.interfaces.ReactHost
|
|
16
18
|
import com.facebook.react.interfaces.exceptionmanager.ReactJsExceptionHandler
|
|
17
19
|
import com.facebook.react.runtime.JSCInstance
|
|
18
20
|
import com.facebook.react.runtime.ReactHostImpl
|
|
19
21
|
import com.facebook.react.runtime.hermes.HermesInstance
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
/**
|
|
24
|
+
* A utility class that allows you to simplify the setup of a [ReactHost] for new apps in Open
|
|
25
|
+
* Source.
|
|
26
|
+
*
|
|
27
|
+
* [ReactHost] is an interface responsible of handling the lifecycle of a React Native app when
|
|
28
|
+
* running in bridgeless mode.
|
|
29
|
+
*/
|
|
22
30
|
object DefaultReactHost {
|
|
23
31
|
private var reactHost: ReactHost? = null
|
|
24
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Util function to create a default [ReactHost] to be used in your application. This method is
|
|
35
|
+
* used by the New App template.
|
|
36
|
+
*
|
|
37
|
+
* @param context the Android [Context] to use for creating the [ReactHost]
|
|
38
|
+
* @param packageList the list of [ReactPackage]s to use for creating the [ReactHost]
|
|
39
|
+
* @param jsMainModulePath the path to your app's main module on Metro. Usually `index` or
|
|
40
|
+
* `index.<platform>`
|
|
41
|
+
* @param jsBundleAssetPath the path to the JS bundle relative to the assets directory. Will be
|
|
42
|
+
* composed in a `asset://...` URL
|
|
43
|
+
* @param isHermesEnabled whether to use Hermes as the JS engine, default to true.
|
|
44
|
+
*/
|
|
45
|
+
@OptIn(UnstableReactNativeAPI::class)
|
|
25
46
|
@JvmStatic
|
|
26
47
|
fun getDefaultReactHost(
|
|
27
48
|
context: Context,
|
|
@@ -47,13 +68,42 @@ object DefaultReactHost {
|
|
|
47
68
|
// TODO: T164788699 find alternative of accessing ReactHostImpl for initialising reactHost
|
|
48
69
|
reactHost =
|
|
49
70
|
ReactHostImpl(
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
71
|
+
context,
|
|
72
|
+
defaultReactHostDelegate,
|
|
73
|
+
componentFactory,
|
|
74
|
+
true,
|
|
75
|
+
reactJsExceptionHandler,
|
|
76
|
+
true)
|
|
77
|
+
.apply {
|
|
78
|
+
jsEngineResolutionAlgorithm =
|
|
79
|
+
if (isHermesEnabled) {
|
|
80
|
+
JSEngineResolutionAlgorithm.HERMES
|
|
81
|
+
} else {
|
|
82
|
+
JSEngineResolutionAlgorithm.JSC
|
|
83
|
+
}
|
|
84
|
+
}
|
|
56
85
|
}
|
|
57
86
|
return reactHost as ReactHost
|
|
58
87
|
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Util function to create a default [ReactHost] to be used in your application. This method is
|
|
91
|
+
* used by the New App template.
|
|
92
|
+
*
|
|
93
|
+
* This method takes in input a [ReactNativeHost] (bridge-mode) and uses its configuration to
|
|
94
|
+
* create an equivalent [ReactHost] (bridgeless-mode).
|
|
95
|
+
*
|
|
96
|
+
* @param context the Android [Context] to use for creating the [ReactHost]
|
|
97
|
+
* @param reactNativeHost the [ReactNativeHost] to use for creating the [ReactHost]
|
|
98
|
+
*/
|
|
99
|
+
@JvmStatic
|
|
100
|
+
fun getDefaultReactHost(
|
|
101
|
+
context: Context,
|
|
102
|
+
reactNativeHost: ReactNativeHost,
|
|
103
|
+
): ReactHost {
|
|
104
|
+
require(reactNativeHost is DefaultReactNativeHost) {
|
|
105
|
+
"You can call getDefaultReactHost only with instances of DefaultReactNativeHost"
|
|
106
|
+
}
|
|
107
|
+
return reactNativeHost.toReactHost(context)
|
|
108
|
+
}
|
|
59
109
|
}
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
package com.facebook.react.defaults
|
|
9
9
|
|
|
10
10
|
import android.app.Application
|
|
11
|
+
import android.content.Context
|
|
11
12
|
import com.facebook.react.JSEngineResolutionAlgorithm
|
|
13
|
+
import com.facebook.react.ReactHost
|
|
12
14
|
import com.facebook.react.ReactNativeHost
|
|
13
15
|
import com.facebook.react.ReactPackageTurboModuleManagerDelegate
|
|
14
16
|
import com.facebook.react.bridge.JSIModulePackage
|
|
@@ -68,4 +70,18 @@ protected constructor(
|
|
|
68
70
|
*/
|
|
69
71
|
protected open val isHermesEnabled: Boolean?
|
|
70
72
|
get() = null
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Converts this [ReactNativeHost] (bridge-mode) to a [ReactHost] (bridgeless-mode).
|
|
76
|
+
*
|
|
77
|
+
* @param context the Android [Context] to use for creating the [ReactHost]
|
|
78
|
+
*/
|
|
79
|
+
fun toReactHost(context: Context): ReactHost =
|
|
80
|
+
DefaultReactHost.getDefaultReactHost(
|
|
81
|
+
context,
|
|
82
|
+
packages,
|
|
83
|
+
jsMainModuleName,
|
|
84
|
+
bundleAssetName ?: "index",
|
|
85
|
+
isHermesEnabled ?: true,
|
|
86
|
+
)
|
|
71
87
|
}
|
package/ReactAndroid/src/main/java/com/facebook/react/modules/devloading/DevLoadingModule.java
CHANGED
|
@@ -46,7 +46,9 @@ public class DevLoadingModule extends NativeDevLoadingViewSpec {
|
|
|
46
46
|
new Runnable() {
|
|
47
47
|
@Override
|
|
48
48
|
public void run() {
|
|
49
|
-
mDevLoadingViewManager
|
|
49
|
+
if (mDevLoadingViewManager != null) {
|
|
50
|
+
mDevLoadingViewManager.showMessage(message);
|
|
51
|
+
}
|
|
50
52
|
}
|
|
51
53
|
});
|
|
52
54
|
}
|