react-native 0.76.5 → 0.76.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Libraries/AppDelegate/RCTAppDelegate.mm +0 -5
- package/Libraries/AppDelegate/RCTAppSetupUtils.mm +3 -1
- package/Libraries/AppDelegate/RCTRootViewFactory.mm +2 -3
- package/Libraries/Core/ReactNativeVersion.js +1 -1
- package/Libraries/Image/RCTImageLoader.mm +9 -1
- package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +1 -1
- package/Libraries/Utilities/Appearance.js +3 -1
- package/React/Base/RCTVersion.m +1 -1
- package/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +2 -5
- package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +4 -0
- package/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm +12 -9
- package/ReactAndroid/api/ReactAndroid.api +2 -0
- package/ReactAndroid/cmake-utils/ReactNative-application.cmake +18 -3
- package/ReactAndroid/gradle.properties +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountingManager.java +15 -8
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +1 -7
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +1 -11
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +1 -12
- package/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +1 -3
- package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
- package/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +16 -2
- package/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +1 -0
- package/ReactAndroid/src/main/jni/react/fabric/Binding.cpp +17 -19
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +1 -15
- package/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +1 -4
- package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +1 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +1 -6
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +47 -65
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +2 -4
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +1 -5
- package/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +1 -2
- package/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTInteropTurboModule.mm +9 -0
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +1 -6
- package/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +1 -3
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.cpp +5 -0
- package/ReactCommon/react/renderer/attributedstring/TextAttributes.h +2 -0
- package/ReactCommon/react/renderer/attributedstring/conversions.h +5 -0
- package/ReactCommon/react/renderer/components/text/BaseTextProps.cpp +12 -0
- package/ReactCommon/react/renderer/textlayoutmanager/TextMeasureCache.h +2 -3
- package/ReactCommon/react/renderer/textlayoutmanager/platform/ios/react/renderer/textlayoutmanager/RCTAttributedTextUtils.mm +7 -3
- package/gradle/libs.versions.toml +1 -1
- package/package.json +8 -8
- package/scripts/cocoapods/utils.rb +6 -6
- package/scripts/codegen/generate-artifacts-executor.js +6 -6
- package/sdks/hermesc/linux64-bin/hermesc +0 -0
- package/sdks/hermesc/osx-bin/hermes +0 -0
- package/sdks/hermesc/osx-bin/hermesc +0 -0
- package/sdks/hermesc/win64-bin/hermesc.exe +0 -0
- package/src/private/featureflags/ReactNativeFeatureFlags.js +1 -6
- package/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +1 -2
|
@@ -81,11 +81,6 @@
|
|
|
81
81
|
[_window makeKeyAndVisible];
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
- (void)applicationDidEnterBackground:(UIApplication *)application
|
|
85
|
-
{
|
|
86
|
-
// Noop
|
|
87
|
-
}
|
|
88
|
-
|
|
89
84
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
|
90
85
|
{
|
|
91
86
|
[NSException raise:@"RCTBridgeDelegate::sourceURLForBridge not implemented"
|
|
@@ -53,7 +53,9 @@ RCTAppSetupDefaultRootView(RCTBridge *bridge, NSString *moduleName, NSDictionary
|
|
|
53
53
|
id<RCTSurfaceProtocol> surface = [[RCTFabricSurface alloc] initWithBridge:bridge
|
|
54
54
|
moduleName:moduleName
|
|
55
55
|
initialProperties:initialProperties];
|
|
56
|
-
|
|
56
|
+
UIView *rootView = [[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
|
|
57
|
+
[surface start];
|
|
58
|
+
return rootView;
|
|
57
59
|
}
|
|
58
60
|
return [[RCTRootView alloc] initWithBridge:bridge moduleName:moduleName initialProperties:initialProperties];
|
|
59
61
|
}
|
|
@@ -159,9 +159,8 @@ static NSDictionary *updateInitialProps(NSDictionary *initialProps, BOOL isFabri
|
|
|
159
159
|
|
|
160
160
|
RCTFabricSurface *surface = [self.reactHost createSurfaceWithModuleName:moduleName initialProperties:initProps];
|
|
161
161
|
|
|
162
|
-
RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView =
|
|
163
|
-
initWithSurface:surface
|
|
164
|
-
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
|
|
162
|
+
RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView =
|
|
163
|
+
[[RCTSurfaceHostingProxyRootView alloc] initWithSurface:surface];
|
|
165
164
|
|
|
166
165
|
surfaceHostingProxyRootView.backgroundColor = [UIColor systemBackgroundColor];
|
|
167
166
|
if (self->_configuration.customizeRootView != nil) {
|
|
@@ -477,7 +477,15 @@ static UIImage *RCTResizeImageIfNeeded(UIImage *image, CGSize size, CGFloat scal
|
|
|
477
477
|
|
|
478
478
|
// Add missing png extension
|
|
479
479
|
if (request.URL.fileURL && request.URL.pathExtension.length == 0) {
|
|
480
|
-
|
|
480
|
+
// Check if there exists a file with that url on disk already
|
|
481
|
+
// This should fix issue https://github.com/facebook/react-native/issues/46870
|
|
482
|
+
if ([[NSFileManager defaultManager] fileExistsAtPath:request.URL.path]) {
|
|
483
|
+
mutableRequest.URL = request.URL;
|
|
484
|
+
} else {
|
|
485
|
+
// This is the default behavior in case there is no file on disk with no extension.
|
|
486
|
+
// We assume that the extension is `png`.
|
|
487
|
+
mutableRequest.URL = [request.URL URLByAppendingPathExtension:@"png"];
|
|
488
|
+
}
|
|
481
489
|
}
|
|
482
490
|
if (_redirectDelegate != nil) {
|
|
483
491
|
mutableRequest.URL = [_redirectDelegate redirectAssetsURL:mutableRequest.URL];
|
|
@@ -457,7 +457,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
|
457
457
|
_maxLength.integerValue - (NSInteger)backedTextInputView.attributedText.string.length + (NSInteger)range.length,
|
|
458
458
|
0);
|
|
459
459
|
|
|
460
|
-
if (text.length >
|
|
460
|
+
if (text.length > allowedLength) {
|
|
461
461
|
// If we typed/pasted more than one character, limit the text inputted.
|
|
462
462
|
if (text.length > 1) {
|
|
463
463
|
if (allowedLength > 0) {
|
|
@@ -105,7 +105,9 @@ export function setColorScheme(colorScheme: ?ColorSchemeName): void {
|
|
|
105
105
|
const {NativeAppearance} = state;
|
|
106
106
|
if (NativeAppearance != null) {
|
|
107
107
|
NativeAppearance.setColorScheme(colorScheme ?? 'unspecified');
|
|
108
|
-
state.appearance = {
|
|
108
|
+
state.appearance = {
|
|
109
|
+
colorScheme: toColorScheme(NativeAppearance.getColorScheme()),
|
|
110
|
+
};
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
|
package/React/Base/RCTVersion.m
CHANGED
|
@@ -53,11 +53,8 @@ static RCTRootViewSizeFlexibility convertToRootViewSizeFlexibility(RCTSurfaceSiz
|
|
|
53
53
|
|
|
54
54
|
- (instancetype)initWithSurface:(id<RCTSurfaceProtocol>)surface
|
|
55
55
|
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
[surface start];
|
|
59
|
-
}
|
|
60
|
-
return self;
|
|
56
|
+
return [super initWithSurface:surface
|
|
57
|
+
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
|
|
61
58
|
}
|
|
62
59
|
|
|
63
60
|
RCT_NOT_IMPLEMENTED(-(instancetype)initWithFrame : (CGRect)frame)
|
|
@@ -99,9 +99,11 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
99
99
|
NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
|
|
100
100
|
[_backedTextInputView.defaultTextAttributes mutableCopy];
|
|
101
101
|
|
|
102
|
+
#if !TARGET_OS_MACCATALYST
|
|
102
103
|
RCTWeakEventEmitterWrapper *eventEmitterWrapper = [RCTWeakEventEmitterWrapper new];
|
|
103
104
|
eventEmitterWrapper.eventEmitter = _eventEmitter;
|
|
104
105
|
defaultAttributes[RCTAttributedStringEventEmitterKey] = eventEmitterWrapper;
|
|
106
|
+
#endif
|
|
105
107
|
|
|
106
108
|
_backedTextInputView.defaultTextAttributes = defaultAttributes;
|
|
107
109
|
}
|
|
@@ -261,8 +263,10 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
|
|
261
263
|
if (newTextInputProps.textAttributes != oldTextInputProps.textAttributes) {
|
|
262
264
|
NSMutableDictionary<NSAttributedStringKey, id> *defaultAttributes =
|
|
263
265
|
RCTNSTextAttributesFromTextAttributes(newTextInputProps.getEffectiveTextAttributes(RCTFontSizeMultiplier()));
|
|
266
|
+
#if !TARGET_OS_MACCATALYST
|
|
264
267
|
defaultAttributes[RCTAttributedStringEventEmitterKey] =
|
|
265
268
|
_backedTextInputView.defaultTextAttributes[RCTAttributedStringEventEmitterKey];
|
|
269
|
+
#endif
|
|
266
270
|
_backedTextInputView.defaultTextAttributes = defaultAttributes;
|
|
267
271
|
}
|
|
268
272
|
|
|
@@ -1003,15 +1003,10 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
1003
1003
|
}
|
|
1004
1004
|
|
|
1005
1005
|
// clipping
|
|
1006
|
+
self.currentContainerView.layer.mask = nil;
|
|
1006
1007
|
if (self.currentContainerView.clipsToBounds) {
|
|
1007
1008
|
BOOL clipToPaddingBox = ReactNativeFeatureFlags::enableIOSViewClipToPaddingBox();
|
|
1008
|
-
if (clipToPaddingBox) {
|
|
1009
|
-
CALayer *maskLayer = [self createMaskLayer:RCTCGRectFromRect(_layoutMetrics.getPaddingFrame())
|
|
1010
|
-
cornerInsets:RCTGetCornerInsets(
|
|
1011
|
-
RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii),
|
|
1012
|
-
RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths))];
|
|
1013
|
-
self.currentContainerView.layer.mask = maskLayer;
|
|
1014
|
-
} else {
|
|
1009
|
+
if (!clipToPaddingBox) {
|
|
1015
1010
|
if (borderMetrics.borderRadii.isUniform()) {
|
|
1016
1011
|
self.currentContainerView.layer.cornerRadius = borderMetrics.borderRadii.topLeft.horizontal;
|
|
1017
1012
|
} else {
|
|
@@ -1033,9 +1028,17 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
|
|
1033
1028
|
subview.layer.mask = [self createMaskLayer:subview.bounds cornerInsets:cornerInsets];
|
|
1034
1029
|
}
|
|
1035
1030
|
}
|
|
1031
|
+
} else if (
|
|
1032
|
+
!borderMetrics.borderWidths.isUniform() || borderMetrics.borderWidths.left != 0 ||
|
|
1033
|
+
!borderMetrics.borderRadii.isUniform()) {
|
|
1034
|
+
CALayer *maskLayer = [self createMaskLayer:RCTCGRectFromRect(_layoutMetrics.getPaddingFrame())
|
|
1035
|
+
cornerInsets:RCTGetCornerInsets(
|
|
1036
|
+
RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii),
|
|
1037
|
+
RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths))];
|
|
1038
|
+
self.currentContainerView.layer.mask = maskLayer;
|
|
1039
|
+
} else {
|
|
1040
|
+
self.currentContainerView.layer.cornerRadius = borderMetrics.borderRadii.topLeft.horizontal;
|
|
1036
1041
|
}
|
|
1037
|
-
} else {
|
|
1038
|
-
self.currentContainerView.layer.mask = nil;
|
|
1039
1042
|
}
|
|
1040
1043
|
}
|
|
1041
1044
|
|
|
@@ -7859,6 +7859,7 @@ public class com/facebook/react/views/text/TextAttributeProps {
|
|
|
7859
7859
|
public static final field TA_KEY_LETTER_SPACING S
|
|
7860
7860
|
public static final field TA_KEY_LINE_BREAK_STRATEGY S
|
|
7861
7861
|
public static final field TA_KEY_LINE_HEIGHT S
|
|
7862
|
+
public static final field TA_KEY_MAX_FONT_SIZE_MULTIPLIER S
|
|
7862
7863
|
public static final field TA_KEY_OPACITY S
|
|
7863
7864
|
public static final field TA_KEY_ROLE S
|
|
7864
7865
|
public static final field TA_KEY_TEXT_DECORATION_COLOR S
|
|
@@ -7891,6 +7892,7 @@ public class com/facebook/react/views/text/TextAttributeProps {
|
|
|
7891
7892
|
protected field mLetterSpacingInput F
|
|
7892
7893
|
protected field mLineHeight F
|
|
7893
7894
|
protected field mLineHeightInput F
|
|
7895
|
+
protected field mMaxFontSizeMultiplier F
|
|
7894
7896
|
protected field mNumberOfLines I
|
|
7895
7897
|
protected field mOpacity F
|
|
7896
7898
|
protected field mRole Lcom/facebook/react/uimanager/ReactAccessibilityDelegate$Role;
|
|
@@ -34,9 +34,24 @@ set(BUILD_DIR ${PROJECT_BUILD_DIR})
|
|
|
34
34
|
file(TO_CMAKE_PATH "${BUILD_DIR}" BUILD_DIR)
|
|
35
35
|
file(TO_CMAKE_PATH "${REACT_ANDROID_DIR}" REACT_ANDROID_DIR)
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
if (PROJECT_ROOT_DIR)
|
|
38
|
+
# This empty `if` is just to silence a CMake warning and make sure the `PROJECT_ROOT_DIR`
|
|
39
|
+
# variable is defined if user need to access it.
|
|
40
|
+
endif ()
|
|
41
|
+
|
|
42
|
+
file(GLOB override_cpp_SRC CONFIGURE_DEPENDS *.cpp)
|
|
43
|
+
# We check if the user is providing a custom OnLoad.cpp file. If so, we pick that
|
|
44
|
+
# for compilation. Otherwise we fallback to using the `default-app-setup/OnLoad.cpp`
|
|
45
|
+
# file instead.
|
|
46
|
+
if(override_cpp_SRC)
|
|
47
|
+
file(GLOB input_SRC CONFIGURE_DEPENDS
|
|
48
|
+
*.cpp
|
|
49
|
+
${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp)
|
|
50
|
+
else()
|
|
51
|
+
file(GLOB input_SRC CONFIGURE_DEPENDS
|
|
52
|
+
${REACT_ANDROID_DIR}/cmake-utils/default-app-setup/*.cpp
|
|
53
|
+
${BUILD_DIR}/generated/autolinking/src/main/jni/*.cpp)
|
|
54
|
+
endif()
|
|
40
55
|
|
|
41
56
|
add_library(${CMAKE_PROJECT_NAME} SHARED ${input_SRC})
|
|
42
57
|
|
|
@@ -330,14 +330,11 @@ public class MountingManager {
|
|
|
330
330
|
@AnyThread
|
|
331
331
|
@ThreadConfined(ANY)
|
|
332
332
|
public @Nullable EventEmitterWrapper getEventEmitter(int surfaceId, int reactTag) {
|
|
333
|
-
SurfaceMountingManager
|
|
334
|
-
|
|
335
|
-
? getSurfaceManagerForView(reactTag)
|
|
336
|
-
: getSurfaceManager(surfaceId));
|
|
337
|
-
if (surfaceMountingManager == null) {
|
|
333
|
+
SurfaceMountingManager smm = getSurfaceMountingManager(surfaceId, reactTag);
|
|
334
|
+
if (smm == null) {
|
|
338
335
|
return null;
|
|
339
336
|
}
|
|
340
|
-
return
|
|
337
|
+
return smm.getEventEmitter(reactTag);
|
|
341
338
|
}
|
|
342
339
|
|
|
343
340
|
/**
|
|
@@ -434,11 +431,21 @@ public class MountingManager {
|
|
|
434
431
|
boolean canCoalesceEvent,
|
|
435
432
|
@Nullable WritableMap params,
|
|
436
433
|
@EventCategoryDef int eventCategory) {
|
|
437
|
-
|
|
434
|
+
SurfaceMountingManager smm = getSurfaceMountingManager(surfaceId, reactTag);
|
|
438
435
|
if (smm == null) {
|
|
439
|
-
|
|
436
|
+
FLog.d(
|
|
437
|
+
TAG,
|
|
438
|
+
"Cannot queue event without valid surface mounting manager for tag: %d, surfaceId: %d",
|
|
439
|
+
reactTag,
|
|
440
|
+
surfaceId);
|
|
440
441
|
return;
|
|
441
442
|
}
|
|
442
443
|
smm.enqueuePendingEvent(reactTag, eventName, canCoalesceEvent, params, eventCategory);
|
|
443
444
|
}
|
|
445
|
+
|
|
446
|
+
private @Nullable SurfaceMountingManager getSurfaceMountingManager(int surfaceId, int reactTag) {
|
|
447
|
+
return (surfaceId == ViewUtil.NO_SURFACE_ID
|
|
448
|
+
? getSurfaceManagerForView(reactTag)
|
|
449
|
+
: getSurfaceManager(surfaceId));
|
|
450
|
+
}
|
|
444
451
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<89491eb63a7ca59b17419ed4432a4f88>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -34,12 +34,6 @@ public object ReactNativeFeatureFlags {
|
|
|
34
34
|
@JvmStatic
|
|
35
35
|
public fun commonTestFlag(): Boolean = accessor.commonTestFlag()
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* Adds support for recursively processing commits that mount synchronously (Android only).
|
|
39
|
-
*/
|
|
40
|
-
@JvmStatic
|
|
41
|
-
public fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean = accessor.allowRecursiveCommitsWithSynchronousMountOnAndroid()
|
|
42
|
-
|
|
43
37
|
/**
|
|
44
38
|
* When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.
|
|
45
39
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<9f741ec3df7cd5ecd8d5c3c099c86aba>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -21,7 +21,6 @@ package com.facebook.react.internal.featureflags
|
|
|
21
21
|
|
|
22
22
|
public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccessor {
|
|
23
23
|
private var commonTestFlagCache: Boolean? = null
|
|
24
|
-
private var allowRecursiveCommitsWithSynchronousMountOnAndroidCache: Boolean? = null
|
|
25
24
|
private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
|
|
26
25
|
private var completeReactInstanceCreationOnBgThreadOnAndroidCache: Boolean? = null
|
|
27
26
|
private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
|
|
@@ -78,15 +77,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
|
|
78
77
|
return cached
|
|
79
78
|
}
|
|
80
79
|
|
|
81
|
-
override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean {
|
|
82
|
-
var cached = allowRecursiveCommitsWithSynchronousMountOnAndroidCache
|
|
83
|
-
if (cached == null) {
|
|
84
|
-
cached = ReactNativeFeatureFlagsCxxInterop.allowRecursiveCommitsWithSynchronousMountOnAndroid()
|
|
85
|
-
allowRecursiveCommitsWithSynchronousMountOnAndroidCache = cached
|
|
86
|
-
}
|
|
87
|
-
return cached
|
|
88
|
-
}
|
|
89
|
-
|
|
90
80
|
override fun batchRenderingUpdatesInEventLoop(): Boolean {
|
|
91
81
|
var cached = batchRenderingUpdatesInEventLoopCache
|
|
92
82
|
if (cached == null) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<774337b6aee6f528b0852704271ed96f>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -30,8 +30,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
|
|
30
30
|
|
|
31
31
|
@DoNotStrip @JvmStatic public external fun commonTestFlag(): Boolean
|
|
32
32
|
|
|
33
|
-
@DoNotStrip @JvmStatic public external fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean
|
|
34
|
-
|
|
35
33
|
@DoNotStrip @JvmStatic public external fun batchRenderingUpdatesInEventLoop(): Boolean
|
|
36
34
|
|
|
37
35
|
@DoNotStrip @JvmStatic public external fun completeReactInstanceCreationOnBgThreadOnAndroid(): Boolean
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<43c4ba7a6c4f5a12ada181c081f91bfc>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -25,8 +25,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
|
|
25
25
|
|
|
26
26
|
override fun commonTestFlag(): Boolean = false
|
|
27
27
|
|
|
28
|
-
override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean = false
|
|
29
|
-
|
|
30
28
|
override fun batchRenderingUpdatesInEventLoop(): Boolean = false
|
|
31
29
|
|
|
32
30
|
override fun completeReactInstanceCreationOnBgThreadOnAndroid(): Boolean = false
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<0ca6ebf7ef1418d721b6f183f89b96a2>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -25,7 +25,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
|
|
25
25
|
private val accessedFeatureFlags = mutableSetOf<String>()
|
|
26
26
|
|
|
27
27
|
private var commonTestFlagCache: Boolean? = null
|
|
28
|
-
private var allowRecursiveCommitsWithSynchronousMountOnAndroidCache: Boolean? = null
|
|
29
28
|
private var batchRenderingUpdatesInEventLoopCache: Boolean? = null
|
|
30
29
|
private var completeReactInstanceCreationOnBgThreadOnAndroidCache: Boolean? = null
|
|
31
30
|
private var destroyFabricSurfacesInReactInstanceManagerCache: Boolean? = null
|
|
@@ -83,16 +82,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
|
|
83
82
|
return cached
|
|
84
83
|
}
|
|
85
84
|
|
|
86
|
-
override fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean {
|
|
87
|
-
var cached = allowRecursiveCommitsWithSynchronousMountOnAndroidCache
|
|
88
|
-
if (cached == null) {
|
|
89
|
-
cached = currentProvider.allowRecursiveCommitsWithSynchronousMountOnAndroid()
|
|
90
|
-
accessedFeatureFlags.add("allowRecursiveCommitsWithSynchronousMountOnAndroid")
|
|
91
|
-
allowRecursiveCommitsWithSynchronousMountOnAndroidCache = cached
|
|
92
|
-
}
|
|
93
|
-
return cached
|
|
94
|
-
}
|
|
95
|
-
|
|
96
85
|
override fun batchRenderingUpdatesInEventLoop(): Boolean {
|
|
97
86
|
var cached = batchRenderingUpdatesInEventLoopCache
|
|
98
87
|
if (cached == null) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<94e1e69be22ec978859e3f242610f21b>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -25,8 +25,6 @@ import com.facebook.proguard.annotations.DoNotStrip
|
|
|
25
25
|
public interface ReactNativeFeatureFlagsProvider {
|
|
26
26
|
@DoNotStrip public fun commonTestFlag(): Boolean
|
|
27
27
|
|
|
28
|
-
@DoNotStrip public fun allowRecursiveCommitsWithSynchronousMountOnAndroid(): Boolean
|
|
29
|
-
|
|
30
28
|
@DoNotStrip public fun batchRenderingUpdatesInEventLoop(): Boolean
|
|
31
29
|
|
|
32
30
|
@DoNotStrip public fun completeReactInstanceCreationOnBgThreadOnAndroid(): Boolean
|
|
@@ -61,6 +61,7 @@ public class TextAttributeProps {
|
|
|
61
61
|
public static final short TA_KEY_LINE_BREAK_STRATEGY = 25;
|
|
62
62
|
public static final short TA_KEY_ROLE = 26;
|
|
63
63
|
public static final short TA_KEY_TEXT_TRANSFORM = 27;
|
|
64
|
+
public static final short TA_KEY_MAX_FONT_SIZE_MULTIPLIER = 29;
|
|
64
65
|
|
|
65
66
|
public static final int UNSET = -1;
|
|
66
67
|
|
|
@@ -81,6 +82,7 @@ public class TextAttributeProps {
|
|
|
81
82
|
protected float mLineHeight = Float.NaN;
|
|
82
83
|
protected boolean mIsColorSet = false;
|
|
83
84
|
protected boolean mAllowFontScaling = true;
|
|
85
|
+
protected float mMaxFontSizeMultiplier = Float.NaN;
|
|
84
86
|
protected int mColor;
|
|
85
87
|
protected boolean mIsBackgroundColorSet = false;
|
|
86
88
|
protected int mBackgroundColor;
|
|
@@ -227,6 +229,9 @@ public class TextAttributeProps {
|
|
|
227
229
|
case TA_KEY_TEXT_TRANSFORM:
|
|
228
230
|
result.setTextTransform(entry.getStringValue());
|
|
229
231
|
break;
|
|
232
|
+
case TA_KEY_MAX_FONT_SIZE_MULTIPLIER:
|
|
233
|
+
result.setMaxFontSizeMultiplier((float) entry.getDoubleValue());
|
|
234
|
+
break;
|
|
230
235
|
}
|
|
231
236
|
}
|
|
232
237
|
|
|
@@ -243,6 +248,8 @@ public class TextAttributeProps {
|
|
|
243
248
|
result.setLineHeight(getFloatProp(props, ViewProps.LINE_HEIGHT, ReactConstants.UNSET));
|
|
244
249
|
result.setLetterSpacing(getFloatProp(props, ViewProps.LETTER_SPACING, Float.NaN));
|
|
245
250
|
result.setAllowFontScaling(getBooleanProp(props, ViewProps.ALLOW_FONT_SCALING, true));
|
|
251
|
+
result.setMaxFontSizeMultiplier(
|
|
252
|
+
getFloatProp(props, ViewProps.MAX_FONT_SIZE_MULTIPLIER, Float.NaN));
|
|
246
253
|
result.setFontSize(getFloatProp(props, ViewProps.FONT_SIZE, ReactConstants.UNSET));
|
|
247
254
|
result.setColor(props.hasKey(ViewProps.COLOR) ? props.getInt(ViewProps.COLOR, 0) : null);
|
|
248
255
|
result.setColor(
|
|
@@ -411,7 +418,14 @@ public class TextAttributeProps {
|
|
|
411
418
|
mAllowFontScaling = allowFontScaling;
|
|
412
419
|
setFontSize(mFontSizeInput);
|
|
413
420
|
setLineHeight(mLineHeightInput);
|
|
414
|
-
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
private void setMaxFontSizeMultiplier(float maxFontSizeMultiplier) {
|
|
425
|
+
if (maxFontSizeMultiplier != mMaxFontSizeMultiplier) {
|
|
426
|
+
mMaxFontSizeMultiplier = maxFontSizeMultiplier;
|
|
427
|
+
setFontSize(mFontSizeInput);
|
|
428
|
+
setLineHeight(mLineHeightInput);
|
|
415
429
|
}
|
|
416
430
|
}
|
|
417
431
|
|
|
@@ -420,7 +434,7 @@ public class TextAttributeProps {
|
|
|
420
434
|
if (fontSize != ReactConstants.UNSET) {
|
|
421
435
|
fontSize =
|
|
422
436
|
mAllowFontScaling
|
|
423
|
-
? (float) Math.ceil(PixelUtil.toPixelFromSP(fontSize))
|
|
437
|
+
? (float) Math.ceil(PixelUtil.toPixelFromSP(fontSize, mMaxFontSizeMultiplier))
|
|
424
438
|
: (float) Math.ceil(PixelUtil.toPixelFromDIP(fontSize));
|
|
425
439
|
}
|
|
426
440
|
mFontSize = (int) fontSize;
|
|
@@ -501,27 +501,25 @@ void Binding::schedulerShouldRenderTransactions(
|
|
|
501
501
|
return;
|
|
502
502
|
}
|
|
503
503
|
|
|
504
|
-
if (ReactNativeFeatureFlags::
|
|
505
|
-
allowRecursiveCommitsWithSynchronousMountOnAndroid()) {
|
|
506
|
-
std::vector<MountingTransaction> pendingTransactions;
|
|
507
|
-
|
|
508
|
-
{
|
|
509
|
-
// Retain the lock to access the pending transactions but not to execute
|
|
510
|
-
// the mount operations because that method can call into this method
|
|
511
|
-
// again.
|
|
512
|
-
std::unique_lock<std::mutex> lock(pendingTransactionsMutex_);
|
|
513
|
-
pendingTransactions_.swap(pendingTransactions);
|
|
514
|
-
}
|
|
515
504
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
505
|
+
std::vector<MountingTransaction> pendingTransactions;
|
|
506
|
+
|
|
507
|
+
{
|
|
508
|
+
// Retain the lock to access the pending transactions but not to execute
|
|
509
|
+
// the mount operations because that method can call into this method
|
|
510
|
+
// again.
|
|
511
|
+
//
|
|
512
|
+
// This can be re-entrant when mounting manager triggers state updates
|
|
513
|
+
// synchronously (this can happen when committing from the UI thread).
|
|
514
|
+
// This is safe because we're already combining all the transactions for the
|
|
515
|
+
// same surface ID in a single transaction in the pending transactions list,
|
|
516
|
+
// so operations won't run out of order.
|
|
520
517
|
std::unique_lock<std::mutex> lock(pendingTransactionsMutex_);
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
518
|
+
pendingTransactions_.swap(pendingTransactions);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
for (auto& transaction : pendingTransactions) {
|
|
522
|
+
mountingManager->executeMount(transaction);
|
|
525
523
|
}
|
|
526
524
|
}
|
|
527
525
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<68e5d4ce0ed3c237eeababaa04821101>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -45,12 +45,6 @@ class ReactNativeFeatureFlagsProviderHolder
|
|
|
45
45
|
return method(javaProvider_);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
bool allowRecursiveCommitsWithSynchronousMountOnAndroid() override {
|
|
49
|
-
static const auto method =
|
|
50
|
-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("allowRecursiveCommitsWithSynchronousMountOnAndroid");
|
|
51
|
-
return method(javaProvider_);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
48
|
bool batchRenderingUpdatesInEventLoop() override {
|
|
55
49
|
static const auto method =
|
|
56
50
|
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("batchRenderingUpdatesInEventLoop");
|
|
@@ -336,11 +330,6 @@ bool JReactNativeFeatureFlagsCxxInterop::commonTestFlag(
|
|
|
336
330
|
return ReactNativeFeatureFlags::commonTestFlag();
|
|
337
331
|
}
|
|
338
332
|
|
|
339
|
-
bool JReactNativeFeatureFlagsCxxInterop::allowRecursiveCommitsWithSynchronousMountOnAndroid(
|
|
340
|
-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
341
|
-
return ReactNativeFeatureFlags::allowRecursiveCommitsWithSynchronousMountOnAndroid();
|
|
342
|
-
}
|
|
343
|
-
|
|
344
333
|
bool JReactNativeFeatureFlagsCxxInterop::batchRenderingUpdatesInEventLoop(
|
|
345
334
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
|
346
335
|
return ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop();
|
|
@@ -591,9 +580,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
|
|
591
580
|
makeNativeMethod(
|
|
592
581
|
"commonTestFlag",
|
|
593
582
|
JReactNativeFeatureFlagsCxxInterop::commonTestFlag),
|
|
594
|
-
makeNativeMethod(
|
|
595
|
-
"allowRecursiveCommitsWithSynchronousMountOnAndroid",
|
|
596
|
-
JReactNativeFeatureFlagsCxxInterop::allowRecursiveCommitsWithSynchronousMountOnAndroid),
|
|
597
583
|
makeNativeMethod(
|
|
598
584
|
"batchRenderingUpdatesInEventLoop",
|
|
599
585
|
JReactNativeFeatureFlagsCxxInterop::batchRenderingUpdatesInEventLoop),
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<bba5d2a290f39b6572db7f90b67e8469>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -33,9 +33,6 @@ class JReactNativeFeatureFlagsCxxInterop
|
|
|
33
33
|
static bool commonTestFlag(
|
|
34
34
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
35
35
|
|
|
36
|
-
static bool allowRecursiveCommitsWithSynchronousMountOnAndroid(
|
|
37
|
-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
38
|
-
|
|
39
36
|
static bool batchRenderingUpdatesInEventLoop(
|
|
40
37
|
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
|
41
38
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<5c4ae3a29f0191428284e0c660353edf>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -25,10 +25,6 @@ bool ReactNativeFeatureFlags::commonTestFlag() {
|
|
|
25
25
|
return getAccessor().commonTestFlag();
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
bool ReactNativeFeatureFlags::allowRecursiveCommitsWithSynchronousMountOnAndroid() {
|
|
29
|
-
return getAccessor().allowRecursiveCommitsWithSynchronousMountOnAndroid();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
28
|
bool ReactNativeFeatureFlags::batchRenderingUpdatesInEventLoop() {
|
|
33
29
|
return getAccessor().batchRenderingUpdatesInEventLoop();
|
|
34
30
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
|
-
* @generated SignedSource<<
|
|
7
|
+
* @generated SignedSource<<8c40f45357799de60f939b510f1d2ae5>>
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -42,11 +42,6 @@ class ReactNativeFeatureFlags {
|
|
|
42
42
|
*/
|
|
43
43
|
RN_EXPORT static bool commonTestFlag();
|
|
44
44
|
|
|
45
|
-
/**
|
|
46
|
-
* Adds support for recursively processing commits that mount synchronously (Android only).
|
|
47
|
-
*/
|
|
48
|
-
RN_EXPORT static bool allowRecursiveCommitsWithSynchronousMountOnAndroid();
|
|
49
|
-
|
|
50
45
|
/**
|
|
51
46
|
* When enabled, the RuntimeScheduler processing the event loop will batch all rendering updates and dispatch them together at the end of each iteration of the loop.
|
|
52
47
|
*/
|