react-native 0.74.0-rc.3 → 0.74.0-rc.4
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/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Core/registerCallableModule.d.ts +16 -0
- package/React/Base/RCTBridgeProxy+Cxx.h +20 -0
- package/React/Base/RCTBridgeProxy.h +2 -0
- package/React/Base/RCTBridgeProxy.mm +15 -0
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.h +7 -0
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +17 -2
- package/ReactAndroid/api/ReactAndroid.api +42 -0
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/ReactDelegate.java +21 -14
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstance.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java +2 -1
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/JSIModuleRegistry.java +2 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/NativeArrayInterface.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessCatalystInstance.kt +201 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/BridgelessReactContext.java +4 -6
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +15 -0
- package/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactInstance.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +2 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/renderer/imagemanager/platform/ios/react/renderer/imagemanager/RCTImagePrimitivesConversions.h +2 -2
- package/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +8 -6
- package/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp +64 -40
- package/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +19 -20
- package/package.json +11 -11
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/package.json +5 -5
- package/types/index.d.ts +1 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
type Module = Object;
|
|
11
|
+
type RegisterCallableModule = (
|
|
12
|
+
name: string,
|
|
13
|
+
moduleOrFactory: Module | (() => Module),
|
|
14
|
+
) => void;
|
|
15
|
+
|
|
16
|
+
export const registerCallableModule: RegisterCallableModule;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
#ifdef __cplusplus
|
|
9
|
+
#import <ReactCommon/CallInvoker.h>
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
#import "RCTBridgeProxy.h"
|
|
13
|
+
|
|
14
|
+
@interface RCTBridgeProxy (Cxx)
|
|
15
|
+
|
|
16
|
+
#ifdef __cplusplus
|
|
17
|
+
@property (nonatomic, readwrite) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
|
|
18
|
+
#endif
|
|
19
|
+
|
|
20
|
+
@end
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
@class RCTViewRegistry;
|
|
16
16
|
|
|
17
17
|
@interface RCTBridgeProxy : NSProxy
|
|
18
|
+
|
|
18
19
|
- (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
|
|
19
20
|
moduleRegistry:(RCTModuleRegistry *)moduleRegistry
|
|
20
21
|
bundleManager:(RCTBundleManager *)bundleManager
|
|
@@ -34,4 +35,5 @@
|
|
|
34
35
|
*/
|
|
35
36
|
- (id)moduleForClass:(Class)moduleClass;
|
|
36
37
|
- (id)moduleForName:(NSString *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyLoad;
|
|
38
|
+
|
|
37
39
|
@end
|
|
@@ -6,10 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
#import "RCTBridgeProxy.h"
|
|
9
|
+
#import "RCTBridgeProxy+Cxx.h"
|
|
10
|
+
|
|
9
11
|
#import <React/RCTBridge+Private.h>
|
|
10
12
|
#import <React/RCTBridge.h>
|
|
11
13
|
#import <React/RCTLog.h>
|
|
12
14
|
#import <React/RCTUIManager.h>
|
|
15
|
+
#import <ReactCommon/CallInvoker.h>
|
|
13
16
|
#import <jsi/jsi.h>
|
|
14
17
|
|
|
15
18
|
using namespace facebook;
|
|
@@ -21,6 +24,12 @@ using namespace facebook;
|
|
|
21
24
|
- (void)forwardInvocation:(NSInvocation *)invocation;
|
|
22
25
|
@end
|
|
23
26
|
|
|
27
|
+
@interface RCTBridgeProxy ()
|
|
28
|
+
|
|
29
|
+
@property (nonatomic, readwrite) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
|
|
30
|
+
|
|
31
|
+
@end
|
|
32
|
+
|
|
24
33
|
@implementation RCTBridgeProxy {
|
|
25
34
|
RCTUIManagerProxy *_uiManagerProxy;
|
|
26
35
|
RCTModuleRegistry *_moduleRegistry;
|
|
@@ -84,6 +93,12 @@ using namespace facebook;
|
|
|
84
93
|
return _runtime;
|
|
85
94
|
}
|
|
86
95
|
|
|
96
|
+
- (std::shared_ptr<facebook::react::CallInvoker>)jsCallInvoker
|
|
97
|
+
{
|
|
98
|
+
[self logWarning:@"Please migrate to RuntimeExecutor" cmd:_cmd];
|
|
99
|
+
return _jsCallInvoker;
|
|
100
|
+
}
|
|
101
|
+
|
|
87
102
|
/**
|
|
88
103
|
* RCTModuleRegistry
|
|
89
104
|
*/
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -56,6 +56,13 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
56
56
|
*/
|
|
57
57
|
@property (nonatomic, copy, nullable) RCTSurfaceHostingViewActivityIndicatorViewFactory activityIndicatorViewFactory;
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* When set to `YES`, the activity indicator is not automatically hidden when the Surface stage changes.
|
|
61
|
+
* In this scenario, users should invoke `hideActivityIndicator` to remove it.
|
|
62
|
+
*
|
|
63
|
+
* @param disabled: if `YES`, the auto-hide is disabled. Otherwise the loading view will be hidden automatically
|
|
64
|
+
*/
|
|
65
|
+
- (void)disableActivityIndicatorAutoHide:(BOOL)disabled;
|
|
59
66
|
@end
|
|
60
67
|
|
|
61
68
|
NS_ASSUME_NONNULL_END
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
UIView *_Nullable _activityIndicatorView;
|
|
25
25
|
UIView *_Nullable _surfaceView;
|
|
26
26
|
RCTSurfaceStage _stage;
|
|
27
|
+
BOOL _autoHideDisabled;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
RCT_NOT_IMPLEMENTED(-(instancetype)init)
|
|
@@ -36,6 +37,7 @@ RCT_NOT_IMPLEMENTED(-(nullable instancetype)initWithCoder : (NSCoder *)coder)
|
|
|
36
37
|
if (self = [super initWithFrame:CGRectZero]) {
|
|
37
38
|
_surface = surface;
|
|
38
39
|
_sizeMeasureMode = sizeMeasureMode;
|
|
40
|
+
_autoHideDisabled = NO;
|
|
39
41
|
|
|
40
42
|
_surface.delegate = self;
|
|
41
43
|
_stage = surface.stage;
|
|
@@ -124,6 +126,10 @@ RCT_NOT_IMPLEMENTED(-(nullable instancetype)initWithCoder : (NSCoder *)coder)
|
|
|
124
126
|
_sizeMeasureMode = sizeMeasureMode;
|
|
125
127
|
[self _invalidateLayout];
|
|
126
128
|
}
|
|
129
|
+
- (void)disableActivityIndicatorAutoHide:(BOOL)disabled
|
|
130
|
+
{
|
|
131
|
+
_autoHideDisabled = disabled;
|
|
132
|
+
}
|
|
127
133
|
|
|
128
134
|
#pragma mark - isActivityIndicatorViewVisible
|
|
129
135
|
|
|
@@ -162,7 +168,16 @@ RCT_NOT_IMPLEMENTED(-(nullable instancetype)initWithCoder : (NSCoder *)coder)
|
|
|
162
168
|
_surfaceView = _surface.view;
|
|
163
169
|
_surfaceView.frame = self.bounds;
|
|
164
170
|
_surfaceView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
165
|
-
|
|
171
|
+
if (_activityIndicatorView && _autoHideDisabled) {
|
|
172
|
+
// The activity indicator is still showing and the surface is set to
|
|
173
|
+
// prevent the auto hide. This means that the application will take care of
|
|
174
|
+
// hiding it when it's ready.
|
|
175
|
+
// Let's add the surfaceView below the activity indicator so it's ready once
|
|
176
|
+
// the activity indicator is hidden.
|
|
177
|
+
[self insertSubview:_surfaceView belowSubview:_activityIndicatorView];
|
|
178
|
+
} else {
|
|
179
|
+
[self addSubview:_surfaceView];
|
|
180
|
+
}
|
|
166
181
|
} else {
|
|
167
182
|
[_surfaceView removeFromSuperview];
|
|
168
183
|
_surfaceView = nil;
|
|
@@ -204,7 +219,7 @@ RCT_NOT_IMPLEMENTED(-(nullable instancetype)initWithCoder : (NSCoder *)coder)
|
|
|
204
219
|
- (void)_updateViews
|
|
205
220
|
{
|
|
206
221
|
self.isSurfaceViewVisible = RCTSurfaceStageIsRunning(_stage);
|
|
207
|
-
self.isActivityIndicatorViewVisible = RCTSurfaceStageIsPreparing(_stage);
|
|
222
|
+
self.isActivityIndicatorViewVisible = _autoHideDisabled || RCTSurfaceStageIsPreparing(_stage);
|
|
208
223
|
}
|
|
209
224
|
|
|
210
225
|
- (void)didMoveToWindow
|
|
@@ -950,6 +950,10 @@ public abstract class com/facebook/react/bridge/NativeArray : com/facebook/react
|
|
|
950
950
|
public fun toString ()Ljava/lang/String;
|
|
951
951
|
}
|
|
952
952
|
|
|
953
|
+
public abstract interface class com/facebook/react/bridge/NativeArrayInterface {
|
|
954
|
+
public abstract fun toString ()Ljava/lang/String;
|
|
955
|
+
}
|
|
956
|
+
|
|
953
957
|
public abstract class com/facebook/react/bridge/NativeMap {
|
|
954
958
|
public fun <init> (Lcom/facebook/jni/HybridData;)V
|
|
955
959
|
public fun toString ()Ljava/lang/String;
|
|
@@ -3576,6 +3580,43 @@ public abstract class com/facebook/react/runtime/BindingsInstaller {
|
|
|
3576
3580
|
public fun <init> (Lcom/facebook/jni/HybridData;)V
|
|
3577
3581
|
}
|
|
3578
3582
|
|
|
3583
|
+
public final class com/facebook/react/runtime/BridgelessCatalystInstance : com/facebook/react/bridge/CatalystInstance {
|
|
3584
|
+
public fun <init> (Lcom/facebook/react/runtime/ReactHostImpl;)V
|
|
3585
|
+
public fun addBridgeIdleDebugListener (Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener;)V
|
|
3586
|
+
public fun addJSIModules (Ljava/util/List;)V
|
|
3587
|
+
public fun callFunction (Ljava/lang/String;Ljava/lang/String;Lcom/facebook/react/bridge/NativeArray;)V
|
|
3588
|
+
public fun destroy ()V
|
|
3589
|
+
public fun extendNativeModules (Lcom/facebook/react/bridge/NativeModuleRegistry;)V
|
|
3590
|
+
public fun getFabricUIManager ()Lcom/facebook/react/bridge/UIManager;
|
|
3591
|
+
public fun getJSCallInvokerHolder ()Lcom/facebook/react/turbomodule/core/interfaces/CallInvokerHolder;
|
|
3592
|
+
public fun getJSIModule (Lcom/facebook/react/bridge/JSIModuleType;)Lcom/facebook/react/bridge/JSIModule;
|
|
3593
|
+
public fun getJSModule (Ljava/lang/Class;)Lcom/facebook/react/bridge/JavaScriptModule;
|
|
3594
|
+
public fun getJavaScriptContextHolder ()Lcom/facebook/react/bridge/JavaScriptContextHolder;
|
|
3595
|
+
public fun getNativeMethodCallInvokerHolder ()Lcom/facebook/react/turbomodule/core/interfaces/NativeMethodCallInvokerHolder;
|
|
3596
|
+
public fun getNativeModule (Ljava/lang/Class;)Lcom/facebook/react/bridge/NativeModule;
|
|
3597
|
+
public fun getNativeModule (Ljava/lang/String;)Lcom/facebook/react/bridge/NativeModule;
|
|
3598
|
+
public fun getNativeModules ()Ljava/util/Collection;
|
|
3599
|
+
public fun getReactQueueConfiguration ()Lcom/facebook/react/bridge/queue/ReactQueueConfiguration;
|
|
3600
|
+
public fun getRuntimeExecutor ()Lcom/facebook/react/bridge/RuntimeExecutor;
|
|
3601
|
+
public fun getRuntimeScheduler ()Lcom/facebook/react/bridge/RuntimeScheduler;
|
|
3602
|
+
public fun getSourceURL ()Ljava/lang/String;
|
|
3603
|
+
public fun handleMemoryPressure (I)V
|
|
3604
|
+
public fun hasNativeModule (Ljava/lang/Class;)Z
|
|
3605
|
+
public fun hasRunJSBundle ()Z
|
|
3606
|
+
public fun invokeCallback (ILcom/facebook/react/bridge/NativeArrayInterface;)V
|
|
3607
|
+
public fun isDestroyed ()Z
|
|
3608
|
+
public fun loadScriptFromAssets (Landroid/content/res/AssetManager;Ljava/lang/String;Z)V
|
|
3609
|
+
public fun loadScriptFromFile (Ljava/lang/String;Ljava/lang/String;Z)V
|
|
3610
|
+
public fun loadSplitBundleFromFile (Ljava/lang/String;Ljava/lang/String;)V
|
|
3611
|
+
public fun registerSegment (ILjava/lang/String;)V
|
|
3612
|
+
public fun removeBridgeIdleDebugListener (Lcom/facebook/react/bridge/NotThreadSafeBridgeIdleDebugListener;)V
|
|
3613
|
+
public fun runJSBundle ()V
|
|
3614
|
+
public fun setFabricUIManager (Lcom/facebook/react/bridge/UIManager;)V
|
|
3615
|
+
public fun setSourceURLs (Ljava/lang/String;Ljava/lang/String;)V
|
|
3616
|
+
public fun setTurboModuleManager (Lcom/facebook/react/bridge/JSIModule;)V
|
|
3617
|
+
public fun setTurboModuleRegistry (Lcom/facebook/react/internal/turbomodule/core/interfaces/TurboModuleRegistry;)V
|
|
3618
|
+
}
|
|
3619
|
+
|
|
3579
3620
|
public class com/facebook/react/runtime/CoreReactPackage$$ReactModuleInfoProvider : com/facebook/react/module/model/ReactModuleInfoProvider {
|
|
3580
3621
|
public fun <init> ()V
|
|
3581
3622
|
public fun getReactModuleInfos ()Ljava/util/Map;
|
|
@@ -7044,6 +7085,7 @@ public class com/facebook/react/views/text/TextAttributeProps : com/facebook/rea
|
|
|
7044
7085
|
public static final field TA_KEY_TEXT_SHADOW_OFFSET_DY S
|
|
7045
7086
|
public static final field TA_KEY_TEXT_SHADOW_RADIUS S
|
|
7046
7087
|
public static final field TA_KEY_TEXT_TRANSFORM S
|
|
7088
|
+
public static final field UNSET I
|
|
7047
7089
|
protected field mAccessibilityRole Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$AccessibilityRole;
|
|
7048
7090
|
protected field mAllowFontScaling Z
|
|
7049
7091
|
protected field mBackgroundColor I
|
|
@@ -16,6 +16,7 @@ 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.devsupport.interfaces.DevSupportManager;
|
|
19
20
|
import com.facebook.react.interfaces.fabric.ReactSurface;
|
|
20
21
|
import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler;
|
|
21
22
|
|
|
@@ -195,22 +196,28 @@ public class ReactDelegate {
|
|
|
195
196
|
* application.
|
|
196
197
|
*/
|
|
197
198
|
public boolean shouldShowDevMenuOrReload(int keyCode, KeyEvent event) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
DevSupportManager devSupportManager = null;
|
|
200
|
+
if (ReactFeatureFlags.enableBridgelessArchitecture
|
|
201
|
+
&& mReactHost != null
|
|
202
|
+
&& mReactHost.getDevSupportManager() != null) {
|
|
203
|
+
devSupportManager = mReactHost.getDevSupportManager();
|
|
201
204
|
} else if (getReactNativeHost().hasInstance()
|
|
202
205
|
&& getReactNativeHost().getUseDeveloperSupport()) {
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
206
|
+
devSupportManager = getReactNativeHost().getReactInstanceManager().getDevSupportManager();
|
|
207
|
+
} else {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
if (keyCode == KeyEvent.KEYCODE_MENU) {
|
|
212
|
+
devSupportManager.showDevOptionsDialog();
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
boolean didDoubleTapR =
|
|
216
|
+
Assertions.assertNotNull(mDoubleTapReloadRecognizer)
|
|
217
|
+
.didDoubleTapR(keyCode, mActivity.getCurrentFocus());
|
|
218
|
+
if (didDoubleTapR) {
|
|
219
|
+
devSupportManager.handleReloadJS();
|
|
220
|
+
return true;
|
|
214
221
|
}
|
|
215
222
|
return false;
|
|
216
223
|
}
|
|
@@ -120,7 +120,7 @@ public interface CatalystInstance
|
|
|
120
120
|
RuntimeScheduler getRuntimeScheduler();
|
|
121
121
|
|
|
122
122
|
@Deprecated
|
|
123
|
-
void addJSIModules(List<JSIModuleSpec
|
|
123
|
+
<T extends JSIModule> void addJSIModules(List<JSIModuleSpec<T>> jsiModules);
|
|
124
124
|
|
|
125
125
|
/**
|
|
126
126
|
* Returns a hybrid object that contains a pointer to a JS CallInvoker, which is used to schedule
|
|
@@ -537,7 +537,8 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
|
|
537
537
|
public native RuntimeScheduler getRuntimeScheduler();
|
|
538
538
|
|
|
539
539
|
@Override
|
|
540
|
-
|
|
540
|
+
@Deprecated
|
|
541
|
+
public <T extends JSIModule> void addJSIModules(List<JSIModuleSpec<T>> jsiModules) {
|
|
541
542
|
mJSIModuleRegistry.registerModules(jsiModules);
|
|
542
543
|
}
|
|
543
544
|
|
|
@@ -26,8 +26,8 @@ class JSIModuleRegistry {
|
|
|
26
26
|
return Assertions.assertNotNull(jsiModuleHolder.getJSIModule());
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
public void registerModules(List<JSIModuleSpec
|
|
30
|
-
for (JSIModuleSpec spec : jsiModules) {
|
|
29
|
+
public <T extends JSIModule> void registerModules(List<JSIModuleSpec<T>> jsiModules) {
|
|
30
|
+
for (JSIModuleSpec<T> spec : jsiModules) {
|
|
31
31
|
mModules.put(spec.getJSIModuleType(), new JSIModuleHolder(spec));
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
package com.facebook.react.runtime
|
|
9
|
+
|
|
10
|
+
import android.content.res.AssetManager
|
|
11
|
+
import com.facebook.proguard.annotations.DoNotStrip
|
|
12
|
+
import com.facebook.react.bridge.CatalystInstance
|
|
13
|
+
import com.facebook.react.bridge.JSIModule
|
|
14
|
+
import com.facebook.react.bridge.JSIModuleSpec
|
|
15
|
+
import com.facebook.react.bridge.JSIModuleType
|
|
16
|
+
import com.facebook.react.bridge.JavaScriptContextHolder
|
|
17
|
+
import com.facebook.react.bridge.JavaScriptModule
|
|
18
|
+
import com.facebook.react.bridge.NativeArray
|
|
19
|
+
import com.facebook.react.bridge.NativeArrayInterface
|
|
20
|
+
import com.facebook.react.bridge.NativeModule
|
|
21
|
+
import com.facebook.react.bridge.NativeModuleRegistry
|
|
22
|
+
import com.facebook.react.bridge.NotThreadSafeBridgeIdleDebugListener
|
|
23
|
+
import com.facebook.react.bridge.RuntimeExecutor
|
|
24
|
+
import com.facebook.react.bridge.RuntimeScheduler
|
|
25
|
+
import com.facebook.react.bridge.UIManager
|
|
26
|
+
import com.facebook.react.bridge.queue.ReactQueueConfiguration
|
|
27
|
+
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
|
|
28
|
+
import com.facebook.react.common.annotations.VisibleForTesting
|
|
29
|
+
import com.facebook.react.internal.turbomodule.core.interfaces.TurboModuleRegistry
|
|
30
|
+
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
|
|
31
|
+
import com.facebook.react.turbomodule.core.interfaces.NativeMethodCallInvokerHolder
|
|
32
|
+
|
|
33
|
+
@DoNotStrip
|
|
34
|
+
@DeprecatedInNewArchitecture
|
|
35
|
+
public class BridgelessCatalystInstance(private val reactHost: ReactHostImpl) : CatalystInstance {
|
|
36
|
+
|
|
37
|
+
override fun handleMemoryPressure(level: Int) {
|
|
38
|
+
throw UnsupportedOperationException("Unimplemented method 'handleMemoryPressure'")
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
override fun loadScriptFromAssets(
|
|
42
|
+
assetManager: AssetManager,
|
|
43
|
+
assetURL: String,
|
|
44
|
+
loadSynchronously: Boolean
|
|
45
|
+
) {
|
|
46
|
+
throw UnsupportedOperationException("Unimplemented method 'loadScriptFromAssets'")
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
override fun loadScriptFromFile(fileName: String, sourceURL: String, loadSynchronously: Boolean) {
|
|
50
|
+
throw UnsupportedOperationException("Unimplemented method 'loadScriptFromFile'")
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
override fun loadSplitBundleFromFile(fileName: String, sourceURL: String) {
|
|
54
|
+
throw UnsupportedOperationException("Unimplemented method 'loadSplitBundleFromFile'")
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
override fun setSourceURLs(deviceURL: String, remoteURL: String) {
|
|
58
|
+
throw UnsupportedOperationException("Unimplemented method 'setSourceURLs'")
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
override fun runJSBundle() {
|
|
62
|
+
throw UnsupportedOperationException("Unimplemented method 'runJSBundle'")
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
override fun hasRunJSBundle(): Boolean {
|
|
66
|
+
throw UnsupportedOperationException("Unimplemented method 'hasRunJSBundle'")
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
override fun getSourceURL(): String? {
|
|
70
|
+
throw UnsupportedOperationException("Unimplemented method 'getSourceURL'")
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@DoNotStrip
|
|
74
|
+
override fun invokeCallback(callbackID: Int, arguments: NativeArrayInterface) {
|
|
75
|
+
throw UnsupportedOperationException("Unimplemented method 'invokeCallback'")
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
override fun callFunction(module: String, method: String, arguments: NativeArray) {
|
|
79
|
+
throw UnsupportedOperationException("Unimplemented method 'callFunction'")
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
override fun destroy() {
|
|
83
|
+
throw UnsupportedOperationException("Unimplemented method 'destroy'")
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
override fun isDestroyed(): Boolean {
|
|
87
|
+
throw UnsupportedOperationException("Unimplemented method 'isDestroyed'")
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@VisibleForTesting
|
|
91
|
+
override fun initialize() {
|
|
92
|
+
throw UnsupportedOperationException("Unimplemented method 'initialize'")
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
override fun getReactQueueConfiguration(): ReactQueueConfiguration {
|
|
96
|
+
throw UnsupportedOperationException("Unimplemented method 'getReactQueueConfiguration'")
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
override fun <T : JavaScriptModule> getJSModule(jsInterface: Class<T>): T {
|
|
100
|
+
throw UnsupportedOperationException("Unimplemented method 'getJSModule'")
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
override fun <T : NativeModule> hasNativeModule(nativeModuleInterface: Class<T>): Boolean {
|
|
104
|
+
throw UnsupportedOperationException("Unimplemented method 'hasNativeModule'")
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
override fun <T : NativeModule> getNativeModule(nativeModuleInterface: Class<T>): T? {
|
|
108
|
+
throw UnsupportedOperationException("Unimplemented method 'getNativeModule'")
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
override fun getNativeModule(moduleName: String): NativeModule? {
|
|
112
|
+
throw UnsupportedOperationException("Unimplemented method 'getNativeModule'")
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
@Deprecated(
|
|
116
|
+
message =
|
|
117
|
+
"getJSIModule(JSIModuleType moduleType) is deprecated and will be deleted in the future. Please use ReactInstanceEventListener to subscribe for react instance events instead.")
|
|
118
|
+
override fun getJSIModule(moduleType: JSIModuleType): JSIModule {
|
|
119
|
+
throw UnsupportedOperationException("Unimplemented method 'getJSIModule'")
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
override fun getNativeModules(): Collection<NativeModule> {
|
|
123
|
+
throw UnsupportedOperationException("Unimplemented method 'getNativeModules'")
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
override fun extendNativeModules(modules: NativeModuleRegistry) {
|
|
127
|
+
throw UnsupportedOperationException("Unimplemented method 'extendNativeModules'")
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
override fun addBridgeIdleDebugListener(listener: NotThreadSafeBridgeIdleDebugListener) {
|
|
131
|
+
throw UnsupportedOperationException("Unimplemented method 'addBridgeIdleDebugListener'")
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
override fun removeBridgeIdleDebugListener(listener: NotThreadSafeBridgeIdleDebugListener) {
|
|
135
|
+
throw UnsupportedOperationException("Unimplemented method 'removeBridgeIdleDebugListener'")
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
override fun registerSegment(segmentId: Int, path: String) {
|
|
139
|
+
throw UnsupportedOperationException("Unimplemented method 'registerSegment'")
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
@VisibleForTesting
|
|
143
|
+
override fun setGlobalVariable(propName: String, jsonValue: String) {
|
|
144
|
+
throw UnsupportedOperationException("Unimplemented method 'setGlobalVariable'")
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@Deprecated(message = "This API is unsupported in the New Architecture.")
|
|
148
|
+
override fun getJavaScriptContextHolder(): JavaScriptContextHolder {
|
|
149
|
+
throw UnsupportedOperationException("Unimplemented method 'getJavaScriptContextHolder'")
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
override fun getRuntimeExecutor(): RuntimeExecutor {
|
|
153
|
+
throw UnsupportedOperationException("Unimplemented method 'getRuntimeExecutor'")
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
override fun getRuntimeScheduler(): RuntimeScheduler {
|
|
157
|
+
throw UnsupportedOperationException("Unimplemented method 'getRuntimeScheduler'")
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@Deprecated(message = "This API is unsupported in the New Architecture.")
|
|
161
|
+
override fun <T : JSIModule> addJSIModules(jsiModules: List<JSIModuleSpec<T>>) {
|
|
162
|
+
throw UnsupportedOperationException("Unimplemented method 'addJSIModules'")
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
override fun getJSCallInvokerHolder(): CallInvokerHolder? {
|
|
166
|
+
return reactHost.getJSCallInvokerHolder()
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
override fun getNativeMethodCallInvokerHolder(): NativeMethodCallInvokerHolder {
|
|
170
|
+
throw UnsupportedOperationException("Unimplemented method 'getNativeMethodCallInvokerHolder'")
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@Deprecated(
|
|
174
|
+
message =
|
|
175
|
+
"setTurboModuleManager(JSIModule getter) is deprecated and will be deleted in the future. Please use setTurboModuleRegistry(TurboModuleRegistry turboModuleRegistry) instead.",
|
|
176
|
+
replaceWith = ReplaceWith("setTurboModuleRegistry(turboModuleRegistry)"))
|
|
177
|
+
override fun setTurboModuleManager(getter: JSIModule) {
|
|
178
|
+
throw UnsupportedOperationException("Unimplemented method 'setTurboModuleManager'")
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
@DeprecatedInNewArchitecture(
|
|
182
|
+
message =
|
|
183
|
+
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
|
|
184
|
+
override fun setTurboModuleRegistry(turboModuleRegistry: TurboModuleRegistry) {
|
|
185
|
+
throw UnsupportedOperationException("Unimplemented method 'setTurboModuleRegistry'")
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
@DeprecatedInNewArchitecture(
|
|
189
|
+
message =
|
|
190
|
+
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
|
|
191
|
+
override fun setFabricUIManager(fabricUIManager: UIManager) {
|
|
192
|
+
throw UnsupportedOperationException("Unimplemented method 'setFabricUIManager'")
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@DeprecatedInNewArchitecture(
|
|
196
|
+
message =
|
|
197
|
+
"This method will be deprecated later as part of Stable APIs with bridge removal and not encouraged usage.")
|
|
198
|
+
override fun getFabricUIManager(): UIManager {
|
|
199
|
+
throw UnsupportedOperationException("Unimplemented method 'getFabricUIManager'")
|
|
200
|
+
}
|
|
201
|
+
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
package com.facebook.react.runtime;
|
|
9
9
|
|
|
10
10
|
import android.content.Context;
|
|
11
|
+
import android.util.Log;
|
|
11
12
|
import com.facebook.infer.annotation.Nullsafe;
|
|
12
13
|
import com.facebook.react.bridge.Arguments;
|
|
13
14
|
import com.facebook.react.bridge.Callback;
|
|
@@ -18,8 +19,6 @@ import com.facebook.react.bridge.JavaScriptModuleRegistry;
|
|
|
18
19
|
import com.facebook.react.bridge.NativeArray;
|
|
19
20
|
import com.facebook.react.bridge.NativeModule;
|
|
20
21
|
import com.facebook.react.bridge.ReactApplicationContext;
|
|
21
|
-
import com.facebook.react.bridge.ReactNoCrashBridgeNotAllowedSoftException;
|
|
22
|
-
import com.facebook.react.bridge.ReactSoftExceptionLogger;
|
|
23
22
|
import com.facebook.react.bridge.RuntimeExecutor;
|
|
24
23
|
import com.facebook.react.bridge.UIManager;
|
|
25
24
|
import com.facebook.react.bridge.WritableNativeArray;
|
|
@@ -84,11 +83,10 @@ class BridgelessReactContext extends ReactApplicationContext implements EventDis
|
|
|
84
83
|
|
|
85
84
|
@Override
|
|
86
85
|
public CatalystInstance getCatalystInstance() {
|
|
87
|
-
|
|
86
|
+
Log.w(
|
|
88
87
|
TAG,
|
|
89
|
-
new
|
|
90
|
-
|
|
91
|
-
throw new UnsupportedOperationException("There is no Catalyst instance in bridgeless mode.");
|
|
88
|
+
"[WARNING] Bridgeless doesn't support CatalystInstance. Accessing an API that's not part of the new architecture is not encouraged usage.");
|
|
89
|
+
return new BridgelessCatalystInstance(mReactHost);
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
@Override
|
|
@@ -60,6 +60,7 @@ import com.facebook.react.modules.core.DeviceEventManagerModule;
|
|
|
60
60
|
import com.facebook.react.runtime.internal.bolts.Continuation;
|
|
61
61
|
import com.facebook.react.runtime.internal.bolts.Task;
|
|
62
62
|
import com.facebook.react.runtime.internal.bolts.TaskCompletionSource;
|
|
63
|
+
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder;
|
|
63
64
|
import com.facebook.react.uimanager.UIManagerModule;
|
|
64
65
|
import com.facebook.react.uimanager.events.BlackHoleEventDispatcher;
|
|
65
66
|
import com.facebook.react.uimanager.events.EventDispatcher;
|
|
@@ -601,6 +602,20 @@ public class ReactHostImpl implements ReactHost {
|
|
|
601
602
|
return null;
|
|
602
603
|
}
|
|
603
604
|
|
|
605
|
+
/* package */
|
|
606
|
+
@Nullable
|
|
607
|
+
CallInvokerHolder getJSCallInvokerHolder() {
|
|
608
|
+
final ReactInstance reactInstance = mReactInstanceTaskRef.get().getResult();
|
|
609
|
+
if (reactInstance != null) {
|
|
610
|
+
return reactInstance.getJSCallInvokerHolder();
|
|
611
|
+
}
|
|
612
|
+
ReactSoftExceptionLogger.logSoftException(
|
|
613
|
+
TAG,
|
|
614
|
+
new ReactNoCrashSoftException(
|
|
615
|
+
"Tried to get JSCallInvokerHolder while instance is not ready"));
|
|
616
|
+
return null;
|
|
617
|
+
}
|
|
618
|
+
|
|
604
619
|
/**
|
|
605
620
|
* To be called when the host activity receives an activity result.
|
|
606
621
|
*
|
|
@@ -475,7 +475,7 @@ final class ReactInstance {
|
|
|
475
475
|
|
|
476
476
|
private native void loadJSBundleFromAssets(AssetManager assetManager, String assetURL);
|
|
477
477
|
|
|
478
|
-
|
|
478
|
+
/* package */ native CallInvokerHolderImpl getJSCallInvokerHolder();
|
|
479
479
|
|
|
480
480
|
private native NativeMethodCallInvokerHolderImpl getNativeMethodCallInvokerHolder();
|
|
481
481
|
|
|
@@ -62,6 +62,8 @@ public class TextAttributeProps implements EffectiveTextAttributeProvider {
|
|
|
62
62
|
public static final short TA_KEY_ROLE = 26;
|
|
63
63
|
public static final short TA_KEY_TEXT_TRANSFORM = 27;
|
|
64
64
|
|
|
65
|
+
public static final int UNSET = -1;
|
|
66
|
+
|
|
65
67
|
private static final String PROP_SHADOW_OFFSET = "textShadowOffset";
|
|
66
68
|
private static final String PROP_SHADOW_OFFSET_WIDTH = "width";
|
|
67
69
|
private static final String PROP_SHADOW_OFFSET_HEIGHT = "height";
|
|
@@ -48,10 +48,10 @@ inline static NSURL *NSURLFromImageSource(const facebook::react::ImageSource &im
|
|
|
48
48
|
{
|
|
49
49
|
// `NSURL` has a history of crashing with bad input, so let's be safe.
|
|
50
50
|
@try {
|
|
51
|
-
NSString *urlString = [NSString
|
|
51
|
+
NSString *urlString = [NSString stringWithUTF8String:imageSource.uri.c_str()];
|
|
52
52
|
|
|
53
53
|
if (!imageSource.bundle.empty()) {
|
|
54
|
-
NSString *bundle = [NSString
|
|
54
|
+
NSString *bundle = [NSString stringWithUTF8String:imageSource.bundle.c_str()];
|
|
55
55
|
urlString = [NSString stringWithFormat:@"%@.bundle/%@", bundle, urlString];
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
#import "RCTInstance.h"
|
|
9
|
-
#import <React/RCTBridgeProxy.h>
|
|
10
9
|
|
|
11
10
|
#import <memory>
|
|
12
11
|
|
|
@@ -16,6 +15,8 @@
|
|
|
16
15
|
#import <React/RCTBridge.h>
|
|
17
16
|
#import <React/RCTBridgeModule.h>
|
|
18
17
|
#import <React/RCTBridgeModuleDecorator.h>
|
|
18
|
+
#import <React/RCTBridgeProxy+Cxx.h>
|
|
19
|
+
#import <React/RCTBridgeProxy.h>
|
|
19
20
|
#import <React/RCTComponentViewFactory.h>
|
|
20
21
|
#import <React/RCTConstants.h>
|
|
21
22
|
#import <React/RCTCxxUtils.h>
|
|
@@ -256,6 +257,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
|
|
|
256
257
|
RuntimeExecutor bufferedRuntimeExecutor = _reactInstance->getBufferedRuntimeExecutor();
|
|
257
258
|
timerManager->setRuntimeExecutor(bufferedRuntimeExecutor);
|
|
258
259
|
|
|
260
|
+
auto jsCallInvoker = make_shared<BridgelessJSCallInvoker>(bufferedRuntimeExecutor);
|
|
259
261
|
RCTBridgeProxy *bridgeProxy =
|
|
260
262
|
[[RCTBridgeProxy alloc] initWithViewRegistry:_bridgeModuleDecorator.viewRegistry_DEPRECATED
|
|
261
263
|
moduleRegistry:_bridgeModuleDecorator.moduleRegistry
|
|
@@ -274,14 +276,14 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
|
|
|
274
276
|
}
|
|
275
277
|
}
|
|
276
278
|
runtime:_reactInstance->getJavaScriptContext()];
|
|
279
|
+
bridgeProxy.jsCallInvoker = jsCallInvoker;
|
|
277
280
|
[RCTBridge setCurrentBridge:(RCTBridge *)bridgeProxy];
|
|
278
281
|
|
|
279
282
|
// Set up TurboModules
|
|
280
|
-
_turboModuleManager = [[RCTTurboModuleManager alloc]
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
jsInvoker:std::make_shared<BridgelessJSCallInvoker>(bufferedRuntimeExecutor)];
|
|
283
|
+
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridgeProxy:bridgeProxy
|
|
284
|
+
bridgeModuleDecorator:_bridgeModuleDecorator
|
|
285
|
+
delegate:self
|
|
286
|
+
jsInvoker:jsCallInvoker];
|
|
285
287
|
_turboModuleManager.runtimeHandler = self;
|
|
286
288
|
|
|
287
289
|
#if RCT_DEV
|
|
@@ -480,14 +480,10 @@ void layoutAbsoluteDescendants(
|
|
|
480
480
|
LayoutData& layoutMarkerData,
|
|
481
481
|
uint32_t currentDepth,
|
|
482
482
|
uint32_t generationCount,
|
|
483
|
-
float
|
|
484
|
-
float
|
|
483
|
+
float currentNodeLeftOffsetFromContainingBlock,
|
|
484
|
+
float currentNodeTopOffsetFromContainingBlock,
|
|
485
485
|
float containingNodeAvailableInnerWidth,
|
|
486
486
|
float containingNodeAvailableInnerHeight) {
|
|
487
|
-
const FlexDirection mainAxis = resolveDirection(
|
|
488
|
-
currentNode->style().flexDirection(), currentNodeDirection);
|
|
489
|
-
const FlexDirection crossAxis =
|
|
490
|
-
resolveCrossDirection(mainAxis, currentNodeDirection);
|
|
491
487
|
for (auto child : currentNode->getChildren()) {
|
|
492
488
|
if (child->style().display() == Display::None) {
|
|
493
489
|
continue;
|
|
@@ -516,45 +512,73 @@ void layoutAbsoluteDescendants(
|
|
|
516
512
|
currentDepth,
|
|
517
513
|
generationCount);
|
|
518
514
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
if (needsTrailingPosition(mainAxis)) {
|
|
542
|
-
setChildTrailingPosition(currentNode, child, mainAxis);
|
|
515
|
+
/*
|
|
516
|
+
* At this point the child has its position set but only on its the
|
|
517
|
+
* parent's flexStart edge. Additionally, this position should be
|
|
518
|
+
* interpreted relative to the containing block of the child if it had
|
|
519
|
+
* insets defined. So we need to adjust the position by subtracting the
|
|
520
|
+
* the parents offset from the containing block. However, getting that
|
|
521
|
+
* offset is complicated since the two nodes can have different main/cross
|
|
522
|
+
* axes.
|
|
523
|
+
*/
|
|
524
|
+
const FlexDirection parentMainAxis = resolveDirection(
|
|
525
|
+
currentNode->style().flexDirection(), currentNodeDirection);
|
|
526
|
+
const FlexDirection parentCrossAxis =
|
|
527
|
+
resolveCrossDirection(parentMainAxis, currentNodeDirection);
|
|
528
|
+
|
|
529
|
+
if (needsTrailingPosition(parentMainAxis)) {
|
|
530
|
+
const bool mainInsetsDefined = isRow(parentMainAxis)
|
|
531
|
+
? child->style().horizontalInsetsDefined()
|
|
532
|
+
: child->style().verticalInsetsDefined();
|
|
533
|
+
setChildTrailingPosition(
|
|
534
|
+
mainInsetsDefined ? containingNode : currentNode,
|
|
535
|
+
child,
|
|
536
|
+
parentMainAxis);
|
|
543
537
|
}
|
|
544
|
-
if (needsTrailingPosition(
|
|
545
|
-
|
|
538
|
+
if (needsTrailingPosition(parentCrossAxis)) {
|
|
539
|
+
const bool crossInsetsDefined = isRow(parentCrossAxis)
|
|
540
|
+
? child->style().horizontalInsetsDefined()
|
|
541
|
+
: child->style().verticalInsetsDefined();
|
|
542
|
+
setChildTrailingPosition(
|
|
543
|
+
crossInsetsDefined ? containingNode : currentNode,
|
|
544
|
+
child,
|
|
545
|
+
parentCrossAxis);
|
|
546
546
|
}
|
|
547
|
+
|
|
548
|
+
/*
|
|
549
|
+
* At this point we know the left and top physical edges of the child are
|
|
550
|
+
* set with positions that are relative to the containing block if insets
|
|
551
|
+
* are defined
|
|
552
|
+
*/
|
|
553
|
+
const float childLeftPosition =
|
|
554
|
+
child->getLayout().position(PhysicalEdge::Left);
|
|
555
|
+
const float childTopPosition =
|
|
556
|
+
child->getLayout().position(PhysicalEdge::Top);
|
|
557
|
+
|
|
558
|
+
const float childLeftOffsetFromParent =
|
|
559
|
+
child->style().horizontalInsetsDefined()
|
|
560
|
+
? (childLeftPosition - currentNodeLeftOffsetFromContainingBlock)
|
|
561
|
+
: childLeftPosition;
|
|
562
|
+
const float childTopOffsetFromParent =
|
|
563
|
+
child->style().verticalInsetsDefined()
|
|
564
|
+
? (childTopPosition - currentNodeTopOffsetFromContainingBlock)
|
|
565
|
+
: childTopPosition;
|
|
566
|
+
|
|
567
|
+
child->setLayoutPosition(childLeftOffsetFromParent, PhysicalEdge::Left);
|
|
568
|
+
child->setLayoutPosition(childTopOffsetFromParent, PhysicalEdge::Top);
|
|
547
569
|
} else if (
|
|
548
570
|
child->style().positionType() == PositionType::Static &&
|
|
549
571
|
!child->alwaysFormsContainingBlock()) {
|
|
550
572
|
const Direction childDirection =
|
|
551
573
|
child->resolveDirection(currentNodeDirection);
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
574
|
+
// By now all descendants of the containing block that are not absolute
|
|
575
|
+
// will have their positions set for left and top.
|
|
576
|
+
const float childLeftOffsetFromContainingBlock =
|
|
577
|
+
currentNodeLeftOffsetFromContainingBlock +
|
|
578
|
+
child->getLayout().position(PhysicalEdge::Left);
|
|
579
|
+
const float childTopOffsetFromContainingBlock =
|
|
580
|
+
currentNodeTopOffsetFromContainingBlock +
|
|
581
|
+
child->getLayout().position(PhysicalEdge::Top);
|
|
558
582
|
|
|
559
583
|
layoutAbsoluteDescendants(
|
|
560
584
|
containingNode,
|
|
@@ -564,8 +588,8 @@ void layoutAbsoluteDescendants(
|
|
|
564
588
|
layoutMarkerData,
|
|
565
589
|
currentDepth + 1,
|
|
566
590
|
generationCount,
|
|
567
|
-
|
|
568
|
-
|
|
591
|
+
childLeftOffsetFromContainingBlock,
|
|
592
|
+
childTopOffsetFromContainingBlock,
|
|
569
593
|
containingNodeAvailableInnerWidth,
|
|
570
594
|
containingNodeAvailableInnerHeight);
|
|
571
595
|
}
|
|
@@ -2045,26 +2045,7 @@ static void calculateLayoutImpl(
|
|
|
2045
2045
|
}
|
|
2046
2046
|
|
|
2047
2047
|
if (performLayout) {
|
|
2048
|
-
// STEP 10:
|
|
2049
|
-
// Let the containing block layout its absolute descendants. By definition
|
|
2050
|
-
// the containing block will not be static unless we are at the root.
|
|
2051
|
-
if (node->style().positionType() != PositionType::Static ||
|
|
2052
|
-
node->alwaysFormsContainingBlock() || depth == 1) {
|
|
2053
|
-
layoutAbsoluteDescendants(
|
|
2054
|
-
node,
|
|
2055
|
-
node,
|
|
2056
|
-
isMainAxisRow ? sizingModeMainDim : sizingModeCrossDim,
|
|
2057
|
-
direction,
|
|
2058
|
-
layoutMarkerData,
|
|
2059
|
-
depth,
|
|
2060
|
-
generationCount,
|
|
2061
|
-
0.0f,
|
|
2062
|
-
0.0f,
|
|
2063
|
-
availableInnerWidth,
|
|
2064
|
-
availableInnerHeight);
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
// STEP 11: SETTING TRAILING POSITIONS FOR CHILDREN
|
|
2048
|
+
// STEP 10: SETTING TRAILING POSITIONS FOR CHILDREN
|
|
2068
2049
|
const bool needsMainTrailingPos = needsTrailingPosition(mainAxis);
|
|
2069
2050
|
const bool needsCrossTrailingPos = needsTrailingPosition(crossAxis);
|
|
2070
2051
|
|
|
@@ -2087,6 +2068,24 @@ static void calculateLayoutImpl(
|
|
|
2087
2068
|
}
|
|
2088
2069
|
}
|
|
2089
2070
|
}
|
|
2071
|
+
|
|
2072
|
+
// STEP 11: SIZING AND POSITIONING ABSOLUTE CHILDREN
|
|
2073
|
+
// Let the containing block layout its absolute descendants.
|
|
2074
|
+
if (node->style().positionType() != PositionType::Static ||
|
|
2075
|
+
node->alwaysFormsContainingBlock() || depth == 1) {
|
|
2076
|
+
layoutAbsoluteDescendants(
|
|
2077
|
+
node,
|
|
2078
|
+
node,
|
|
2079
|
+
isMainAxisRow ? sizingModeMainDim : sizingModeCrossDim,
|
|
2080
|
+
direction,
|
|
2081
|
+
layoutMarkerData,
|
|
2082
|
+
depth,
|
|
2083
|
+
generationCount,
|
|
2084
|
+
0.0f,
|
|
2085
|
+
0.0f,
|
|
2086
|
+
availableInnerWidth,
|
|
2087
|
+
availableInnerHeight);
|
|
2088
|
+
}
|
|
2090
2089
|
}
|
|
2091
2090
|
}
|
|
2092
2091
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.74.0-rc.
|
|
3
|
+
"version": "0.74.0-rc.4",
|
|
4
4
|
"description": "A framework for building native apps using React",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -98,16 +98,16 @@
|
|
|
98
98
|
},
|
|
99
99
|
"dependencies": {
|
|
100
100
|
"@jest/create-cache-key-function": "^29.6.3",
|
|
101
|
-
"@react-native-community/cli": "13.6.
|
|
102
|
-
"@react-native-community/cli-platform-android": "13.6.
|
|
103
|
-
"@react-native-community/cli-platform-ios": "13.6.
|
|
104
|
-
"@react-native/assets-registry": "0.74.
|
|
105
|
-
"@react-native/codegen": "0.74.
|
|
106
|
-
"@react-native/community-cli-plugin": "0.74.
|
|
107
|
-
"@react-native/gradle-plugin": "0.74.
|
|
108
|
-
"@react-native/js-polyfills": "0.74.
|
|
109
|
-
"@react-native/normalize-colors": "0.74.
|
|
110
|
-
"@react-native/virtualized-lists": "0.74.
|
|
101
|
+
"@react-native-community/cli": "13.6.2",
|
|
102
|
+
"@react-native-community/cli-platform-android": "13.6.2",
|
|
103
|
+
"@react-native-community/cli-platform-ios": "13.6.2",
|
|
104
|
+
"@react-native/assets-registry": "0.74.75",
|
|
105
|
+
"@react-native/codegen": "0.74.75",
|
|
106
|
+
"@react-native/community-cli-plugin": "0.74.75",
|
|
107
|
+
"@react-native/gradle-plugin": "0.74.75",
|
|
108
|
+
"@react-native/js-polyfills": "0.74.75",
|
|
109
|
+
"@react-native/normalize-colors": "0.74.75",
|
|
110
|
+
"@react-native/virtualized-lists": "0.74.75",
|
|
111
111
|
"abort-controller": "^3.0.0",
|
|
112
112
|
"anser": "^1.4.9",
|
|
113
113
|
"ansi-regex": "^5.0.0",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/template/package.json
CHANGED
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"react": "18.2.0",
|
|
14
|
-
"react-native": "0.74.0-rc.
|
|
14
|
+
"react-native": "0.74.0-rc.4"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@babel/core": "^7.20.0",
|
|
18
18
|
"@babel/preset-env": "^7.20.0",
|
|
19
19
|
"@babel/runtime": "^7.20.0",
|
|
20
|
-
"@react-native/babel-preset": "0.74.
|
|
21
|
-
"@react-native/eslint-config": "0.74.
|
|
22
|
-
"@react-native/metro-config": "0.74.
|
|
23
|
-
"@react-native/typescript-config": "0.74.
|
|
20
|
+
"@react-native/babel-preset": "0.74.75",
|
|
21
|
+
"@react-native/eslint-config": "0.74.75",
|
|
22
|
+
"@react-native/metro-config": "0.74.75",
|
|
23
|
+
"@react-native/typescript-config": "0.74.75",
|
|
24
24
|
"@types/react": "^18.2.6",
|
|
25
25
|
"@types/react-test-renderer": "^18.0.0",
|
|
26
26
|
"babel-jest": "^29.6.3",
|
package/types/index.d.ts
CHANGED
|
@@ -103,6 +103,7 @@ export * from '../Libraries/Components/View/View';
|
|
|
103
103
|
export * from '../Libraries/Components/View/ViewAccessibility';
|
|
104
104
|
export * from '../Libraries/Components/View/ViewPropTypes';
|
|
105
105
|
export * from '../Libraries/Components/Button';
|
|
106
|
+
export * from '../Libraries/Core/registerCallableModule';
|
|
106
107
|
export * from '../Libraries/DevToolsSettings/DevToolsSettingsManager';
|
|
107
108
|
export * from '../Libraries/EventEmitter/NativeEventEmitter';
|
|
108
109
|
export * from '../Libraries/EventEmitter/RCTDeviceEventEmitter';
|