react-native 0.72.0-rc.1 → 0.72.0-rc.2
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/Components/View/ReactNativeStyleAttributes.js +0 -7
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/NativeComponent/BaseViewConfig.android.js +0 -8
- package/Libraries/NativeComponent/BaseViewConfig.ios.js +0 -8
- package/Libraries/StyleSheet/StyleSheetTypes.d.ts +0 -7
- package/Libraries/StyleSheet/StyleSheetTypes.js +0 -74
- package/Libraries/Text/TextInput/RCTBackedTextInputDelegateAdapter.m +3 -3
- package/React/Base/RCTVersion.m +1 -1
- package/React/CoreModules/RCTDevMenu.mm +3 -3
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/animated/NativeAnimatedModule.java +10 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContext.java +29 -0
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManagerListener.java +25 -2
- package/ReactAndroid/src/main/java/com/facebook/react/bridge/interop/InteropModuleRegistry.java +56 -0
- package/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +8 -0
- package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +26 -8
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +21 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/interop/InteropEvent.java +41 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/interop/InteropEventEmitter.java +65 -0
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java +9 -0
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/ThemedReactContext.java +1 -0
- package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java +32 -0
- package/ReactAndroid/src/main/java/com/facebook/react/views/scroll/MaintainVisibleScrollPositionHelper.java +19 -0
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +0 -21
- package/ReactCommon/react/renderer/components/view/YogaStylableProps.cpp +0 -49
- package/ReactCommon/react/renderer/components/view/YogaStylableProps.h +0 -9
- package/package.json +7 -7
- package/scripts/cocoapods/__tests__/jsengine-test.rb +6 -2
- package/scripts/cocoapods/__tests__/test_utils/podSpy.rb +2 -1
- package/scripts/cocoapods/jsengine.rb +6 -1
- package/sdks/hermesc/linux64-bin/hermesc +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/template/android/app/build.gradle +7 -2
- package/template/package.json +4 -4
- package/types/index.d.ts +4 -0
|
@@ -46,13 +46,6 @@ const ReactNativeStyleAttributes: {[string]: AnyAttributeType, ...} = {
|
|
|
46
46
|
flexWrap: true,
|
|
47
47
|
gap: true,
|
|
48
48
|
height: true,
|
|
49
|
-
inset: true,
|
|
50
|
-
insetBlock: true,
|
|
51
|
-
insetBlockEnd: true,
|
|
52
|
-
insetBlockStart: true,
|
|
53
|
-
insetInline: true,
|
|
54
|
-
insetInlineEnd: true,
|
|
55
|
-
insetInlineStart: true,
|
|
56
49
|
justifyContent: true,
|
|
57
50
|
left: true,
|
|
58
51
|
margin: true,
|
|
@@ -258,14 +258,6 @@ const validAttributesForNonEventProps = {
|
|
|
258
258
|
top: true,
|
|
259
259
|
bottom: true,
|
|
260
260
|
|
|
261
|
-
inset: true,
|
|
262
|
-
insetBlock: true,
|
|
263
|
-
insetBlockEnd: true,
|
|
264
|
-
insetBlockStart: true,
|
|
265
|
-
insetInline: true,
|
|
266
|
-
insetInlineEnd: true,
|
|
267
|
-
insetInlineStart: true,
|
|
268
|
-
|
|
269
261
|
position: true,
|
|
270
262
|
|
|
271
263
|
style: ReactNativeStyleAttributes,
|
|
@@ -236,14 +236,6 @@ const validAttributesForNonEventProps = {
|
|
|
236
236
|
bottom: true,
|
|
237
237
|
left: true,
|
|
238
238
|
|
|
239
|
-
inset: true,
|
|
240
|
-
insetBlock: true,
|
|
241
|
-
insetBlockEnd: true,
|
|
242
|
-
insetBlockStart: true,
|
|
243
|
-
insetInline: true,
|
|
244
|
-
insetInlineEnd: true,
|
|
245
|
-
insetInlineStart: true,
|
|
246
|
-
|
|
247
239
|
width: true,
|
|
248
240
|
height: true,
|
|
249
241
|
|
|
@@ -69,13 +69,6 @@ export interface FlexStyle {
|
|
|
69
69
|
flexShrink?: number | undefined;
|
|
70
70
|
flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse' | undefined;
|
|
71
71
|
height?: DimensionValue | undefined;
|
|
72
|
-
inset?: DimensionValue | undefined;
|
|
73
|
-
insetBlock?: DimensionValue | undefined;
|
|
74
|
-
insetBlockEnd?: DimensionValue | undefined;
|
|
75
|
-
insetBlockStart?: DimensionValue | undefined;
|
|
76
|
-
insetInline?: DimensionValue | undefined;
|
|
77
|
-
insetInlineEnd?: DimensionValue | undefined;
|
|
78
|
-
insetInlineStart?: DimensionValue | undefined;
|
|
79
72
|
justifyContent?:
|
|
80
73
|
| 'flex-start'
|
|
81
74
|
| 'flex-end'
|
|
@@ -134,80 +134,6 @@ type ____LayoutStyle_Internal = $ReadOnly<{
|
|
|
134
134
|
*/
|
|
135
135
|
top?: DimensionValue,
|
|
136
136
|
|
|
137
|
-
/** `inset` is a shorthand that corresponds to the top, right, bottom, and/or left properties.
|
|
138
|
-
*
|
|
139
|
-
* It works similarly to `inset` in CSS, but in React Native you
|
|
140
|
-
* must use points or percentages. Ems and other units are not supported.
|
|
141
|
-
*
|
|
142
|
-
* See https://developer.mozilla.org/en-US/docs/Web/CSS/inset
|
|
143
|
-
* for more details of how `inset` affects layout.
|
|
144
|
-
*/
|
|
145
|
-
inset?: DimensionValue,
|
|
146
|
-
|
|
147
|
-
/** `insetBlock` is a shorthand that corresponds to the `insetBlockStart` and `insetBlockEnd` properties.
|
|
148
|
-
*
|
|
149
|
-
* It works similarly to `inset-block` in CSS, but in React Native you
|
|
150
|
-
* must use points or percentages. Ems and other units are not supported.
|
|
151
|
-
*
|
|
152
|
-
* See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block
|
|
153
|
-
* for more details of how `inset-block` affects layout.
|
|
154
|
-
*/
|
|
155
|
-
insetBlock?: DimensionValue,
|
|
156
|
-
|
|
157
|
-
/** `insetBlockEnd` is a logical property that sets the length that an
|
|
158
|
-
* element is offset in the block direction from its ending edge.
|
|
159
|
-
*
|
|
160
|
-
* It works similarly to `inset-block-end` in CSS, but in React Native you
|
|
161
|
-
* must use points or percentages. Ems and other units are not supported.
|
|
162
|
-
*
|
|
163
|
-
* See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block-end
|
|
164
|
-
* for more details of how `inset-block-end` affects layout.
|
|
165
|
-
*/
|
|
166
|
-
insetBlockEnd?: DimensionValue,
|
|
167
|
-
|
|
168
|
-
/** `insetBlockStart` is a logical property that sets the length that an
|
|
169
|
-
* element is offset in the block direction from its starting edge.
|
|
170
|
-
*
|
|
171
|
-
* It works similarly to `inset-block-start` in CSS, but in React Native you
|
|
172
|
-
* must use points or percentages. Ems and other units are not supported.
|
|
173
|
-
*
|
|
174
|
-
* See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block-start
|
|
175
|
-
* for more details of how `inset-block-start` affects layout.
|
|
176
|
-
*/
|
|
177
|
-
insetBlockStart?: DimensionValue,
|
|
178
|
-
|
|
179
|
-
/** `insetInline` is a shorthand that corresponds to the `insetInlineStart` and `insetInlineEnd` properties.
|
|
180
|
-
*
|
|
181
|
-
* It works similarly to `inset-inline` in CSS, but in React Native you
|
|
182
|
-
* must use points or percentages. Ems and other units are not supported.
|
|
183
|
-
*
|
|
184
|
-
* See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline
|
|
185
|
-
* for more details of how `inset-inline` affects layout.
|
|
186
|
-
*/
|
|
187
|
-
insetInline?: DimensionValue,
|
|
188
|
-
|
|
189
|
-
/** `insetInlineEnd` is a logical property that sets the length that an
|
|
190
|
-
* element is offset in the starting inline direction.
|
|
191
|
-
*
|
|
192
|
-
* It works similarly to `inset-inline-end` in CSS, but in React Native you
|
|
193
|
-
* must use points or percentages. Ems and other units are not supported.
|
|
194
|
-
*
|
|
195
|
-
* See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-end
|
|
196
|
-
* for more details of how `inset-inline-end` affects layout.
|
|
197
|
-
*/
|
|
198
|
-
insetInlineEnd?: DimensionValue,
|
|
199
|
-
|
|
200
|
-
/** `insetInlineStart` is a logical property that sets the length that an
|
|
201
|
-
* element is offset in the starting inline direction.
|
|
202
|
-
*
|
|
203
|
-
* It works similarly to `inset-inline-start` in CSS, but in React Native you
|
|
204
|
-
* must use points or percentages. Ems and other units are not supported.
|
|
205
|
-
*
|
|
206
|
-
* See https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline-start
|
|
207
|
-
* for more details of how `inset-inline-start` affects layout.
|
|
208
|
-
*/
|
|
209
|
-
insetInlineStart?: DimensionValue,
|
|
210
|
-
|
|
211
137
|
/** `minWidth` is the minimum width for this component, in logical pixels.
|
|
212
138
|
*
|
|
213
139
|
* It works similarly to `min-width` in CSS, but in React Native you
|
|
@@ -256,21 +256,21 @@ static void *TextFieldSelectionObservingContext = &TextFieldSelectionObservingCo
|
|
|
256
256
|
|
|
257
257
|
- (void)textViewDidChange:(__unused UITextView *)textView
|
|
258
258
|
{
|
|
259
|
-
if (_ignoreNextTextInputCall
|
|
259
|
+
if (_ignoreNextTextInputCall) {
|
|
260
260
|
_ignoreNextTextInputCall = NO;
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
|
-
_lastStringStateWasUpdatedWith = _backedTextInputView.attributedText;
|
|
264
263
|
_textDidChangeIsComing = NO;
|
|
265
264
|
[_backedTextInputView.textInputDelegate textInputDidChange];
|
|
266
265
|
}
|
|
267
266
|
|
|
268
267
|
- (void)textViewDidChangeSelection:(__unused UITextView *)textView
|
|
269
268
|
{
|
|
270
|
-
if (![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
|
|
269
|
+
if (_lastStringStateWasUpdatedWith && ![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
|
|
271
270
|
[self textViewDidChange:_backedTextInputView];
|
|
272
271
|
_ignoreNextTextInputCall = YES;
|
|
273
272
|
}
|
|
273
|
+
_lastStringStateWasUpdatedWith = _backedTextInputView.attributedText;
|
|
274
274
|
[self textViewProbablyDidChangeSelection];
|
|
275
275
|
}
|
|
276
276
|
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -428,10 +428,10 @@ RCT_EXPORT_METHOD(show)
|
|
|
428
428
|
? UIAlertControllerStyleActionSheet
|
|
429
429
|
: UIAlertControllerStyleAlert;
|
|
430
430
|
|
|
431
|
-
NSString *
|
|
432
|
-
NSString *
|
|
431
|
+
NSString *devMenuType = self.bridge ? @"Bridge" : @"Bridgeless";
|
|
432
|
+
NSString *devMenuTitle = [NSString stringWithFormat:@"React Native Dev Menu (%@)", devMenuType];
|
|
433
433
|
|
|
434
|
-
_actionSheet = [UIAlertController alertControllerWithTitle:
|
|
434
|
+
_actionSheet = [UIAlertController alertControllerWithTitle:devMenuTitle message:description preferredStyle:style];
|
|
435
435
|
|
|
436
436
|
NSArray<RCTDevMenuItem *> *items = [self _menuItemsToPresent];
|
|
437
437
|
for (RCTDevMenuItem *item in items) {
|
|
@@ -295,6 +295,16 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
|
|
295
295
|
mCurrentFrameNumber++;
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
+
@Override
|
|
299
|
+
public void willMountItems(UIManager uiManager) {
|
|
300
|
+
// noop
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
@Override
|
|
304
|
+
public void didMountItems(UIManager uiManager) {
|
|
305
|
+
// noop
|
|
306
|
+
}
|
|
307
|
+
|
|
298
308
|
// For FabricUIManager only
|
|
299
309
|
@Override
|
|
300
310
|
@UiThread
|
|
@@ -21,6 +21,7 @@ import com.facebook.common.logging.FLog;
|
|
|
21
21
|
import com.facebook.infer.annotation.Assertions;
|
|
22
22
|
import com.facebook.infer.annotation.ThreadConfined;
|
|
23
23
|
import com.facebook.proguard.annotations.DoNotStrip;
|
|
24
|
+
import com.facebook.react.bridge.interop.InteropModuleRegistry;
|
|
24
25
|
import com.facebook.react.bridge.queue.MessageQueueThread;
|
|
25
26
|
import com.facebook.react.bridge.queue.ReactQueueConfiguration;
|
|
26
27
|
import com.facebook.react.common.LifecycleState;
|
|
@@ -69,6 +70,8 @@ public class ReactContext extends ContextWrapper {
|
|
|
69
70
|
private @Nullable JSExceptionHandler mJSExceptionHandler;
|
|
70
71
|
private @Nullable JSExceptionHandler mExceptionHandlerWrapper;
|
|
71
72
|
private @Nullable WeakReference<Activity> mCurrentActivity;
|
|
73
|
+
|
|
74
|
+
private @Nullable InteropModuleRegistry mInteropModuleRegistry;
|
|
72
75
|
private boolean mIsInitialized = false;
|
|
73
76
|
|
|
74
77
|
public ReactContext(Context base) {
|
|
@@ -93,6 +96,7 @@ public class ReactContext extends ContextWrapper {
|
|
|
93
96
|
|
|
94
97
|
ReactQueueConfiguration queueConfig = catalystInstance.getReactQueueConfiguration();
|
|
95
98
|
initializeMessageQueueThreads(queueConfig);
|
|
99
|
+
initializeInteropModules();
|
|
96
100
|
}
|
|
97
101
|
|
|
98
102
|
/** Initialize message queue threads using a ReactQueueConfiguration. */
|
|
@@ -120,6 +124,14 @@ public class ReactContext extends ContextWrapper {
|
|
|
120
124
|
mIsInitialized = true;
|
|
121
125
|
}
|
|
122
126
|
|
|
127
|
+
protected void initializeInteropModules() {
|
|
128
|
+
mInteropModuleRegistry = new InteropModuleRegistry();
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
protected void initializeInteropModules(ReactContext reactContext) {
|
|
132
|
+
mInteropModuleRegistry = reactContext.mInteropModuleRegistry;
|
|
133
|
+
}
|
|
134
|
+
|
|
123
135
|
public void resetPerfStats() {
|
|
124
136
|
if (mNativeModulesMessageQueueThread != null) {
|
|
125
137
|
mNativeModulesMessageQueueThread.resetPerfStats();
|
|
@@ -163,6 +175,10 @@ public class ReactContext extends ContextWrapper {
|
|
|
163
175
|
}
|
|
164
176
|
throw new IllegalStateException(EARLY_JS_ACCESS_EXCEPTION_MESSAGE);
|
|
165
177
|
}
|
|
178
|
+
if (mInteropModuleRegistry != null
|
|
179
|
+
&& mInteropModuleRegistry.shouldReturnInteropModule(jsInterface)) {
|
|
180
|
+
return mInteropModuleRegistry.getInteropModule(jsInterface);
|
|
181
|
+
}
|
|
166
182
|
return mCatalystInstance.getJSModule(jsInterface);
|
|
167
183
|
}
|
|
168
184
|
|
|
@@ -546,4 +562,17 @@ public class ReactContext extends ContextWrapper {
|
|
|
546
562
|
Assertions.assertNotNull(mCatalystInstance).registerSegment(segmentId, path);
|
|
547
563
|
Assertions.assertNotNull(callback).invoke();
|
|
548
564
|
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Register a {@link JavaScriptModule} within the Interop Layer so that can be consumed whenever
|
|
568
|
+
* getJSModule is invoked.
|
|
569
|
+
*
|
|
570
|
+
* <p>This method is internal to React Native and should not be used externally.
|
|
571
|
+
*/
|
|
572
|
+
public <T extends JavaScriptModule> void internal_registerInteropModule(
|
|
573
|
+
Class<T> interopModuleInterface, Object interopModule) {
|
|
574
|
+
if (mInteropModuleRegistry != null) {
|
|
575
|
+
mInteropModuleRegistry.registerInteropModule(interopModuleInterface, interopModule);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
549
578
|
}
|
|
@@ -12,10 +12,33 @@ public interface UIManagerListener {
|
|
|
12
12
|
/**
|
|
13
13
|
* Called right before view updates are dispatched at the end of a batch. This is useful if a
|
|
14
14
|
* module needs to add UIBlocks to the queue before it is flushed.
|
|
15
|
+
*
|
|
16
|
+
* <p>This is called by Paper only.
|
|
15
17
|
*/
|
|
16
18
|
void willDispatchViewUpdates(UIManager uiManager);
|
|
17
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Called on UIThread right before view updates are executed.
|
|
21
|
+
*
|
|
22
|
+
* <p>This is called by Fabric only.
|
|
23
|
+
*/
|
|
24
|
+
void willMountItems(UIManager uiManager);
|
|
25
|
+
/**
|
|
26
|
+
* Called on UIThread right after view updates are executed.
|
|
27
|
+
*
|
|
28
|
+
* <p>This is called by Fabric only.
|
|
29
|
+
*/
|
|
30
|
+
void didMountItems(UIManager uiManager);
|
|
31
|
+
/**
|
|
32
|
+
* Called on UIThread right after view updates are dispatched for a frame. Note that this will be
|
|
33
|
+
* called for every frame even if there are no updates.
|
|
34
|
+
*
|
|
35
|
+
* <p>This is called by Fabric only.
|
|
36
|
+
*/
|
|
18
37
|
void didDispatchMountItems(UIManager uiManager);
|
|
19
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Called right after scheduleMountItems is called in Fabric, after a new tree is committed.
|
|
40
|
+
*
|
|
41
|
+
* <p>This is called by Fabric only.
|
|
42
|
+
*/
|
|
20
43
|
void didScheduleMountItems(UIManager uiManager);
|
|
21
44
|
}
|
package/ReactAndroid/src/main/java/com/facebook/react/bridge/interop/InteropModuleRegistry.java
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
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.bridge.interop;
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Nullable;
|
|
11
|
+
import com.facebook.react.bridge.JavaScriptModule;
|
|
12
|
+
import com.facebook.react.config.ReactFeatureFlags;
|
|
13
|
+
import java.util.HashMap;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A utility class that takes care of returning {@link JavaScriptModule} which are used for the
|
|
17
|
+
* Fabric Interop Layer. This allows us to override the returned classes once the user is invoking
|
|
18
|
+
* `ReactContext.getJsModule()`.
|
|
19
|
+
*
|
|
20
|
+
* <p>Currently we only support a `RCTEventEmitter` re-implementation, being `InteropEventEmitter`
|
|
21
|
+
* but this class can support other re-implementation in the future.
|
|
22
|
+
*/
|
|
23
|
+
public class InteropModuleRegistry {
|
|
24
|
+
|
|
25
|
+
@SuppressWarnings("rawtypes")
|
|
26
|
+
private final HashMap<Class, Object> supportedModules;
|
|
27
|
+
|
|
28
|
+
public InteropModuleRegistry() {
|
|
29
|
+
this.supportedModules = new HashMap<>();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
public <T extends JavaScriptModule> boolean shouldReturnInteropModule(Class<T> requestedModule) {
|
|
33
|
+
return checkReactFeatureFlagsConditions() && supportedModules.containsKey(requestedModule);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Nullable
|
|
37
|
+
public <T extends JavaScriptModule> T getInteropModule(Class<T> requestedModule) {
|
|
38
|
+
if (checkReactFeatureFlagsConditions()) {
|
|
39
|
+
//noinspection unchecked
|
|
40
|
+
return (T) supportedModules.get(requestedModule);
|
|
41
|
+
} else {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public <T extends JavaScriptModule> void registerInteropModule(
|
|
47
|
+
Class<T> interopModuleInterface, Object interopModule) {
|
|
48
|
+
if (checkReactFeatureFlagsConditions()) {
|
|
49
|
+
supportedModules.put(interopModuleInterface, interopModule);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
private boolean checkReactFeatureFlagsConditions() {
|
|
54
|
+
return ReactFeatureFlags.enableFabricRenderer && ReactFeatureFlags.unstable_useFabricInterop;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -34,6 +34,14 @@ public class ReactFeatureFlags {
|
|
|
34
34
|
*/
|
|
35
35
|
public static volatile boolean enableFabricRenderer = false;
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Should this application enable the Fabric Interop Layer for Android? If yes, the application
|
|
39
|
+
* will behave so that it can accept non-Fabric components and render them on Fabric. This toggle
|
|
40
|
+
* is controlling extra logic such as custom event dispatching that are needed for the Fabric
|
|
41
|
+
* Interop Layer to work correctly.
|
|
42
|
+
*/
|
|
43
|
+
public static volatile boolean unstable_useFabricInterop = false;
|
|
44
|
+
|
|
37
45
|
/**
|
|
38
46
|
* Feature flag to enable the new bridgeless architecture. Note: Enabling this will force enable
|
|
39
47
|
* the following flags: `useTurboModules` & `enableFabricRenderer`.
|
package/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultNewArchitectureEntryPoint.kt
CHANGED
|
@@ -31,6 +31,7 @@ object DefaultNewArchitectureEntryPoint {
|
|
|
31
31
|
) {
|
|
32
32
|
ReactFeatureFlags.useTurboModules = turboModulesEnabled
|
|
33
33
|
ReactFeatureFlags.enableFabricRenderer = fabricEnabled
|
|
34
|
+
ReactFeatureFlags.unstable_useFabricInterop = fabricEnabled
|
|
34
35
|
|
|
35
36
|
this.privateFabricEnabled = fabricEnabled
|
|
36
37
|
this.privateTurboModulesEnabled = turboModulesEnabled
|
|
@@ -24,6 +24,7 @@ import android.util.Pair;
|
|
|
24
24
|
import android.view.Gravity;
|
|
25
25
|
import android.view.View;
|
|
26
26
|
import android.widget.EditText;
|
|
27
|
+
import android.widget.LinearLayout;
|
|
27
28
|
import android.widget.TextView;
|
|
28
29
|
import android.widget.Toast;
|
|
29
30
|
import androidx.annotation.Nullable;
|
|
@@ -553,17 +554,30 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
|
|
|
553
554
|
return;
|
|
554
555
|
}
|
|
555
556
|
|
|
556
|
-
final
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
557
|
+
final LinearLayout header = new LinearLayout(getApplicationContext());
|
|
558
|
+
header.setOrientation(LinearLayout.VERTICAL);
|
|
559
|
+
|
|
560
|
+
final TextView title = new TextView(getApplicationContext());
|
|
561
|
+
title.setText("React Native Dev Menu (" + getUniqueTag() + ")");
|
|
562
|
+
title.setPadding(0, 50, 0, 0);
|
|
563
|
+
title.setGravity(Gravity.CENTER);
|
|
564
|
+
title.setTextColor(Color.DKGRAY);
|
|
565
|
+
title.setTextSize(16);
|
|
566
|
+
title.setTypeface(title.getTypeface(), Typeface.BOLD);
|
|
567
|
+
|
|
568
|
+
final TextView jsExecutorLabel = new TextView(getApplicationContext());
|
|
569
|
+
jsExecutorLabel.setText(getJSExecutorDescription());
|
|
570
|
+
jsExecutorLabel.setPadding(0, 20, 0, 0);
|
|
571
|
+
jsExecutorLabel.setGravity(Gravity.CENTER);
|
|
572
|
+
jsExecutorLabel.setTextColor(Color.GRAY);
|
|
573
|
+
jsExecutorLabel.setTextSize(14);
|
|
574
|
+
|
|
575
|
+
header.addView(title);
|
|
576
|
+
header.addView(jsExecutorLabel);
|
|
563
577
|
|
|
564
578
|
mDevOptionsDialog =
|
|
565
579
|
new AlertDialog.Builder(context)
|
|
566
|
-
.setCustomTitle(
|
|
580
|
+
.setCustomTitle(header)
|
|
567
581
|
.setItems(
|
|
568
582
|
options.keySet().toArray(new String[0]),
|
|
569
583
|
new DialogInterface.OnClickListener() {
|
|
@@ -587,6 +601,10 @@ public abstract class DevSupportManagerBase implements DevSupportManager {
|
|
|
587
601
|
}
|
|
588
602
|
}
|
|
589
603
|
|
|
604
|
+
private String getJSExecutorDescription() {
|
|
605
|
+
return "Running " + getReactInstanceDevHelper().getJavaScriptExecutorFactory().toString();
|
|
606
|
+
}
|
|
607
|
+
|
|
590
608
|
/**
|
|
591
609
|
* {@link ReactInstanceDevCommandsHandler} is responsible for enabling/disabling dev support when
|
|
592
610
|
* a React view is attached/detached or when application state changes (e.g. the application is
|
|
@@ -56,6 +56,7 @@ import com.facebook.react.config.ReactFeatureFlags;
|
|
|
56
56
|
import com.facebook.react.fabric.events.EventBeatManager;
|
|
57
57
|
import com.facebook.react.fabric.events.EventEmitterWrapper;
|
|
58
58
|
import com.facebook.react.fabric.events.FabricEventEmitter;
|
|
59
|
+
import com.facebook.react.fabric.interop.InteropEventEmitter;
|
|
59
60
|
import com.facebook.react.fabric.mounting.MountItemDispatcher;
|
|
60
61
|
import com.facebook.react.fabric.mounting.MountingManager;
|
|
61
62
|
import com.facebook.react.fabric.mounting.SurfaceMountingManager;
|
|
@@ -81,6 +82,7 @@ import com.facebook.react.uimanager.ViewManagerRegistry;
|
|
|
81
82
|
import com.facebook.react.uimanager.events.EventCategoryDef;
|
|
82
83
|
import com.facebook.react.uimanager.events.EventDispatcher;
|
|
83
84
|
import com.facebook.react.uimanager.events.EventDispatcherImpl;
|
|
85
|
+
import com.facebook.react.uimanager.events.RCTEventEmitter;
|
|
84
86
|
import com.facebook.react.views.text.TextLayoutManager;
|
|
85
87
|
import com.facebook.react.views.text.TextLayoutManagerMapBuffer;
|
|
86
88
|
import java.util.HashMap;
|
|
@@ -390,6 +392,11 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
|
|
390
392
|
|
|
391
393
|
ReactMarker.addFabricListener(mDevToolsReactPerfLogger);
|
|
392
394
|
}
|
|
395
|
+
if (ReactFeatureFlags.unstable_useFabricInterop) {
|
|
396
|
+
InteropEventEmitter interopEventEmitter = new InteropEventEmitter(mReactApplicationContext);
|
|
397
|
+
mReactApplicationContext.internal_registerInteropModule(
|
|
398
|
+
RCTEventEmitter.class, interopEventEmitter);
|
|
399
|
+
}
|
|
393
400
|
}
|
|
394
401
|
|
|
395
402
|
// This is called on the JS thread (see CatalystInstanceImpl).
|
|
@@ -1171,6 +1178,20 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
|
|
1171
1178
|
}
|
|
1172
1179
|
|
|
1173
1180
|
private class MountItemDispatchListener implements MountItemDispatcher.ItemDispatchListener {
|
|
1181
|
+
@Override
|
|
1182
|
+
public void willMountItems() {
|
|
1183
|
+
for (UIManagerListener listener : mListeners) {
|
|
1184
|
+
listener.willMountItems(FabricUIManager.this);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
@Override
|
|
1189
|
+
public void didMountItems() {
|
|
1190
|
+
for (UIManagerListener listener : mListeners) {
|
|
1191
|
+
listener.didMountItems(FabricUIManager.this);
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1174
1195
|
@Override
|
|
1175
1196
|
public void didDispatchMountItems() {
|
|
1176
1197
|
for (UIManagerListener listener : mListeners) {
|
|
@@ -0,0 +1,41 @@
|
|
|
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.fabric.interop;
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Nullable;
|
|
11
|
+
import com.facebook.react.bridge.WritableMap;
|
|
12
|
+
import com.facebook.react.common.annotations.VisibleForTesting;
|
|
13
|
+
import com.facebook.react.uimanager.events.Event;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* An {@link Event} class used by the {@link InteropEventEmitter}. This class is just holding the
|
|
17
|
+
* event name and the data which is received by the `receiveEvent` method and will be passed over
|
|
18
|
+
* the the {@link com.facebook.react.uimanager.events.EventDispatcher}
|
|
19
|
+
*/
|
|
20
|
+
class InteropEvent extends Event<InteropEvent> {
|
|
21
|
+
|
|
22
|
+
private final String mName;
|
|
23
|
+
private final WritableMap mEventData;
|
|
24
|
+
|
|
25
|
+
InteropEvent(String name, @Nullable WritableMap eventData, int surfaceId, int viewTag) {
|
|
26
|
+
super(surfaceId, viewTag);
|
|
27
|
+
mName = name;
|
|
28
|
+
mEventData = eventData;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@Override
|
|
32
|
+
public String getEventName() {
|
|
33
|
+
return mName;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Override
|
|
37
|
+
@VisibleForTesting
|
|
38
|
+
public WritableMap getEventData() {
|
|
39
|
+
return mEventData;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
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.fabric.interop;
|
|
9
|
+
|
|
10
|
+
import androidx.annotation.Nullable;
|
|
11
|
+
import com.facebook.react.bridge.ReactContext;
|
|
12
|
+
import com.facebook.react.bridge.WritableArray;
|
|
13
|
+
import com.facebook.react.bridge.WritableMap;
|
|
14
|
+
import com.facebook.react.common.annotations.VisibleForTesting;
|
|
15
|
+
import com.facebook.react.uimanager.UIManagerHelper;
|
|
16
|
+
import com.facebook.react.uimanager.events.EventDispatcher;
|
|
17
|
+
import com.facebook.react.uimanager.events.RCTEventEmitter;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* A reimplementation of {@link RCTEventEmitter} which is using a {@link EventDispatcher} under the
|
|
21
|
+
* hood.
|
|
22
|
+
*
|
|
23
|
+
* <p>On Fabric, you're supposed to use {@link EventDispatcher} to dispatch events. However, we
|
|
24
|
+
* provide an interop layer for non-Fabric migrated components.
|
|
25
|
+
*
|
|
26
|
+
* <p>This instance will be returned if the user is invoking `context.getJsModule(RCTEventEmitter)
|
|
27
|
+
* and is providing support for the `receiveEvent` method, so that non-Fabric ViewManagers can
|
|
28
|
+
* continue to deliver events also when Fabric is turned on.
|
|
29
|
+
*/
|
|
30
|
+
public class InteropEventEmitter implements RCTEventEmitter {
|
|
31
|
+
|
|
32
|
+
private final ReactContext mReactContext;
|
|
33
|
+
|
|
34
|
+
private @Nullable EventDispatcher mEventDispatcherOverride;
|
|
35
|
+
|
|
36
|
+
public InteropEventEmitter(ReactContext reactContext) {
|
|
37
|
+
mReactContext = reactContext;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Override
|
|
41
|
+
public void receiveEvent(int targetReactTag, String eventName, @Nullable WritableMap eventData) {
|
|
42
|
+
EventDispatcher dispatcher;
|
|
43
|
+
if (mEventDispatcherOverride != null) {
|
|
44
|
+
dispatcher = mEventDispatcherOverride;
|
|
45
|
+
} else {
|
|
46
|
+
dispatcher = UIManagerHelper.getEventDispatcherForReactTag(mReactContext, targetReactTag);
|
|
47
|
+
}
|
|
48
|
+
int surfaceId = UIManagerHelper.getSurfaceId(mReactContext);
|
|
49
|
+
if (dispatcher != null) {
|
|
50
|
+
dispatcher.dispatchEvent(new InteropEvent(eventName, eventData, surfaceId, targetReactTag));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@Override
|
|
55
|
+
public void receiveTouches(
|
|
56
|
+
String eventName, WritableArray touches, WritableArray changedIndices) {
|
|
57
|
+
throw new UnsupportedOperationException(
|
|
58
|
+
"EventEmitter#receiveTouches is not supported by the Fabric Interop Layer");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@VisibleForTesting
|
|
62
|
+
void overrideEventDispatcher(EventDispatcher eventDispatcherOverride) {
|
|
63
|
+
mEventDispatcherOverride = eventDispatcherOverride;
|
|
64
|
+
}
|
|
65
|
+
}
|
package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java
CHANGED
|
@@ -193,6 +193,8 @@ public class MountItemDispatcher {
|
|
|
193
193
|
return false;
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
+
mItemDispatchListener.willMountItems();
|
|
197
|
+
|
|
196
198
|
// As an optimization, execute all ViewCommands first
|
|
197
199
|
// This should be:
|
|
198
200
|
// 1) Performant: ViewCommands are often a replacement for SetNativeProps, which we've always
|
|
@@ -299,6 +301,9 @@ public class MountItemDispatcher {
|
|
|
299
301
|
}
|
|
300
302
|
mBatchedExecutionTime += SystemClock.uptimeMillis() - batchedExecutionStartTime;
|
|
301
303
|
}
|
|
304
|
+
|
|
305
|
+
mItemDispatchListener.didMountItems();
|
|
306
|
+
|
|
302
307
|
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE);
|
|
303
308
|
|
|
304
309
|
return true;
|
|
@@ -415,6 +420,10 @@ public class MountItemDispatcher {
|
|
|
415
420
|
}
|
|
416
421
|
|
|
417
422
|
public interface ItemDispatchListener {
|
|
423
|
+
void willMountItems();
|
|
424
|
+
|
|
425
|
+
void didMountItems();
|
|
426
|
+
|
|
418
427
|
void didDispatchMountItems();
|
|
419
428
|
}
|
|
420
429
|
}
|
|
@@ -50,6 +50,7 @@ public class ThemedReactContext extends ReactContext {
|
|
|
50
50
|
if (reactApplicationContext.hasCatalystInstance()) {
|
|
51
51
|
initializeWithInstance(reactApplicationContext.getCatalystInstance());
|
|
52
52
|
}
|
|
53
|
+
initializeInteropModules(reactApplicationContext);
|
|
53
54
|
mReactApplicationContext = reactApplicationContext;
|
|
54
55
|
mModuleName = moduleName;
|
|
55
56
|
mSurfaceId = surfaceId;
|
package/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModuleConstantsHelper.java
CHANGED
|
@@ -10,11 +10,15 @@ package com.facebook.react.uimanager;
|
|
|
10
10
|
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
|
|
11
11
|
|
|
12
12
|
import androidx.annotation.Nullable;
|
|
13
|
+
import androidx.annotation.VisibleForTesting;
|
|
13
14
|
import com.facebook.react.common.MapBuilder;
|
|
15
|
+
import com.facebook.react.config.ReactFeatureFlags;
|
|
14
16
|
import com.facebook.systrace.SystraceMessage;
|
|
15
17
|
import java.util.ArrayList;
|
|
18
|
+
import java.util.HashSet;
|
|
16
19
|
import java.util.List;
|
|
17
20
|
import java.util.Map;
|
|
21
|
+
import java.util.Set;
|
|
18
22
|
|
|
19
23
|
/**
|
|
20
24
|
* Helps generate constants map for {@link UIManagerModule} by collecting and merging constants from
|
|
@@ -113,6 +117,13 @@ import java.util.Map;
|
|
|
113
117
|
|
|
114
118
|
Map viewManagerBubblingEvents = viewManager.getExportedCustomBubblingEventTypeConstants();
|
|
115
119
|
if (viewManagerBubblingEvents != null) {
|
|
120
|
+
|
|
121
|
+
if (ReactFeatureFlags.enableFabricRenderer && ReactFeatureFlags.unstable_useFabricInterop) {
|
|
122
|
+
// For Fabric, events needs to be fired with a "top" prefix.
|
|
123
|
+
// For the sake of Fabric Interop, here we normalize events adding "top" in their
|
|
124
|
+
// name if the user hasn't provided it.
|
|
125
|
+
normalizeEventTypes(viewManagerBubblingEvents);
|
|
126
|
+
}
|
|
116
127
|
recursiveMerge(cumulativeBubblingEventTypes, viewManagerBubblingEvents);
|
|
117
128
|
recursiveMerge(viewManagerBubblingEvents, defaultBubblingEvents);
|
|
118
129
|
viewManagerConstants.put(BUBBLING_EVENTS_KEY, viewManagerBubblingEvents);
|
|
@@ -145,6 +156,27 @@ import java.util.Map;
|
|
|
145
156
|
return viewManagerConstants;
|
|
146
157
|
}
|
|
147
158
|
|
|
159
|
+
@VisibleForTesting
|
|
160
|
+
/* package */ static void normalizeEventTypes(Map events) {
|
|
161
|
+
if (events == null) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
Set<String> keysToNormalize = new HashSet<>();
|
|
165
|
+
for (Object key : events.keySet()) {
|
|
166
|
+
if (key instanceof String) {
|
|
167
|
+
String keyString = (String) key;
|
|
168
|
+
if (!keyString.startsWith("top")) {
|
|
169
|
+
keysToNormalize.add(keyString);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
for (String oldKey : keysToNormalize) {
|
|
174
|
+
Object value = events.get(oldKey);
|
|
175
|
+
String newKey = "top" + oldKey.substring(0, 1).toUpperCase() + oldKey.substring(1);
|
|
176
|
+
events.put(newKey, value);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
148
180
|
/** Merges {@param source} map into {@param dest} map recursively */
|
|
149
181
|
private static void recursiveMerge(@Nullable Map dest, @Nullable Map source) {
|
|
150
182
|
if (dest == null || source == null || source.isEmpty()) {
|
|
@@ -18,6 +18,7 @@ import com.facebook.react.bridge.UIManager;
|
|
|
18
18
|
import com.facebook.react.bridge.UIManagerListener;
|
|
19
19
|
import com.facebook.react.bridge.UiThreadUtil;
|
|
20
20
|
import com.facebook.react.uimanager.UIManagerHelper;
|
|
21
|
+
import com.facebook.react.uimanager.common.UIManagerType;
|
|
21
22
|
import com.facebook.react.uimanager.common.ViewUtil;
|
|
22
23
|
import com.facebook.react.views.scroll.ReactScrollViewHelper.HasSmoothScroll;
|
|
23
24
|
import com.facebook.react.views.view.ReactViewGroup;
|
|
@@ -89,6 +90,14 @@ public class MaintainVisibleScrollPositionHelper<ScrollViewT extends ViewGroup &
|
|
|
89
90
|
* been updated.
|
|
90
91
|
*/
|
|
91
92
|
public void updateScrollPosition() {
|
|
93
|
+
// On Fabric this will be called internally in `didMountItems`.
|
|
94
|
+
if (ViewUtil.getUIManagerType(mScrollView.getId()) == UIManagerType.FABRIC) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
updateScrollPositionInternal();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
private void updateScrollPositionInternal() {
|
|
92
101
|
if (mConfig == null || mFirstVisibleView == null || mPrevFirstVisibleFrame == null) {
|
|
93
102
|
return;
|
|
94
103
|
}
|
|
@@ -169,6 +178,16 @@ public class MaintainVisibleScrollPositionHelper<ScrollViewT extends ViewGroup &
|
|
|
169
178
|
});
|
|
170
179
|
}
|
|
171
180
|
|
|
181
|
+
@Override
|
|
182
|
+
public void willMountItems(UIManager uiManager) {
|
|
183
|
+
computeTargetView();
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@Override
|
|
187
|
+
public void didMountItems(UIManager uiManager) {
|
|
188
|
+
updateScrollPositionInternal();
|
|
189
|
+
}
|
|
190
|
+
|
|
172
191
|
@Override
|
|
173
192
|
public void didDispatchMountItems(UIManager uiManager) {
|
|
174
193
|
// noop
|
|
@@ -369,21 +369,6 @@ void YogaLayoutableShadowNode::updateYogaProps() {
|
|
|
369
369
|
YGStyle result{baseStyle};
|
|
370
370
|
|
|
371
371
|
// Aliases with precedence
|
|
372
|
-
if (!props.inset.isUndefined()) {
|
|
373
|
-
result.position()[YGEdgeAll] = props.inset;
|
|
374
|
-
}
|
|
375
|
-
if (!props.insetBlock.isUndefined()) {
|
|
376
|
-
result.position()[YGEdgeVertical] = props.insetBlock;
|
|
377
|
-
}
|
|
378
|
-
if (!props.insetInline.isUndefined()) {
|
|
379
|
-
result.position()[YGEdgeHorizontal] = props.insetInline;
|
|
380
|
-
}
|
|
381
|
-
if (!props.insetInlineEnd.isUndefined()) {
|
|
382
|
-
result.position()[YGEdgeEnd] = props.insetInlineEnd;
|
|
383
|
-
}
|
|
384
|
-
if (!props.insetInlineStart.isUndefined()) {
|
|
385
|
-
result.position()[YGEdgeStart] = props.insetInlineStart;
|
|
386
|
-
}
|
|
387
372
|
if (!props.marginInline.isUndefined()) {
|
|
388
373
|
result.margin()[YGEdgeHorizontal] = props.marginInline;
|
|
389
374
|
}
|
|
@@ -410,12 +395,6 @@ void YogaLayoutableShadowNode::updateYogaProps() {
|
|
|
410
395
|
}
|
|
411
396
|
|
|
412
397
|
// Aliases without precedence
|
|
413
|
-
if (CompactValue(result.position()[YGEdgeBottom]).isUndefined()) {
|
|
414
|
-
result.position()[YGEdgeBottom] = props.insetBlockEnd;
|
|
415
|
-
}
|
|
416
|
-
if (CompactValue(result.position()[YGEdgeTop]).isUndefined()) {
|
|
417
|
-
result.position()[YGEdgeTop] = props.insetBlockStart;
|
|
418
|
-
}
|
|
419
398
|
if (CompactValue(result.margin()[YGEdgeTop]).isUndefined()) {
|
|
420
399
|
result.margin()[YGEdgeTop] = props.marginBlockStart;
|
|
421
400
|
}
|
|
@@ -136,13 +136,6 @@ void YogaStylableProps::setProp(
|
|
|
136
136
|
static const auto defaults = YogaStylableProps{};
|
|
137
137
|
|
|
138
138
|
// Aliases
|
|
139
|
-
RAW_SET_PROP_SWITCH_CASE(inset, "inset");
|
|
140
|
-
RAW_SET_PROP_SWITCH_CASE(insetBlock, "insetBlock");
|
|
141
|
-
RAW_SET_PROP_SWITCH_CASE(insetBlockEnd, "insetBlockEnd");
|
|
142
|
-
RAW_SET_PROP_SWITCH_CASE(insetBlockStart, "insetBlockStart");
|
|
143
|
-
RAW_SET_PROP_SWITCH_CASE(insetInline, "insetInline");
|
|
144
|
-
RAW_SET_PROP_SWITCH_CASE(insetInlineEnd, "insetInlineEnd");
|
|
145
|
-
RAW_SET_PROP_SWITCH_CASE(insetInlineStart, "insetInlineStart");
|
|
146
139
|
RAW_SET_PROP_SWITCH_CASE(marginInline, "marginInline");
|
|
147
140
|
RAW_SET_PROP_SWITCH_CASE(marginInlineStart, "marginInlineStart");
|
|
148
141
|
RAW_SET_PROP_SWITCH_CASE(marginInlineEnd, "marginInlineEnd");
|
|
@@ -242,48 +235,6 @@ void YogaStylableProps::convertRawPropAliases(
|
|
|
242
235
|
const PropsParserContext &context,
|
|
243
236
|
YogaStylableProps const &sourceProps,
|
|
244
237
|
RawProps const &rawProps) {
|
|
245
|
-
inset = convertRawProp(
|
|
246
|
-
context,
|
|
247
|
-
rawProps,
|
|
248
|
-
"inset",
|
|
249
|
-
sourceProps.inset,
|
|
250
|
-
CompactValue::ofUndefined());
|
|
251
|
-
insetBlock = convertRawProp(
|
|
252
|
-
context,
|
|
253
|
-
rawProps,
|
|
254
|
-
"insetBlock",
|
|
255
|
-
sourceProps.insetBlock,
|
|
256
|
-
CompactValue::ofUndefined());
|
|
257
|
-
insetBlockEnd = convertRawProp(
|
|
258
|
-
context,
|
|
259
|
-
rawProps,
|
|
260
|
-
"insetBlockEnd",
|
|
261
|
-
sourceProps.insetBlockEnd,
|
|
262
|
-
CompactValue::ofUndefined());
|
|
263
|
-
insetBlockStart = convertRawProp(
|
|
264
|
-
context,
|
|
265
|
-
rawProps,
|
|
266
|
-
"insetBlockStart",
|
|
267
|
-
sourceProps.insetBlockStart,
|
|
268
|
-
CompactValue::ofUndefined());
|
|
269
|
-
insetInline = convertRawProp(
|
|
270
|
-
context,
|
|
271
|
-
rawProps,
|
|
272
|
-
"insetInline",
|
|
273
|
-
sourceProps.insetInline,
|
|
274
|
-
CompactValue::ofUndefined());
|
|
275
|
-
insetInlineEnd = convertRawProp(
|
|
276
|
-
context,
|
|
277
|
-
rawProps,
|
|
278
|
-
"insetInlineEnd",
|
|
279
|
-
sourceProps.insetInlineEnd,
|
|
280
|
-
CompactValue::ofUndefined());
|
|
281
|
-
insetInlineStart = convertRawProp(
|
|
282
|
-
context,
|
|
283
|
-
rawProps,
|
|
284
|
-
"insetInlineStart",
|
|
285
|
-
sourceProps.insetInlineStart,
|
|
286
|
-
CompactValue::ofUndefined());
|
|
287
238
|
marginInline = convertRawProp(
|
|
288
239
|
context,
|
|
289
240
|
rawProps,
|
|
@@ -43,11 +43,6 @@ class YogaStylableProps : public Props {
|
|
|
43
43
|
|
|
44
44
|
// Duplicates of existing properties with different names, taking
|
|
45
45
|
// precedence. E.g. "marginBlock" instead of "marginVertical"
|
|
46
|
-
CompactValue inset;
|
|
47
|
-
CompactValue insetInline;
|
|
48
|
-
CompactValue insetInlineEnd;
|
|
49
|
-
CompactValue insetInlineStart;
|
|
50
|
-
|
|
51
46
|
CompactValue marginInline;
|
|
52
47
|
CompactValue marginInlineStart;
|
|
53
48
|
CompactValue marginInlineEnd;
|
|
@@ -61,10 +56,6 @@ class YogaStylableProps : public Props {
|
|
|
61
56
|
// BlockEnd/BlockStart map to top/bottom (no writing mode), but we preserve
|
|
62
57
|
// Yoga's precedence and prefer specific edges (e.g. top) to ones which are
|
|
63
58
|
// flow relative (e.g. blockStart).
|
|
64
|
-
CompactValue insetBlock;
|
|
65
|
-
CompactValue insetBlockEnd;
|
|
66
|
-
CompactValue insetBlockStart;
|
|
67
|
-
|
|
68
59
|
CompactValue marginBlockStart;
|
|
69
60
|
CompactValue marginBlockEnd;
|
|
70
61
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native",
|
|
3
|
-
"version": "0.72.0-rc.
|
|
3
|
+
"version": "0.72.0-rc.2",
|
|
4
4
|
"bin": "./cli.js",
|
|
5
5
|
"description": "A framework for building native apps using React",
|
|
6
6
|
"license": "MIT",
|
|
@@ -79,9 +79,9 @@
|
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@jest/create-cache-key-function": "^29.2.1",
|
|
82
|
-
"@react-native-community/cli": "11.
|
|
83
|
-
"@react-native-community/cli-platform-android": "11.
|
|
84
|
-
"@react-native-community/cli-platform-ios": "11.
|
|
82
|
+
"@react-native-community/cli": "11.2.1",
|
|
83
|
+
"@react-native-community/cli-platform-android": "11.2.1",
|
|
84
|
+
"@react-native-community/cli-platform-ios": "11.2.1",
|
|
85
85
|
"@react-native/assets-registry": "^0.72.0",
|
|
86
86
|
"@react-native/codegen": "^0.72.4",
|
|
87
87
|
"@react-native/gradle-plugin": "^0.72.6",
|
|
@@ -91,15 +91,15 @@
|
|
|
91
91
|
"abort-controller": "^3.0.0",
|
|
92
92
|
"anser": "^1.4.9",
|
|
93
93
|
"base64-js": "^1.1.2",
|
|
94
|
-
"deprecated-react-native-prop-types": "
|
|
94
|
+
"deprecated-react-native-prop-types": "4.1.0",
|
|
95
95
|
"event-target-shim": "^5.0.1",
|
|
96
96
|
"flow-enums-runtime": "^0.0.5",
|
|
97
97
|
"invariant": "^2.2.4",
|
|
98
98
|
"jest-environment-node": "^29.2.1",
|
|
99
99
|
"jsc-android": "^250231.0.0",
|
|
100
100
|
"memoize-one": "^5.0.0",
|
|
101
|
-
"metro-runtime": "0.76.
|
|
102
|
-
"metro-source-map": "0.76.
|
|
101
|
+
"metro-runtime": "0.76.2",
|
|
102
|
+
"metro-source-map": "0.76.2",
|
|
103
103
|
"mkdirp": "^0.5.1",
|
|
104
104
|
"nullthrows": "^1.1.1",
|
|
105
105
|
"pretty-format": "^26.5.2",
|
|
@@ -105,7 +105,9 @@ class JSEngineTests < Test::Unit::TestCase
|
|
|
105
105
|
assert_equal($podInvocation["React-jsi"][:path], "../../ReactCommon/jsi")
|
|
106
106
|
assert_equal($podInvocation["React-hermes"][:path], "../../ReactCommon/hermes")
|
|
107
107
|
assert_equal($podInvocation["libevent"][:version], "~> 2.1.12")
|
|
108
|
-
|
|
108
|
+
hermes_engine_pod_invocation = $podInvocation["hermes-engine"]
|
|
109
|
+
assert_equal(hermes_engine_pod_invocation[:podspec], "../../sdks/hermes-engine/hermes-engine.podspec")
|
|
110
|
+
assert_equal(hermes_engine_pod_invocation[:tag], "")
|
|
109
111
|
end
|
|
110
112
|
|
|
111
113
|
def test_setupHermes_installsPods_installsFabricSubspecWhenFabricEnabled
|
|
@@ -118,7 +120,9 @@ class JSEngineTests < Test::Unit::TestCase
|
|
|
118
120
|
# Assert
|
|
119
121
|
assert_equal($podInvocationCount, 4)
|
|
120
122
|
assert_equal($podInvocation["React-jsi"][:path], "../../ReactCommon/jsi")
|
|
121
|
-
|
|
123
|
+
hermes_engine_pod_invocation = $podInvocation["hermes-engine"]
|
|
124
|
+
assert_equal(hermes_engine_pod_invocation[:podspec], "../../sdks/hermes-engine/hermes-engine.podspec")
|
|
125
|
+
assert_equal(hermes_engine_pod_invocation[:tag], "")
|
|
122
126
|
assert_equal($podInvocation["React-hermes"][:path], "../../ReactCommon/hermes")
|
|
123
127
|
assert_equal($podInvocation["libevent"][:version], "~> 2.1.12")
|
|
124
128
|
end
|
|
@@ -26,7 +26,7 @@ def podSpy_cleanUp
|
|
|
26
26
|
$podInvocationCount = 0
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def pod(name, version = nil, path: nil, configurations: nil, modular_headers: nil, podspec: nil)
|
|
29
|
+
def pod(name, version = nil, path: nil, configurations: nil, modular_headers: nil, podspec: nil, tag: nil)
|
|
30
30
|
$podInvocationCount += 1
|
|
31
31
|
params = {}
|
|
32
32
|
if version != nil then params[:version] = version end
|
|
@@ -34,5 +34,6 @@ def pod(name, version = nil, path: nil, configurations: nil, modular_headers: ni
|
|
|
34
34
|
if configurations != nil then params[:configurations] = configurations end
|
|
35
35
|
if modular_headers != nil then params[:modular_headers] = modular_headers end
|
|
36
36
|
if podspec != nil then params[:podspec] = podspec end
|
|
37
|
+
if tag != nil then params[:tag] = tag end
|
|
37
38
|
$podInvocation[name] = params
|
|
38
39
|
end
|
|
@@ -30,7 +30,12 @@ def setup_hermes!(react_native_path: "../node_modules/react-native", fabric_enab
|
|
|
30
30
|
abort unless prep_status == 0
|
|
31
31
|
|
|
32
32
|
pod 'React-jsi', :path => "#{react_native_path}/ReactCommon/jsi"
|
|
33
|
-
|
|
33
|
+
# This `:tag => hermestag` below is only to tell CocoaPods to update hermes-engine when React Native version changes.
|
|
34
|
+
# We have custom logic to compute the source for hermes-engine. See sdks/hermes-engine/*
|
|
35
|
+
hermestag_file = File.join(react_native_path, "sdks", ".hermesversion")
|
|
36
|
+
hermestag = File.exist?(hermestag_file) ? File.read(hermestag_file).strip : ''
|
|
37
|
+
|
|
38
|
+
pod 'hermes-engine', :podspec => "#{react_native_path}/sdks/hermes-engine/hermes-engine.podspec", :tag => hermestag
|
|
34
39
|
pod 'React-hermes', :path => "#{react_native_path}/ReactCommon/hermes"
|
|
35
40
|
pod 'libevent', '~> 2.1.12'
|
|
36
41
|
end
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,10 @@
|
|
|
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
|
+
|
|
1
8
|
apply plugin: "com.android.application"
|
|
2
9
|
apply plugin: "com.facebook.react"
|
|
3
10
|
|
|
@@ -107,8 +114,6 @@ dependencies {
|
|
|
107
114
|
// The version of react-native is set by the React Native Gradle Plugin
|
|
108
115
|
implementation("com.facebook.react:react-android")
|
|
109
116
|
|
|
110
|
-
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
|
|
111
|
-
|
|
112
117
|
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
|
|
113
118
|
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
|
|
114
119
|
exclude group:'com.squareup.okhttp3', module:'okhttp'
|
package/template/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"react": "18.2.0",
|
|
14
|
-
"react-native": "0.72.0-rc.
|
|
14
|
+
"react-native": "0.72.0-rc.2"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
17
|
"@babel/core": "^7.20.0",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"@babel/runtime": "^7.12.5",
|
|
20
20
|
"@react-native/eslint-config": "^0.72.1",
|
|
21
21
|
"@react-native/metro-config": "^0.72.1",
|
|
22
|
-
"@tsconfig/react-native": "^
|
|
23
|
-
"@types/metro-config": "^0.76.
|
|
22
|
+
"@tsconfig/react-native": "^3.0.0",
|
|
23
|
+
"@types/metro-config": "^0.76.2",
|
|
24
24
|
"@types/react": "^18.0.24",
|
|
25
25
|
"@types/react-test-renderer": "^18.0.0",
|
|
26
26
|
"babel-jest": "^29.2.1",
|
|
27
27
|
"eslint": "^8.19.0",
|
|
28
28
|
"jest": "^29.2.1",
|
|
29
|
-
"metro-react-native-babel-preset": "0.76.
|
|
29
|
+
"metro-react-native-babel-preset": "0.76.2",
|
|
30
30
|
"prettier": "^2.4.1",
|
|
31
31
|
"react-test-renderer": "18.2.0",
|
|
32
32
|
"typescript": "4.8.4"
|
package/types/index.d.ts
CHANGED
|
@@ -147,6 +147,10 @@ export * from '../Libraries/Utilities/Platform';
|
|
|
147
147
|
export * from '../Libraries/Vibration/Vibration';
|
|
148
148
|
export * from '../Libraries/YellowBox/YellowBoxDeprecated';
|
|
149
149
|
export * from '../Libraries/vendor/core/ErrorUtils';
|
|
150
|
+
export {
|
|
151
|
+
EmitterSubscription,
|
|
152
|
+
EventSubscription,
|
|
153
|
+
} from '../Libraries/vendor/emitter/EventEmitter';
|
|
150
154
|
|
|
151
155
|
export * from './public/DeprecatedPropertiesAlias';
|
|
152
156
|
export * from './public/Insets';
|