mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Compare commits
19
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14cce6c313 | ||
|
|
741ae296d9 | ||
|
|
21b99d9981 | ||
|
|
5f45f8a71c | ||
|
|
f503fe3f10 | ||
|
|
c1e964aa1f | ||
|
|
52cdedb40e | ||
|
|
4076dbfc86 | ||
|
|
03797dda03 | ||
|
|
b5696e6172 | ||
|
|
0705eb8b91 | ||
|
|
92d743a9ab | ||
|
|
3111473d57 | ||
|
|
b5b65275c6 | ||
|
|
db835e28d8 | ||
|
|
8b9535f101 | ||
|
|
e4e68db2bc | ||
|
|
9a5d3efb12 | ||
|
|
cf8250a79f |
@@ -46,7 +46,7 @@ describe('#publishTemplate', () => {
|
||||
expect(github.rest.actions.createWorkflowDispatch).toHaveBeenCalledWith({
|
||||
owner: 'react-native-community',
|
||||
repo: 'template',
|
||||
workflow_id: 'release.yml',
|
||||
workflow_id: 'release.yaml',
|
||||
ref: '0.76-stable',
|
||||
inputs: {
|
||||
dry_run: true,
|
||||
@@ -66,7 +66,7 @@ describe('#publishTemplate', () => {
|
||||
expect(github.rest.actions.createWorkflowDispatch).toHaveBeenCalledWith({
|
||||
owner: 'react-native-community',
|
||||
repo: 'template',
|
||||
workflow_id: 'release.yml',
|
||||
workflow_id: 'release.yaml',
|
||||
ref: '0.76-stable',
|
||||
inputs: {
|
||||
dry_run: false,
|
||||
|
||||
@@ -42,7 +42,7 @@ module.exports.publishTemplate = async (github, version, dryRun = true) => {
|
||||
await github.rest.actions.createWorkflowDispatch({
|
||||
owner: 'react-native-community',
|
||||
repo: 'template',
|
||||
workflow_id: 'release.yml',
|
||||
workflow_id: 'release.yaml',
|
||||
ref,
|
||||
inputs: {
|
||||
dry_run: dryRun,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
const {execSync} = require('child_process');
|
||||
|
||||
function run(...cmd) {
|
||||
function run(cmd) {
|
||||
return execSync(cmd, 'utf8').toString().trim();
|
||||
}
|
||||
module.exports.run = run;
|
||||
@@ -21,7 +21,7 @@ module.exports.sleep = sleep;
|
||||
|
||||
async function getNpmPackageInfo(pkg, versionOrTag) {
|
||||
return fetch(`https://registry.npmjs.org/${pkg}/${versionOrTag}`).then(resp =>
|
||||
res.json(),
|
||||
resp.json(),
|
||||
);
|
||||
}
|
||||
module.exports.getNpmPackageInfo = getNpmPackageInfo;
|
||||
|
||||
@@ -205,9 +205,9 @@ jobs:
|
||||
with:
|
||||
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
||||
script: |
|
||||
const {verifyPublished, isLatest} = require('./.github/workflow-scripts/publishTemplate.js')
|
||||
const {verifyPublishedTemplate, isLatest} = require('./.github/workflow-scripts/publishTemplate.js')
|
||||
const version = "${{ github.ref_name }}"
|
||||
await verifyPublished(version, isLatest());
|
||||
await verifyPublishedTemplate(version, isLatest());
|
||||
- name: Update rn-diff-purge to generate upgrade-support diff
|
||||
run: |
|
||||
curl -X POST https://api.github.com/repos/react-native-community/rn-diff-purge/dispatches \
|
||||
|
||||
+3
-1
@@ -496,7 +496,9 @@ const SIMPLE_NATIVE_MODULES: SchemaType = {
|
||||
typeAnnotation: {
|
||||
type: 'FunctionTypeAnnotation',
|
||||
returnTypeAnnotation: {
|
||||
type: 'StringTypeAnnotation',
|
||||
name: 'StringEnum',
|
||||
type: 'EnumDeclaration',
|
||||
memberType: 'StringTypeAnnotation',
|
||||
},
|
||||
params: [
|
||||
{
|
||||
|
||||
+1
-1
@@ -811,7 +811,7 @@ export type CustomDeviceEvent = {
|
||||
export interface Spec extends TurboModule {
|
||||
+getCallback: () => () => void;
|
||||
+getMixed: (arg: mixed) => mixed;
|
||||
+getEnums: (quality: Quality, resolution?: Resolution, stringOptions: StringOptions) => string;
|
||||
+getEnums: (quality: Quality, resolution?: Resolution, stringOptions: StringOptions) => Quality;
|
||||
+getBinaryTreeNode: (arg: BinaryTreeNode) => BinaryTreeNode;
|
||||
+getGraphNode: (arg: GraphNode) => GraphNode;
|
||||
+getMap: (arg: {[a: string]: ?number}) => {[b: string]: ?number};
|
||||
|
||||
+3
-1
@@ -227,7 +227,9 @@ exports[`RN Codegen Flow Parser can generate fixture CXX_ONLY_NATIVE_MODULE 1`]
|
||||
'typeAnnotation': {
|
||||
'type': 'FunctionTypeAnnotation',
|
||||
'returnTypeAnnotation': {
|
||||
'type': 'StringTypeAnnotation'
|
||||
'name': 'Quality',
|
||||
'type': 'EnumDeclaration',
|
||||
'memberType': 'StringTypeAnnotation'
|
||||
},
|
||||
'params': [
|
||||
{
|
||||
|
||||
+1
-1
@@ -900,7 +900,7 @@ export type CustomDeviceEvent = {
|
||||
export interface Spec extends TurboModule {
|
||||
readonly getCallback: () => () => void;
|
||||
readonly getMixed: (arg: unknown) => unknown;
|
||||
readonly getEnums: (quality: Quality, resolution?: Resolution, stringOptions: StringOptions) => string;
|
||||
readonly getEnums: (quality: Quality, resolution?: Resolution, stringOptions: StringOptions) => Quality;
|
||||
readonly getBinaryTreeNode: (arg: BinaryTreeNode) => BinaryTreeNode;
|
||||
readonly getGraphNode: (arg: GraphNode) => GraphNode;
|
||||
readonly getMap: (arg: {[a: string]: number | null;}) => {[b: string]: number | null;};
|
||||
|
||||
+3
-1
@@ -218,7 +218,9 @@ exports[`RN Codegen TypeScript Parser can generate fixture CXX_ONLY_NATIVE_MODUL
|
||||
'typeAnnotation': {
|
||||
'type': 'FunctionTypeAnnotation',
|
||||
'returnTypeAnnotation': {
|
||||
'type': 'StringTypeAnnotation'
|
||||
'name': 'Quality',
|
||||
'type': 'EnumDeclaration',
|
||||
'memberType': 'StringTypeAnnotation'
|
||||
},
|
||||
'params': [
|
||||
{
|
||||
|
||||
@@ -128,7 +128,10 @@ static BOOL RCTIsIPhoneNotched()
|
||||
RCTAssertMainQueue();
|
||||
|
||||
// 20pt is the top safeArea value in non-notched devices
|
||||
isIPhoneNotched = RCTSharedApplication().keyWindow.safeAreaInsets.top > 20;
|
||||
UIWindow *keyWindow = RCTKeyWindow();
|
||||
if (keyWindow) {
|
||||
isIPhoneNotched = keyWindow.safeAreaInsets.top > 20;
|
||||
}
|
||||
});
|
||||
#endif
|
||||
|
||||
|
||||
+5
-12
@@ -78,7 +78,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
const auto &defaultProps = TextInputShadowNode::defaultSharedProps();
|
||||
_props = defaultProps;
|
||||
|
||||
_backedTextInputView = defaultProps->traits.multiline ? [RCTUITextView new] : [RCTUITextField new];
|
||||
_backedTextInputView = defaultProps->multiline ? [RCTUITextView new] : [RCTUITextField new];
|
||||
_backedTextInputView.textInputDelegate = self;
|
||||
_ignoreNextTextInputCall = NO;
|
||||
_comingFromJS = NO;
|
||||
@@ -166,8 +166,8 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
const auto &newTextInputProps = static_cast<const TextInputProps &>(*props);
|
||||
|
||||
// Traits:
|
||||
if (newTextInputProps.traits.multiline != oldTextInputProps.traits.multiline) {
|
||||
[self _setMultiline:newTextInputProps.traits.multiline];
|
||||
if (newTextInputProps.multiline != oldTextInputProps.multiline) {
|
||||
[self _setMultiline:newTextInputProps.multiline];
|
||||
}
|
||||
|
||||
if (newTextInputProps.traits.autocapitalizationType != oldTextInputProps.traits.autocapitalizationType) {
|
||||
@@ -448,7 +448,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
return;
|
||||
}
|
||||
const auto &props = static_cast<const TextInputProps &>(*_props);
|
||||
if (props.traits.multiline && ![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
|
||||
if (props.multiline && ![_lastStringStateWasUpdatedWith isEqual:_backedTextInputView.attributedText]) {
|
||||
[self textInputDidChange];
|
||||
_ignoreNextTextInputCall = YES;
|
||||
}
|
||||
@@ -785,14 +785,7 @@ static NSSet<NSNumber *> *returnKeyTypesSet;
|
||||
- (SubmitBehavior)getSubmitBehavior
|
||||
{
|
||||
const auto &props = static_cast<const TextInputProps &>(*_props);
|
||||
const SubmitBehavior submitBehaviorDefaultable = props.traits.submitBehavior;
|
||||
|
||||
// We should always have a non-default `submitBehavior`, but in case we don't, set it based on multiline.
|
||||
if (submitBehaviorDefaultable == SubmitBehavior::Default) {
|
||||
return props.traits.multiline ? SubmitBehavior::Newline : SubmitBehavior::BlurAndSubmit;
|
||||
}
|
||||
|
||||
return submitBehaviorDefaultable;
|
||||
return props.getNonDefaultSubmitBehavior();
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -762,8 +762,10 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithTarget : (id)target action : (SEL)act
|
||||
switch (recognizer.state) {
|
||||
case UIGestureRecognizerStateEnded:
|
||||
eventEmitter->onPointerLeave(event);
|
||||
break;
|
||||
default:
|
||||
eventEmitter->onPointerMove(event);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2025,9 +2025,9 @@ public final class com/facebook/react/common/network/OkHttpCallUtil {
|
||||
public static final fun cancelTag (Lokhttp3/OkHttpClient;Ljava/lang/Object;)V
|
||||
}
|
||||
|
||||
public class com/facebook/react/config/ReactFeatureFlags {
|
||||
public final class com/facebook/react/config/ReactFeatureFlags {
|
||||
public static final field INSTANCE Lcom/facebook/react/config/ReactFeatureFlags;
|
||||
public static field dispatchPointerEvents Z
|
||||
public fun <init> ()V
|
||||
}
|
||||
|
||||
public final class com/facebook/react/defaults/DefaultComponentsRegistry {
|
||||
@@ -2573,11 +2573,6 @@ public final class com/facebook/react/fabric/ComponentFactory {
|
||||
}
|
||||
|
||||
public class com/facebook/react/fabric/DevToolsReactPerfLogger : com/facebook/react/bridge/ReactMarker$FabricMarkerListener {
|
||||
public static final field mStreamingBatchExecutionStats Lcom/facebook/react/fabric/LongStreamingStats;
|
||||
public static final field mStreamingCommitStats Lcom/facebook/react/fabric/LongStreamingStats;
|
||||
public static final field mStreamingDiffStats Lcom/facebook/react/fabric/LongStreamingStats;
|
||||
public static final field mStreamingLayoutStats Lcom/facebook/react/fabric/LongStreamingStats;
|
||||
public static final field mStreamingTransactionEndStats Lcom/facebook/react/fabric/LongStreamingStats;
|
||||
public fun <init> ()V
|
||||
public fun addDevToolsReactPerfLoggerListener (Lcom/facebook/react/fabric/DevToolsReactPerfLogger$DevToolsReactPerfLoggerListener;)V
|
||||
public fun logFabricMarker (Lcom/facebook/react/bridge/ReactMarkerConstants;Ljava/lang/String;IJ)V
|
||||
@@ -2613,12 +2608,6 @@ public class com/facebook/react/fabric/DevToolsReactPerfLogger$FabricCommitPoint
|
||||
public fun toString ()Ljava/lang/String;
|
||||
}
|
||||
|
||||
public class com/facebook/react/fabric/DevToolsReactPerfLogger$FabricCommitPointData {
|
||||
public fun <init> (JI)V
|
||||
public fun getCounter ()I
|
||||
public fun getTimeStamp ()J
|
||||
}
|
||||
|
||||
public final class com/facebook/react/fabric/EmptyReactNativeConfig : com/facebook/react/fabric/ReactNativeConfig {
|
||||
public fun <init> ()V
|
||||
public fun getBool (Ljava/lang/String;)Z
|
||||
|
||||
+7
-9
@@ -5,22 +5,20 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.config;
|
||||
package com.facebook.react.config
|
||||
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.proguard.annotations.DoNotStripAny;
|
||||
import com.facebook.proguard.annotations.DoNotStripAny
|
||||
import kotlin.jvm.JvmField
|
||||
|
||||
/**
|
||||
* Hi there, traveller! This configuration class is not meant to be used by end-users of RN. It
|
||||
* contains mainly flags for features that are either under active development and not ready for
|
||||
* public consumption, or for use in experiments.
|
||||
*
|
||||
* <p>These values are safe defaults and should not require manual changes.
|
||||
* These values are safe defaults and should not require manual changes.
|
||||
*/
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
@Deprecated(since = "Use com.facebook.react.internal.featureflags.ReactNativeFeatureFlags instead.")
|
||||
@Deprecated("Use com.facebook.react.internal.featureflags.ReactNativeFeatureFlags instead.")
|
||||
@DoNotStripAny
|
||||
public class ReactFeatureFlags {
|
||||
|
||||
public static boolean dispatchPointerEvents = false;
|
||||
public object ReactFeatureFlags {
|
||||
@JvmField public var dispatchPointerEvents: Boolean = false
|
||||
}
|
||||
+6
-7
@@ -37,18 +37,17 @@ public class DevToolsReactPerfLogger implements ReactMarker.FabricMarkerListener
|
||||
private final List<DevToolsReactPerfLoggerListener> mDevToolsReactPerfLoggerListeners =
|
||||
new ArrayList<>();
|
||||
|
||||
public static final LongStreamingStats mStreamingCommitStats = new LongStreamingStats();
|
||||
public static final LongStreamingStats mStreamingLayoutStats = new LongStreamingStats();
|
||||
public static final LongStreamingStats mStreamingDiffStats = new LongStreamingStats();
|
||||
public static final LongStreamingStats mStreamingTransactionEndStats = new LongStreamingStats();
|
||||
public static final LongStreamingStats mStreamingBatchExecutionStats = new LongStreamingStats();
|
||||
static final LongStreamingStats mStreamingCommitStats = new LongStreamingStats();
|
||||
static final LongStreamingStats mStreamingLayoutStats = new LongStreamingStats();
|
||||
static final LongStreamingStats mStreamingDiffStats = new LongStreamingStats();
|
||||
static final LongStreamingStats mStreamingTransactionEndStats = new LongStreamingStats();
|
||||
static final LongStreamingStats mStreamingBatchExecutionStats = new LongStreamingStats();
|
||||
|
||||
public interface DevToolsReactPerfLoggerListener {
|
||||
|
||||
void onFabricCommitEnd(FabricCommitPoint commitPoint);
|
||||
}
|
||||
|
||||
public static class FabricCommitPointData {
|
||||
private static class FabricCommitPointData {
|
||||
private final long mTimeStamp;
|
||||
private final int mCounter;
|
||||
|
||||
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.fabric;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.PriorityQueue;
|
||||
import java.util.Queue;
|
||||
|
||||
/* package */
|
||||
class LongStreamingStats {
|
||||
// TODO(T138627466): Calculate median value with better algorithm after Android API 24.
|
||||
private final Queue<Long> minHeap =
|
||||
new PriorityQueue<>(11, Comparator.comparingLong(aLong -> aLong));
|
||||
private final Queue<Long> maxHeap =
|
||||
new PriorityQueue<>(
|
||||
11,
|
||||
(first, second) -> {
|
||||
// Reversed order
|
||||
return Long.compare(second, first);
|
||||
});
|
||||
private double streamingAverage = 0.0;
|
||||
private int len = 0;
|
||||
private long max = 0;
|
||||
|
||||
LongStreamingStats() {}
|
||||
|
||||
public void add(long n) {
|
||||
// To make medians more useful, we discard all zero values
|
||||
// This isn't perfect and certainly makes this a totally invalid median, but, alas...
|
||||
if (n != 0) {
|
||||
if (minHeap.size() == maxHeap.size()) {
|
||||
maxHeap.offer(n);
|
||||
minHeap.offer(maxHeap.poll());
|
||||
} else {
|
||||
minHeap.offer(n);
|
||||
maxHeap.offer(minHeap.poll());
|
||||
}
|
||||
}
|
||||
|
||||
len++;
|
||||
if (len == 1) {
|
||||
streamingAverage = n;
|
||||
} else {
|
||||
streamingAverage = (streamingAverage / (len / (len - 1))) + (n / len);
|
||||
}
|
||||
|
||||
max = (n > max ? n : max);
|
||||
}
|
||||
|
||||
public double getMedian() {
|
||||
if (minHeap.size() == 0 && maxHeap.size() == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
long median;
|
||||
if (minHeap.size() > maxHeap.size()) {
|
||||
median = minHeap.peek();
|
||||
} else {
|
||||
median = (minHeap.peek() + maxHeap.peek()) / 2;
|
||||
}
|
||||
return median;
|
||||
}
|
||||
|
||||
public double getAverage() {
|
||||
return streamingAverage;
|
||||
}
|
||||
|
||||
public long getMax() {
|
||||
return max;
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.fabric
|
||||
|
||||
import java.util.PriorityQueue
|
||||
import java.util.Queue
|
||||
import kotlin.comparisons.reverseOrder
|
||||
|
||||
internal class LongStreamingStats {
|
||||
|
||||
// TODO(T138627466): Calculate median value with better algorithm after Android API 24.
|
||||
private val minHeap: Queue<Long> = PriorityQueue(11)
|
||||
private val maxHeap: Queue<Long> = PriorityQueue(11, reverseOrder())
|
||||
var average: Double = 0.0
|
||||
private set
|
||||
|
||||
private var len = 0
|
||||
var max: Long = 0L
|
||||
private set
|
||||
|
||||
fun add(n: Long) {
|
||||
// To make medians more useful, we discard all zero values
|
||||
// This isn't perfect and certainly makes this a totally invalid median, but, alas...
|
||||
if (n != 0L) {
|
||||
if (minHeap.size == maxHeap.size) {
|
||||
maxHeap.offer(n)
|
||||
minHeap.offer(maxHeap.poll())
|
||||
} else {
|
||||
minHeap.offer(n)
|
||||
maxHeap.offer(minHeap.poll())
|
||||
}
|
||||
}
|
||||
|
||||
len++
|
||||
if (len == 1) {
|
||||
average = n.toDouble()
|
||||
} else {
|
||||
average = (average / (len / (len - 1))) + (n / len)
|
||||
}
|
||||
|
||||
max = (if (n > max) n else max)
|
||||
}
|
||||
|
||||
val median: Double
|
||||
get() {
|
||||
if (minHeap.size == 0 && maxHeap.size == 0) {
|
||||
return 0.0
|
||||
}
|
||||
val median =
|
||||
if (minHeap.size > maxHeap.size) {
|
||||
minHeap.peek()
|
||||
} else {
|
||||
(minHeap.peek() ?: 0 + maxHeap.peek()!!) / 2
|
||||
}
|
||||
return median.toDouble()
|
||||
}
|
||||
}
|
||||
-90
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.fabric.mounting.mountitems;
|
||||
|
||||
import static com.facebook.react.fabric.FabricUIManager.IS_DEVELOPMENT_ENVIRONMENT;
|
||||
import static com.facebook.react.fabric.FabricUIManager.TAG;
|
||||
import static com.facebook.react.fabric.mounting.mountitems.FabricNameComponentMapping.getFabricComponentName;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.facebook.common.logging.FLog;
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.fabric.mounting.MountingManager;
|
||||
import com.facebook.react.fabric.mounting.SurfaceMountingManager;
|
||||
import com.facebook.react.uimanager.StateWrapper;
|
||||
|
||||
/** {@link MountItem} that is used to pre-allocate views for JS components. */
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
final class PreAllocateViewMountItem implements MountItem {
|
||||
|
||||
private final @NonNull String mComponent;
|
||||
private final int mSurfaceId;
|
||||
private final int mReactTag;
|
||||
private final @Nullable ReadableMap mProps;
|
||||
private final @Nullable StateWrapper mStateWrapper;
|
||||
private final boolean mIsLayoutable;
|
||||
|
||||
PreAllocateViewMountItem(
|
||||
int surfaceId,
|
||||
int reactTag,
|
||||
@NonNull String component,
|
||||
@Nullable ReadableMap props,
|
||||
@Nullable StateWrapper stateWrapper,
|
||||
boolean isLayoutable) {
|
||||
mComponent = getFabricComponentName(component);
|
||||
mSurfaceId = surfaceId;
|
||||
mProps = props;
|
||||
mStateWrapper = stateWrapper;
|
||||
mReactTag = reactTag;
|
||||
mIsLayoutable = isLayoutable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSurfaceId() {
|
||||
return mSurfaceId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(@NonNull MountingManager mountingManager) {
|
||||
SurfaceMountingManager surfaceMountingManager = mountingManager.getSurfaceManager(mSurfaceId);
|
||||
if (surfaceMountingManager == null) {
|
||||
FLog.e(
|
||||
TAG,
|
||||
"Skipping View PreAllocation; no SurfaceMountingManager found for [" + mSurfaceId + "]");
|
||||
return;
|
||||
}
|
||||
surfaceMountingManager.preallocateView(
|
||||
mComponent, mReactTag, mProps, mStateWrapper, mIsLayoutable);
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public String toString() {
|
||||
StringBuilder result =
|
||||
new StringBuilder("PreAllocateViewMountItem [")
|
||||
.append(mReactTag)
|
||||
.append("] - component: ")
|
||||
.append(mComponent)
|
||||
.append(" surfaceId: ")
|
||||
.append(mSurfaceId)
|
||||
.append(" isLayoutable: ")
|
||||
.append(mIsLayoutable);
|
||||
|
||||
if (IS_DEVELOPMENT_ENVIRONMENT) {
|
||||
result
|
||||
.append(" props: ")
|
||||
.append(mProps != null ? mProps.toString() : "<null>")
|
||||
.append(" state: ")
|
||||
.append(mStateWrapper != null ? mStateWrapper.toString() : "<null>");
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.fabric.mounting.mountitems
|
||||
|
||||
import com.facebook.common.logging.FLog
|
||||
import com.facebook.react.bridge.ReadableMap
|
||||
import com.facebook.react.fabric.FabricUIManager
|
||||
import com.facebook.react.fabric.mounting.MountingManager
|
||||
import com.facebook.react.fabric.mounting.mountitems.FabricNameComponentMapping.getFabricComponentName
|
||||
import com.facebook.react.uimanager.StateWrapper
|
||||
|
||||
/** [MountItem] that is used to pre-allocate views for JS components. */
|
||||
internal class PreAllocateViewMountItem(
|
||||
private val surfaceId: Int,
|
||||
private val reactTag: Int,
|
||||
component: String,
|
||||
private val props: ReadableMap?,
|
||||
private val stateWrapper: StateWrapper?,
|
||||
private val isLayoutable: Boolean
|
||||
) : MountItem {
|
||||
private val fabricComponentName = getFabricComponentName(component)
|
||||
|
||||
override fun getSurfaceId(): Int = surfaceId
|
||||
|
||||
override fun execute(mountingManager: MountingManager) {
|
||||
val surfaceMountingManager = mountingManager.getSurfaceManager(surfaceId)
|
||||
if (surfaceMountingManager == null) {
|
||||
FLog.e(
|
||||
FabricUIManager.TAG,
|
||||
"Skipping View PreAllocation; no SurfaceMountingManager found for [$surfaceId]")
|
||||
return
|
||||
}
|
||||
surfaceMountingManager.preallocateView(
|
||||
fabricComponentName, reactTag, props, stateWrapper, isLayoutable)
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
val result =
|
||||
StringBuilder("PreAllocateViewMountItem [")
|
||||
.append(reactTag)
|
||||
.append("] - component: ")
|
||||
.append(fabricComponentName)
|
||||
.append(" surfaceId: ")
|
||||
.append(surfaceId)
|
||||
.append(" isLayoutable: ")
|
||||
.append(isLayoutable)
|
||||
|
||||
if (FabricUIManager.IS_DEVELOPMENT_ENVIRONMENT) {
|
||||
result
|
||||
.append(" props: ")
|
||||
.append(props?.toString() ?: "<null>")
|
||||
.append(" state: ")
|
||||
.append(stateWrapper?.toString() ?: "<null>")
|
||||
}
|
||||
|
||||
return result.toString()
|
||||
}
|
||||
}
|
||||
+1
-13
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<575eeb1e291c1a372eba7aabcdd948e3>>
|
||||
* @generated SignedSource<<64521c5f18fcaf7092590a2629bb8418>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -76,12 +76,6 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun enableBridgelessArchitecture(): Boolean = accessor.enableBridgelessArchitecture()
|
||||
|
||||
/**
|
||||
* Clean yoga node when <TextInput /> does not change.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun enableCleanTextInputYogaNode(): Boolean = accessor.enableCleanTextInputYogaNode()
|
||||
|
||||
/**
|
||||
* Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).
|
||||
*/
|
||||
@@ -184,12 +178,6 @@ public object ReactNativeFeatureFlags {
|
||||
@JvmStatic
|
||||
public fun enableSynchronousStateUpdates(): Boolean = accessor.enableSynchronousStateUpdates()
|
||||
|
||||
/**
|
||||
* Text preallocation optimisation where unnecessary work is removed.
|
||||
*/
|
||||
@JvmStatic
|
||||
public fun enableTextPreallocationOptimisation(): Boolean = accessor.enableTextPreallocationOptimisation()
|
||||
|
||||
/**
|
||||
* Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).
|
||||
*/
|
||||
|
||||
+1
-21
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<f93759a639dbbb95d3307003e4907c86>>
|
||||
* @generated SignedSource<<8ed11f58c6671703e4021a91256d315d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -28,7 +28,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
private var enableAlignItemsBaselineOnFabricIOSCache: Boolean? = null
|
||||
private var enableAndroidLineHeightCenteringCache: Boolean? = null
|
||||
private var enableBridgelessArchitectureCache: Boolean? = null
|
||||
private var enableCleanTextInputYogaNodeCache: Boolean? = null
|
||||
private var enableCppPropsIteratorSetterCache: Boolean? = null
|
||||
private var enableDeletionOfUnmountedViewsCache: Boolean? = null
|
||||
private var enableEagerRootViewAttachmentCache: Boolean? = null
|
||||
@@ -46,7 +45,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
|
||||
private var enableReportEventPaintTimeCache: Boolean? = null
|
||||
private var enableSynchronousStateUpdatesCache: Boolean? = null
|
||||
private var enableTextPreallocationOptimisationCache: Boolean? = null
|
||||
private var enableUIConsistencyCache: Boolean? = null
|
||||
private var enableViewRecyclingCache: Boolean? = null
|
||||
private var excludeYogaFromRawPropsCache: Boolean? = null
|
||||
@@ -141,15 +139,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableCleanTextInputYogaNode(): Boolean {
|
||||
var cached = enableCleanTextInputYogaNodeCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.enableCleanTextInputYogaNode()
|
||||
enableCleanTextInputYogaNodeCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableCppPropsIteratorSetter(): Boolean {
|
||||
var cached = enableCppPropsIteratorSetterCache
|
||||
if (cached == null) {
|
||||
@@ -303,15 +292,6 @@ public class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAccesso
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableTextPreallocationOptimisation(): Boolean {
|
||||
var cached = enableTextPreallocationOptimisationCache
|
||||
if (cached == null) {
|
||||
cached = ReactNativeFeatureFlagsCxxInterop.enableTextPreallocationOptimisation()
|
||||
enableTextPreallocationOptimisationCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableUIConsistency(): Boolean {
|
||||
var cached = enableUIConsistencyCache
|
||||
if (cached == null) {
|
||||
|
||||
+1
-5
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<44d0fe9a36e5e51816e10b8799d451fe>>
|
||||
* @generated SignedSource<<6f5d74e7ec13afa88fbd088182f0ba2b>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -44,8 +44,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableBridgelessArchitecture(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableCleanTextInputYogaNode(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableCppPropsIteratorSetter(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableDeletionOfUnmountedViews(): Boolean
|
||||
@@ -80,8 +78,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableSynchronousStateUpdates(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableTextPreallocationOptimisation(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableUIConsistency(): Boolean
|
||||
|
||||
@DoNotStrip @JvmStatic public external fun enableViewRecycling(): Boolean
|
||||
|
||||
+1
-5
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<917a6effbfd0a476cc05d90abee3c80b>>
|
||||
* @generated SignedSource<<e1868b062c62107e77fe2897a0681e6e>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -39,8 +39,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun enableBridgelessArchitecture(): Boolean = false
|
||||
|
||||
override fun enableCleanTextInputYogaNode(): Boolean = false
|
||||
|
||||
override fun enableCppPropsIteratorSetter(): Boolean = false
|
||||
|
||||
override fun enableDeletionOfUnmountedViews(): Boolean = false
|
||||
@@ -75,8 +73,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
|
||||
|
||||
override fun enableSynchronousStateUpdates(): Boolean = false
|
||||
|
||||
override fun enableTextPreallocationOptimisation(): Boolean = false
|
||||
|
||||
override fun enableUIConsistency(): Boolean = false
|
||||
|
||||
override fun enableViewRecycling(): Boolean = false
|
||||
|
||||
+1
-23
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<2ad36465b1a411cb55d85416bd8ba823>>
|
||||
* @generated SignedSource<<c6e809489f71a930ad05d83a4ef37cde>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -32,7 +32,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var enableAlignItemsBaselineOnFabricIOSCache: Boolean? = null
|
||||
private var enableAndroidLineHeightCenteringCache: Boolean? = null
|
||||
private var enableBridgelessArchitectureCache: Boolean? = null
|
||||
private var enableCleanTextInputYogaNodeCache: Boolean? = null
|
||||
private var enableCppPropsIteratorSetterCache: Boolean? = null
|
||||
private var enableDeletionOfUnmountedViewsCache: Boolean? = null
|
||||
private var enableEagerRootViewAttachmentCache: Boolean? = null
|
||||
@@ -50,7 +49,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
private var enablePropsUpdateReconciliationAndroidCache: Boolean? = null
|
||||
private var enableReportEventPaintTimeCache: Boolean? = null
|
||||
private var enableSynchronousStateUpdatesCache: Boolean? = null
|
||||
private var enableTextPreallocationOptimisationCache: Boolean? = null
|
||||
private var enableUIConsistencyCache: Boolean? = null
|
||||
private var enableViewRecyclingCache: Boolean? = null
|
||||
private var excludeYogaFromRawPropsCache: Boolean? = null
|
||||
@@ -153,16 +151,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableCleanTextInputYogaNode(): Boolean {
|
||||
var cached = enableCleanTextInputYogaNodeCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.enableCleanTextInputYogaNode()
|
||||
accessedFeatureFlags.add("enableCleanTextInputYogaNode")
|
||||
enableCleanTextInputYogaNodeCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableCppPropsIteratorSetter(): Boolean {
|
||||
var cached = enableCppPropsIteratorSetterCache
|
||||
if (cached == null) {
|
||||
@@ -333,16 +321,6 @@ public class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcces
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableTextPreallocationOptimisation(): Boolean {
|
||||
var cached = enableTextPreallocationOptimisationCache
|
||||
if (cached == null) {
|
||||
cached = currentProvider.enableTextPreallocationOptimisation()
|
||||
accessedFeatureFlags.add("enableTextPreallocationOptimisation")
|
||||
enableTextPreallocationOptimisationCache = cached
|
||||
}
|
||||
return cached
|
||||
}
|
||||
|
||||
override fun enableUIConsistency(): Boolean {
|
||||
var cached = enableUIConsistencyCache
|
||||
if (cached == null) {
|
||||
|
||||
+1
-5
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<9770a9f125b8bcb4b1daef9e3458433f>>
|
||||
* @generated SignedSource<<4c0f737c0dfaa5095d46defe1f67bddf>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -39,8 +39,6 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun enableBridgelessArchitecture(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableCleanTextInputYogaNode(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableCppPropsIteratorSetter(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableDeletionOfUnmountedViews(): Boolean
|
||||
@@ -75,8 +73,6 @@ public interface ReactNativeFeatureFlagsProvider {
|
||||
|
||||
@DoNotStrip public fun enableSynchronousStateUpdates(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableTextPreallocationOptimisation(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableUIConsistency(): Boolean
|
||||
|
||||
@DoNotStrip public fun enableViewRecycling(): Boolean
|
||||
|
||||
+11
-9
@@ -923,17 +923,19 @@ public class ReactHostImpl implements ReactHost {
|
||||
final String method = "getOrCreateStartTask()";
|
||||
if (mStartTask == null) {
|
||||
log(method, "Schedule");
|
||||
Assertions.assertCondition(
|
||||
ReactNativeFeatureFlags.enableBridgelessArchitecture(),
|
||||
"enableBridgelessArchitecture FeatureFlag must be set to start ReactNative.");
|
||||
if (ReactBuildConfig.DEBUG) {
|
||||
Assertions.assertCondition(
|
||||
ReactNativeFeatureFlags.enableBridgelessArchitecture(),
|
||||
"enableBridgelessArchitecture FeatureFlag must be set to start ReactNative.");
|
||||
|
||||
Assertions.assertCondition(
|
||||
ReactNativeFeatureFlags.enableFabricRenderer(),
|
||||
"enableFabricRenderer FeatureFlag must be set to start ReactNative.");
|
||||
Assertions.assertCondition(
|
||||
ReactNativeFeatureFlags.enableFabricRenderer(),
|
||||
"enableFabricRenderer FeatureFlag must be set to start ReactNative.");
|
||||
|
||||
Assertions.assertCondition(
|
||||
ReactNativeFeatureFlags.useTurboModules(),
|
||||
"useTurboModules FeatureFlag must be set to start ReactNative.");
|
||||
Assertions.assertCondition(
|
||||
ReactNativeFeatureFlags.useTurboModules(),
|
||||
"useTurboModules FeatureFlag must be set to start ReactNative.");
|
||||
}
|
||||
mStartTask =
|
||||
waitThenCallGetOrCreateReactInstanceTask()
|
||||
.continueWithTask(
|
||||
|
||||
@@ -967,7 +967,6 @@ void FabricMountingManager::preallocateShadowView(
|
||||
// Updating state on Android side has a cost and doing it unnecessarily for
|
||||
// dummy state is wasteful.
|
||||
bool preventPassingStateWrapperForText =
|
||||
ReactNativeFeatureFlags::enableTextPreallocationOptimisation() &&
|
||||
strcmp(shadowView.componentName, "Paragraph") == 0;
|
||||
if (shadowView.state != nullptr && !preventPassingStateWrapperForText) {
|
||||
javaStateWrapper = StateWrapperImpl::newObjectJavaArgs();
|
||||
|
||||
+1
-29
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<aaf6af36813ab1895bf2bf8a6c8bcf1c>>
|
||||
* @generated SignedSource<<e51d7efeeff83508fa5f1a7a46ee859d>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -87,12 +87,6 @@ class ReactNativeFeatureFlagsProviderHolder
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableCleanTextInputYogaNode() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableCleanTextInputYogaNode");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableCppPropsIteratorSetter() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableCppPropsIteratorSetter");
|
||||
@@ -195,12 +189,6 @@ class ReactNativeFeatureFlagsProviderHolder
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableTextPreallocationOptimisation() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableTextPreallocationOptimisation");
|
||||
return method(javaProvider_);
|
||||
}
|
||||
|
||||
bool enableUIConsistency() override {
|
||||
static const auto method =
|
||||
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableUIConsistency");
|
||||
@@ -371,11 +359,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableBridgelessArchitecture(
|
||||
return ReactNativeFeatureFlags::enableBridgelessArchitecture();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableCleanTextInputYogaNode(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableCleanTextInputYogaNode();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableCppPropsIteratorSetter(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableCppPropsIteratorSetter();
|
||||
@@ -461,11 +444,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableSynchronousStateUpdates(
|
||||
return ReactNativeFeatureFlags::enableSynchronousStateUpdates();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableTextPreallocationOptimisation(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableTextPreallocationOptimisation();
|
||||
}
|
||||
|
||||
bool JReactNativeFeatureFlagsCxxInterop::enableUIConsistency(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
|
||||
return ReactNativeFeatureFlags::enableUIConsistency();
|
||||
@@ -626,9 +604,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"enableBridgelessArchitecture",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableBridgelessArchitecture),
|
||||
makeNativeMethod(
|
||||
"enableCleanTextInputYogaNode",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableCleanTextInputYogaNode),
|
||||
makeNativeMethod(
|
||||
"enableCppPropsIteratorSetter",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableCppPropsIteratorSetter),
|
||||
@@ -680,9 +655,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
|
||||
makeNativeMethod(
|
||||
"enableSynchronousStateUpdates",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableSynchronousStateUpdates),
|
||||
makeNativeMethod(
|
||||
"enableTextPreallocationOptimisation",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableTextPreallocationOptimisation),
|
||||
makeNativeMethod(
|
||||
"enableUIConsistency",
|
||||
JReactNativeFeatureFlagsCxxInterop::enableUIConsistency),
|
||||
|
||||
+1
-7
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<d4194069e582c0aa5e90938b27067044>>
|
||||
* @generated SignedSource<<161df10ef8d0b49dce49c9d0e9354279>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -54,9 +54,6 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool enableBridgelessArchitecture(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableCleanTextInputYogaNode(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableCppPropsIteratorSetter(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
@@ -108,9 +105,6 @@ class JReactNativeFeatureFlagsCxxInterop
|
||||
static bool enableSynchronousStateUpdates(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableTextPreallocationOptimisation(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
static bool enableUIConsistency(
|
||||
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<abba7ef1f3108b195eef7bfc0a9a26db>>
|
||||
* @generated SignedSource<<0b4373e19b66481d17c0a8e81785df23>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -58,10 +58,6 @@ bool ReactNativeFeatureFlags::enableBridgelessArchitecture() {
|
||||
return getAccessor().enableBridgelessArchitecture();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableCleanTextInputYogaNode() {
|
||||
return getAccessor().enableCleanTextInputYogaNode();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableCppPropsIteratorSetter() {
|
||||
return getAccessor().enableCppPropsIteratorSetter();
|
||||
}
|
||||
@@ -130,10 +126,6 @@ bool ReactNativeFeatureFlags::enableSynchronousStateUpdates() {
|
||||
return getAccessor().enableSynchronousStateUpdates();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableTextPreallocationOptimisation() {
|
||||
return getAccessor().enableTextPreallocationOptimisation();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlags::enableUIConsistency() {
|
||||
return getAccessor().enableUIConsistency();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<c6419e8e932f65c7be43425e01776dc9>>
|
||||
* @generated SignedSource<<fdd3b31a0a8fbd406a14c8a088350034>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -79,11 +79,6 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool enableBridgelessArchitecture();
|
||||
|
||||
/**
|
||||
* Clean yoga node when <TextInput /> does not change.
|
||||
*/
|
||||
RN_EXPORT static bool enableCleanTextInputYogaNode();
|
||||
|
||||
/**
|
||||
* Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).
|
||||
*/
|
||||
@@ -169,11 +164,6 @@ class ReactNativeFeatureFlags {
|
||||
*/
|
||||
RN_EXPORT static bool enableSynchronousStateUpdates();
|
||||
|
||||
/**
|
||||
* Text preallocation optimisation where unnecessary work is removed.
|
||||
*/
|
||||
RN_EXPORT static bool enableTextPreallocationOptimisation();
|
||||
|
||||
/**
|
||||
* Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).
|
||||
*/
|
||||
|
||||
+39
-75
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<fe44d2dba1abe83205db630abe1c2e9a>>
|
||||
* @generated SignedSource<<3ee70c854f08a871c4951e231f5c27c2>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -173,24 +173,6 @@ bool ReactNativeFeatureFlagsAccessor::enableBridgelessArchitecture() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableCleanTextInputYogaNode() {
|
||||
auto flagValue = enableCleanTextInputYogaNode_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
// If multiple threads try to initialize the feature flag, we would only
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(8, "enableCleanTextInputYogaNode");
|
||||
|
||||
flagValue = currentProvider_->enableCleanTextInputYogaNode();
|
||||
enableCleanTextInputYogaNode_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableCppPropsIteratorSetter() {
|
||||
auto flagValue = enableCppPropsIteratorSetter_.load();
|
||||
|
||||
@@ -200,7 +182,7 @@ bool ReactNativeFeatureFlagsAccessor::enableCppPropsIteratorSetter() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(9, "enableCppPropsIteratorSetter");
|
||||
markFlagAsAccessed(8, "enableCppPropsIteratorSetter");
|
||||
|
||||
flagValue = currentProvider_->enableCppPropsIteratorSetter();
|
||||
enableCppPropsIteratorSetter_ = flagValue;
|
||||
@@ -218,7 +200,7 @@ bool ReactNativeFeatureFlagsAccessor::enableDeletionOfUnmountedViews() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(10, "enableDeletionOfUnmountedViews");
|
||||
markFlagAsAccessed(9, "enableDeletionOfUnmountedViews");
|
||||
|
||||
flagValue = currentProvider_->enableDeletionOfUnmountedViews();
|
||||
enableDeletionOfUnmountedViews_ = flagValue;
|
||||
@@ -236,7 +218,7 @@ bool ReactNativeFeatureFlagsAccessor::enableEagerRootViewAttachment() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(11, "enableEagerRootViewAttachment");
|
||||
markFlagAsAccessed(10, "enableEagerRootViewAttachment");
|
||||
|
||||
flagValue = currentProvider_->enableEagerRootViewAttachment();
|
||||
enableEagerRootViewAttachment_ = flagValue;
|
||||
@@ -254,7 +236,7 @@ bool ReactNativeFeatureFlagsAccessor::enableEventEmitterRetentionDuringGesturesO
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(12, "enableEventEmitterRetentionDuringGesturesOnAndroid");
|
||||
markFlagAsAccessed(11, "enableEventEmitterRetentionDuringGesturesOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->enableEventEmitterRetentionDuringGesturesOnAndroid();
|
||||
enableEventEmitterRetentionDuringGesturesOnAndroid_ = flagValue;
|
||||
@@ -272,7 +254,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFabricLogs() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(13, "enableFabricLogs");
|
||||
markFlagAsAccessed(12, "enableFabricLogs");
|
||||
|
||||
flagValue = currentProvider_->enableFabricLogs();
|
||||
enableFabricLogs_ = flagValue;
|
||||
@@ -290,7 +272,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFabricRenderer() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(14, "enableFabricRenderer");
|
||||
markFlagAsAccessed(13, "enableFabricRenderer");
|
||||
|
||||
flagValue = currentProvider_->enableFabricRenderer();
|
||||
enableFabricRenderer_ = flagValue;
|
||||
@@ -308,7 +290,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFabricRendererExclusively() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(15, "enableFabricRendererExclusively");
|
||||
markFlagAsAccessed(14, "enableFabricRendererExclusively");
|
||||
|
||||
flagValue = currentProvider_->enableFabricRendererExclusively();
|
||||
enableFabricRendererExclusively_ = flagValue;
|
||||
@@ -326,7 +308,7 @@ bool ReactNativeFeatureFlagsAccessor::enableGranularShadowTreeStateReconciliatio
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(16, "enableGranularShadowTreeStateReconciliation");
|
||||
markFlagAsAccessed(15, "enableGranularShadowTreeStateReconciliation");
|
||||
|
||||
flagValue = currentProvider_->enableGranularShadowTreeStateReconciliation();
|
||||
enableGranularShadowTreeStateReconciliation_ = flagValue;
|
||||
@@ -344,7 +326,7 @@ bool ReactNativeFeatureFlagsAccessor::enableIOSViewClipToPaddingBox() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(17, "enableIOSViewClipToPaddingBox");
|
||||
markFlagAsAccessed(16, "enableIOSViewClipToPaddingBox");
|
||||
|
||||
flagValue = currentProvider_->enableIOSViewClipToPaddingBox();
|
||||
enableIOSViewClipToPaddingBox_ = flagValue;
|
||||
@@ -362,7 +344,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(18, "enableLayoutAnimationsOnAndroid");
|
||||
markFlagAsAccessed(17, "enableLayoutAnimationsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->enableLayoutAnimationsOnAndroid();
|
||||
enableLayoutAnimationsOnAndroid_ = flagValue;
|
||||
@@ -380,7 +362,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnIOS() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(19, "enableLayoutAnimationsOnIOS");
|
||||
markFlagAsAccessed(18, "enableLayoutAnimationsOnIOS");
|
||||
|
||||
flagValue = currentProvider_->enableLayoutAnimationsOnIOS();
|
||||
enableLayoutAnimationsOnIOS_ = flagValue;
|
||||
@@ -398,7 +380,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLongTaskAPI() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(20, "enableLongTaskAPI");
|
||||
markFlagAsAccessed(19, "enableLongTaskAPI");
|
||||
|
||||
flagValue = currentProvider_->enableLongTaskAPI();
|
||||
enableLongTaskAPI_ = flagValue;
|
||||
@@ -416,7 +398,7 @@ bool ReactNativeFeatureFlagsAccessor::enableNewBackgroundAndBorderDrawables() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(21, "enableNewBackgroundAndBorderDrawables");
|
||||
markFlagAsAccessed(20, "enableNewBackgroundAndBorderDrawables");
|
||||
|
||||
flagValue = currentProvider_->enableNewBackgroundAndBorderDrawables();
|
||||
enableNewBackgroundAndBorderDrawables_ = flagValue;
|
||||
@@ -434,7 +416,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePreciseSchedulingForPremountItemsOnA
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(22, "enablePreciseSchedulingForPremountItemsOnAndroid");
|
||||
markFlagAsAccessed(21, "enablePreciseSchedulingForPremountItemsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->enablePreciseSchedulingForPremountItemsOnAndroid();
|
||||
enablePreciseSchedulingForPremountItemsOnAndroid_ = flagValue;
|
||||
@@ -452,7 +434,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePropsUpdateReconciliationAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(23, "enablePropsUpdateReconciliationAndroid");
|
||||
markFlagAsAccessed(22, "enablePropsUpdateReconciliationAndroid");
|
||||
|
||||
flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid();
|
||||
enablePropsUpdateReconciliationAndroid_ = flagValue;
|
||||
@@ -470,7 +452,7 @@ bool ReactNativeFeatureFlagsAccessor::enableReportEventPaintTime() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(24, "enableReportEventPaintTime");
|
||||
markFlagAsAccessed(23, "enableReportEventPaintTime");
|
||||
|
||||
flagValue = currentProvider_->enableReportEventPaintTime();
|
||||
enableReportEventPaintTime_ = flagValue;
|
||||
@@ -488,7 +470,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSynchronousStateUpdates() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(25, "enableSynchronousStateUpdates");
|
||||
markFlagAsAccessed(24, "enableSynchronousStateUpdates");
|
||||
|
||||
flagValue = currentProvider_->enableSynchronousStateUpdates();
|
||||
enableSynchronousStateUpdates_ = flagValue;
|
||||
@@ -497,24 +479,6 @@ bool ReactNativeFeatureFlagsAccessor::enableSynchronousStateUpdates() {
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableTextPreallocationOptimisation() {
|
||||
auto flagValue = enableTextPreallocationOptimisation_.load();
|
||||
|
||||
if (!flagValue.has_value()) {
|
||||
// This block is not exclusive but it is not necessary.
|
||||
// If multiple threads try to initialize the feature flag, we would only
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(26, "enableTextPreallocationOptimisation");
|
||||
|
||||
flagValue = currentProvider_->enableTextPreallocationOptimisation();
|
||||
enableTextPreallocationOptimisation_ = flagValue;
|
||||
}
|
||||
|
||||
return flagValue.value();
|
||||
}
|
||||
|
||||
bool ReactNativeFeatureFlagsAccessor::enableUIConsistency() {
|
||||
auto flagValue = enableUIConsistency_.load();
|
||||
|
||||
@@ -524,7 +488,7 @@ bool ReactNativeFeatureFlagsAccessor::enableUIConsistency() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(27, "enableUIConsistency");
|
||||
markFlagAsAccessed(25, "enableUIConsistency");
|
||||
|
||||
flagValue = currentProvider_->enableUIConsistency();
|
||||
enableUIConsistency_ = flagValue;
|
||||
@@ -542,7 +506,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecycling() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(28, "enableViewRecycling");
|
||||
markFlagAsAccessed(26, "enableViewRecycling");
|
||||
|
||||
flagValue = currentProvider_->enableViewRecycling();
|
||||
enableViewRecycling_ = flagValue;
|
||||
@@ -560,7 +524,7 @@ bool ReactNativeFeatureFlagsAccessor::excludeYogaFromRawProps() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(29, "excludeYogaFromRawProps");
|
||||
markFlagAsAccessed(27, "excludeYogaFromRawProps");
|
||||
|
||||
flagValue = currentProvider_->excludeYogaFromRawProps();
|
||||
excludeYogaFromRawProps_ = flagValue;
|
||||
@@ -578,7 +542,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAn
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(30, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
markFlagAsAccessed(28, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
|
||||
|
||||
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
|
||||
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
|
||||
@@ -596,7 +560,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMountingCoordinatorReportedPendingTrans
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(31, "fixMountingCoordinatorReportedPendingTransactionsOnAndroid");
|
||||
markFlagAsAccessed(29, "fixMountingCoordinatorReportedPendingTransactionsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->fixMountingCoordinatorReportedPendingTransactionsOnAndroid();
|
||||
fixMountingCoordinatorReportedPendingTransactionsOnAndroid_ = flagValue;
|
||||
@@ -614,7 +578,7 @@ bool ReactNativeFeatureFlagsAccessor::forceBatchingMountItemsOnAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(32, "forceBatchingMountItemsOnAndroid");
|
||||
markFlagAsAccessed(30, "forceBatchingMountItemsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->forceBatchingMountItemsOnAndroid();
|
||||
forceBatchingMountItemsOnAndroid_ = flagValue;
|
||||
@@ -632,7 +596,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledDebug() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(33, "fuseboxEnabledDebug");
|
||||
markFlagAsAccessed(31, "fuseboxEnabledDebug");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledDebug();
|
||||
fuseboxEnabledDebug_ = flagValue;
|
||||
@@ -650,7 +614,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(34, "fuseboxEnabledRelease");
|
||||
markFlagAsAccessed(32, "fuseboxEnabledRelease");
|
||||
|
||||
flagValue = currentProvider_->fuseboxEnabledRelease();
|
||||
fuseboxEnabledRelease_ = flagValue;
|
||||
@@ -668,7 +632,7 @@ bool ReactNativeFeatureFlagsAccessor::initEagerTurboModulesOnNativeModulesQueueA
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(35, "initEagerTurboModulesOnNativeModulesQueueAndroid");
|
||||
markFlagAsAccessed(33, "initEagerTurboModulesOnNativeModulesQueueAndroid");
|
||||
|
||||
flagValue = currentProvider_->initEagerTurboModulesOnNativeModulesQueueAndroid();
|
||||
initEagerTurboModulesOnNativeModulesQueueAndroid_ = flagValue;
|
||||
@@ -686,7 +650,7 @@ bool ReactNativeFeatureFlagsAccessor::lazyAnimationCallbacks() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(36, "lazyAnimationCallbacks");
|
||||
markFlagAsAccessed(34, "lazyAnimationCallbacks");
|
||||
|
||||
flagValue = currentProvider_->lazyAnimationCallbacks();
|
||||
lazyAnimationCallbacks_ = flagValue;
|
||||
@@ -704,7 +668,7 @@ bool ReactNativeFeatureFlagsAccessor::loadVectorDrawablesOnImages() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(37, "loadVectorDrawablesOnImages");
|
||||
markFlagAsAccessed(35, "loadVectorDrawablesOnImages");
|
||||
|
||||
flagValue = currentProvider_->loadVectorDrawablesOnImages();
|
||||
loadVectorDrawablesOnImages_ = flagValue;
|
||||
@@ -722,7 +686,7 @@ bool ReactNativeFeatureFlagsAccessor::setAndroidLayoutDirection() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(38, "setAndroidLayoutDirection");
|
||||
markFlagAsAccessed(36, "setAndroidLayoutDirection");
|
||||
|
||||
flagValue = currentProvider_->setAndroidLayoutDirection();
|
||||
setAndroidLayoutDirection_ = flagValue;
|
||||
@@ -740,7 +704,7 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(39, "traceTurboModulePromiseRejectionsOnAndroid");
|
||||
markFlagAsAccessed(37, "traceTurboModulePromiseRejectionsOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid();
|
||||
traceTurboModulePromiseRejectionsOnAndroid_ = flagValue;
|
||||
@@ -758,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(40, "useFabricInterop");
|
||||
markFlagAsAccessed(38, "useFabricInterop");
|
||||
|
||||
flagValue = currentProvider_->useFabricInterop();
|
||||
useFabricInterop_ = flagValue;
|
||||
@@ -776,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::useImmediateExecutorInAndroidBridgeless()
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(41, "useImmediateExecutorInAndroidBridgeless");
|
||||
markFlagAsAccessed(39, "useImmediateExecutorInAndroidBridgeless");
|
||||
|
||||
flagValue = currentProvider_->useImmediateExecutorInAndroidBridgeless();
|
||||
useImmediateExecutorInAndroidBridgeless_ = flagValue;
|
||||
@@ -794,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(42, "useNativeViewConfigsInBridgelessMode");
|
||||
markFlagAsAccessed(40, "useNativeViewConfigsInBridgelessMode");
|
||||
|
||||
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
|
||||
useNativeViewConfigsInBridgelessMode_ = flagValue;
|
||||
@@ -812,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimisedViewPreallocationOnAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(43, "useOptimisedViewPreallocationOnAndroid");
|
||||
markFlagAsAccessed(41, "useOptimisedViewPreallocationOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->useOptimisedViewPreallocationOnAndroid();
|
||||
useOptimisedViewPreallocationOnAndroid_ = flagValue;
|
||||
@@ -830,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(44, "useOptimizedEventBatchingOnAndroid");
|
||||
markFlagAsAccessed(42, "useOptimizedEventBatchingOnAndroid");
|
||||
|
||||
flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid();
|
||||
useOptimizedEventBatchingOnAndroid_ = flagValue;
|
||||
@@ -848,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::useRuntimeShadowNodeReferenceUpdate() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(45, "useRuntimeShadowNodeReferenceUpdate");
|
||||
markFlagAsAccessed(43, "useRuntimeShadowNodeReferenceUpdate");
|
||||
|
||||
flagValue = currentProvider_->useRuntimeShadowNodeReferenceUpdate();
|
||||
useRuntimeShadowNodeReferenceUpdate_ = flagValue;
|
||||
@@ -866,7 +830,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(46, "useTurboModuleInterop");
|
||||
markFlagAsAccessed(44, "useTurboModuleInterop");
|
||||
|
||||
flagValue = currentProvider_->useTurboModuleInterop();
|
||||
useTurboModuleInterop_ = flagValue;
|
||||
@@ -884,7 +848,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() {
|
||||
// be accessing the provider multiple times but the end state of this
|
||||
// instance and the returned flag value would be the same.
|
||||
|
||||
markFlagAsAccessed(47, "useTurboModules");
|
||||
markFlagAsAccessed(45, "useTurboModules");
|
||||
|
||||
flagValue = currentProvider_->useTurboModules();
|
||||
useTurboModules_ = flagValue;
|
||||
|
||||
+2
-6
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<afdb4fb4d8419dca361ca8bf7dbc4fb3>>
|
||||
* @generated SignedSource<<337a399929dd2a198b1b7d99ff395236>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -40,7 +40,6 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool enableAlignItemsBaselineOnFabricIOS();
|
||||
bool enableAndroidLineHeightCentering();
|
||||
bool enableBridgelessArchitecture();
|
||||
bool enableCleanTextInputYogaNode();
|
||||
bool enableCppPropsIteratorSetter();
|
||||
bool enableDeletionOfUnmountedViews();
|
||||
bool enableEagerRootViewAttachment();
|
||||
@@ -58,7 +57,6 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
bool enablePropsUpdateReconciliationAndroid();
|
||||
bool enableReportEventPaintTime();
|
||||
bool enableSynchronousStateUpdates();
|
||||
bool enableTextPreallocationOptimisation();
|
||||
bool enableUIConsistency();
|
||||
bool enableViewRecycling();
|
||||
bool excludeYogaFromRawProps();
|
||||
@@ -91,7 +89,7 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
|
||||
bool wasOverridden_;
|
||||
|
||||
std::array<std::atomic<const char*>, 48> accessedFeatureFlags_;
|
||||
std::array<std::atomic<const char*>, 46> accessedFeatureFlags_;
|
||||
|
||||
std::atomic<std::optional<bool>> commonTestFlag_;
|
||||
std::atomic<std::optional<bool>> allowRecursiveCommitsWithSynchronousMountOnAndroid_;
|
||||
@@ -101,7 +99,6 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> enableAlignItemsBaselineOnFabricIOS_;
|
||||
std::atomic<std::optional<bool>> enableAndroidLineHeightCentering_;
|
||||
std::atomic<std::optional<bool>> enableBridgelessArchitecture_;
|
||||
std::atomic<std::optional<bool>> enableCleanTextInputYogaNode_;
|
||||
std::atomic<std::optional<bool>> enableCppPropsIteratorSetter_;
|
||||
std::atomic<std::optional<bool>> enableDeletionOfUnmountedViews_;
|
||||
std::atomic<std::optional<bool>> enableEagerRootViewAttachment_;
|
||||
@@ -119,7 +116,6 @@ class ReactNativeFeatureFlagsAccessor {
|
||||
std::atomic<std::optional<bool>> enablePropsUpdateReconciliationAndroid_;
|
||||
std::atomic<std::optional<bool>> enableReportEventPaintTime_;
|
||||
std::atomic<std::optional<bool>> enableSynchronousStateUpdates_;
|
||||
std::atomic<std::optional<bool>> enableTextPreallocationOptimisation_;
|
||||
std::atomic<std::optional<bool>> enableUIConsistency_;
|
||||
std::atomic<std::optional<bool>> enableViewRecycling_;
|
||||
std::atomic<std::optional<bool>> excludeYogaFromRawProps_;
|
||||
|
||||
+1
-9
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<631c825e33e07674e19a084a33637a50>>
|
||||
* @generated SignedSource<<65bca35ca4b820d9b311b4d9a194fdab>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -59,10 +59,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enableCleanTextInputYogaNode() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enableCppPropsIteratorSetter() override {
|
||||
return false;
|
||||
}
|
||||
@@ -131,10 +127,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enableTextPreallocationOptimisation() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool enableUIConsistency() override {
|
||||
return false;
|
||||
}
|
||||
|
||||
+1
-3
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<18597e1e2a88be3d80b8747f72576d5f>>
|
||||
* @generated SignedSource<<6f33275c4058c3c67653247c1983f526>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,6 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool enableAlignItemsBaselineOnFabricIOS() = 0;
|
||||
virtual bool enableAndroidLineHeightCentering() = 0;
|
||||
virtual bool enableBridgelessArchitecture() = 0;
|
||||
virtual bool enableCleanTextInputYogaNode() = 0;
|
||||
virtual bool enableCppPropsIteratorSetter() = 0;
|
||||
virtual bool enableDeletionOfUnmountedViews() = 0;
|
||||
virtual bool enableEagerRootViewAttachment() = 0;
|
||||
@@ -51,7 +50,6 @@ class ReactNativeFeatureFlagsProvider {
|
||||
virtual bool enablePropsUpdateReconciliationAndroid() = 0;
|
||||
virtual bool enableReportEventPaintTime() = 0;
|
||||
virtual bool enableSynchronousStateUpdates() = 0;
|
||||
virtual bool enableTextPreallocationOptimisation() = 0;
|
||||
virtual bool enableUIConsistency() = 0;
|
||||
virtual bool enableViewRecycling() = 0;
|
||||
virtual bool excludeYogaFromRawProps() = 0;
|
||||
|
||||
+1
-11
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<43e3b8b18dec356b5121b581ab8ffa02>>
|
||||
* @generated SignedSource<<9c9ab8e276227aa107d905c5eb6578ae>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -91,11 +91,6 @@ bool NativeReactNativeFeatureFlags::enableBridgelessArchitecture(
|
||||
return ReactNativeFeatureFlags::enableBridgelessArchitecture();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableCleanTextInputYogaNode(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableCleanTextInputYogaNode();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableCppPropsIteratorSetter(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableCppPropsIteratorSetter();
|
||||
@@ -188,11 +183,6 @@ bool NativeReactNativeFeatureFlags::enableSynchronousStateUpdates(
|
||||
return ReactNativeFeatureFlags::enableSynchronousStateUpdates();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableTextPreallocationOptimisation(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableTextPreallocationOptimisation();
|
||||
}
|
||||
|
||||
bool NativeReactNativeFeatureFlags::enableUIConsistency(
|
||||
jsi::Runtime& /*runtime*/) {
|
||||
return ReactNativeFeatureFlags::enableUIConsistency();
|
||||
|
||||
+1
-5
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<f6fb3afe84c464ac7ae60b34181c182b>>
|
||||
* @generated SignedSource<<81af74188979662ffc39840c1521ca72>>
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -55,8 +55,6 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool enableBridgelessArchitecture(jsi::Runtime& runtime);
|
||||
|
||||
bool enableCleanTextInputYogaNode(jsi::Runtime& runtime);
|
||||
|
||||
bool enableCppPropsIteratorSetter(jsi::Runtime& runtime);
|
||||
|
||||
bool enableDeletionOfUnmountedViews(jsi::Runtime& runtime);
|
||||
@@ -93,8 +91,6 @@ class NativeReactNativeFeatureFlags
|
||||
|
||||
bool enableSynchronousStateUpdates(jsi::Runtime& runtime);
|
||||
|
||||
bool enableTextPreallocationOptimisation(jsi::Runtime& runtime);
|
||||
|
||||
bool enableUIConsistency(jsi::Runtime& runtime);
|
||||
|
||||
bool enableViewRecycling(jsi::Runtime& runtime);
|
||||
|
||||
+24
-1
@@ -17,6 +17,7 @@
|
||||
#include <react/renderer/attributedstring/TextAttributes.h>
|
||||
#include <react/renderer/attributedstring/conversions.h>
|
||||
#include <react/renderer/components/image/conversions.h>
|
||||
#include <react/renderer/components/textinput/baseConversions.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/graphicsConversions.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
@@ -113,7 +114,19 @@ BaseTextInputProps::BaseTextInputProps(
|
||||
rawProps,
|
||||
"readOnly",
|
||||
sourceProps.readOnly,
|
||||
{})) {}
|
||||
{})),
|
||||
submitBehavior(convertRawProp(
|
||||
context,
|
||||
rawProps,
|
||||
"submitBehavior",
|
||||
sourceProps.submitBehavior,
|
||||
{})),
|
||||
multiline(convertRawProp(
|
||||
context,
|
||||
rawProps,
|
||||
"multiline",
|
||||
sourceProps.multiline,
|
||||
{false})) {}
|
||||
|
||||
void BaseTextInputProps::setProp(
|
||||
const PropsParserContext& context,
|
||||
@@ -193,7 +206,17 @@ void BaseTextInputProps::setProp(
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(autoCapitalize);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(editable);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(readOnly);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(submitBehavior);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(multiline);
|
||||
}
|
||||
}
|
||||
|
||||
SubmitBehavior BaseTextInputProps::getNonDefaultSubmitBehavior() const {
|
||||
if (submitBehavior == SubmitBehavior::Default) {
|
||||
return multiline ? SubmitBehavior::Newline : SubmitBehavior::BlurAndSubmit;
|
||||
}
|
||||
|
||||
return submitBehavior;
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
+7
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <react/renderer/attributedstring/ParagraphAttributes.h>
|
||||
#include <react/renderer/components/text/BaseTextProps.h>
|
||||
#include <react/renderer/components/textinput/basePrimitives.h>
|
||||
#include <react/renderer/components/view/ViewProps.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
@@ -66,6 +67,12 @@ class BaseTextInputProps : public ViewProps, public BaseTextProps {
|
||||
|
||||
bool editable{true};
|
||||
bool readOnly{false};
|
||||
|
||||
SubmitBehavior submitBehavior{SubmitBehavior::Default};
|
||||
|
||||
bool multiline{false};
|
||||
|
||||
SubmitBehavior getNonDefaultSubmitBehavior() const;
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/textinput/basePrimitives.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/RawValue.h>
|
||||
#include <string>
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
inline void fromRawValue(
|
||||
const PropsParserContext& /*context*/,
|
||||
const RawValue& value,
|
||||
SubmitBehavior& result) {
|
||||
auto string = static_cast<std::string>(value);
|
||||
if (string == "newline") {
|
||||
result = SubmitBehavior::Newline;
|
||||
} else if (string == "submit") {
|
||||
result = SubmitBehavior::Submit;
|
||||
} else if (string == "blurAndSubmit") {
|
||||
result = SubmitBehavior::BlurAndSubmit;
|
||||
} else {
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
inline folly::dynamic toDynamic(const SubmitBehavior& value) {
|
||||
switch (value) {
|
||||
case SubmitBehavior::Newline:
|
||||
return "newline";
|
||||
case SubmitBehavior::Submit:
|
||||
return "submit";
|
||||
case SubmitBehavior::BlurAndSubmit:
|
||||
return "blurAndSubmit";
|
||||
case SubmitBehavior::Default:
|
||||
return {nullptr};
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace facebook::react
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace facebook::react {
|
||||
|
||||
enum class SubmitBehavior {
|
||||
Default,
|
||||
Submit,
|
||||
BlurAndSubmit,
|
||||
Newline,
|
||||
};
|
||||
|
||||
} // namespace facebook::react
|
||||
+2
-11
@@ -8,6 +8,7 @@
|
||||
#include "AndroidTextInputProps.h"
|
||||
#include <react/featureflags/ReactNativeFeatureFlags.h>
|
||||
#include <react/renderer/components/image/conversions.h>
|
||||
#include <react/renderer/components/textinput/baseConversions.h>
|
||||
#include <react/renderer/core/graphicsConversions.h>
|
||||
#include <react/renderer/core/propsConversions.h>
|
||||
|
||||
@@ -95,10 +96,6 @@ AndroidTextInputProps::AndroidTextInputProps(
|
||||
"returnKeyType",
|
||||
sourceProps.returnKeyType,
|
||||
{})),
|
||||
multiline(ReactNativeFeatureFlags::enableCppPropsIteratorSetter()? sourceProps.multiline : convertRawProp(context, rawProps,
|
||||
"multiline",
|
||||
sourceProps.multiline,
|
||||
{false})),
|
||||
secureTextEntry(ReactNativeFeatureFlags::enableCppPropsIteratorSetter()? sourceProps.secureTextEntry : convertRawProp(context, rawProps,
|
||||
"secureTextEntry",
|
||||
sourceProps.secureTextEntry,
|
||||
@@ -108,10 +105,6 @@ AndroidTextInputProps::AndroidTextInputProps(
|
||||
"selectTextOnFocus",
|
||||
sourceProps.selectTextOnFocus,
|
||||
{false})),
|
||||
submitBehavior(ReactNativeFeatureFlags::enableCppPropsIteratorSetter()? sourceProps.submitBehavior : convertRawProp(context, rawProps,
|
||||
"submitBehavior",
|
||||
sourceProps.submitBehavior,
|
||||
{})),
|
||||
caretHidden(ReactNativeFeatureFlags::enableCppPropsIteratorSetter()? sourceProps.caretHidden : convertRawProp(context, rawProps,
|
||||
"caretHidden",
|
||||
sourceProps.caretHidden,
|
||||
@@ -223,10 +216,8 @@ void AndroidTextInputProps::setProp(
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(maxFontSizeMultiplier);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(keyboardType);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(returnKeyType);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(multiline);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(secureTextEntry);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(selectTextOnFocus);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(submitBehavior);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(caretHidden);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(contextMenuHidden);
|
||||
RAW_SET_PROP_SWITCH_CASE_BASIC(textShadowColor);
|
||||
@@ -322,7 +313,7 @@ folly::dynamic AndroidTextInputProps::getDynamic() const {
|
||||
props["value"] = value;
|
||||
props["defaultValue"] = defaultValue;
|
||||
props["selectTextOnFocus"] = selectTextOnFocus;
|
||||
props["submitBehavior"] = submitBehavior;
|
||||
props["submitBehavior"] = toDynamic(submitBehavior);
|
||||
props["caretHidden"] = caretHidden;
|
||||
props["contextMenuHidden"] = contextMenuHidden;
|
||||
props["textShadowColor"] = toAndroidRepr(textShadowColor);
|
||||
|
||||
+1
-2
@@ -13,6 +13,7 @@
|
||||
#include <react/renderer/attributedstring/TextAttributes.h>
|
||||
#include <react/renderer/attributedstring/conversions.h>
|
||||
#include <react/renderer/components/textinput/BaseTextInputProps.h>
|
||||
#include <react/renderer/components/textinput/basePrimitives.h>
|
||||
#include <react/renderer/core/PropsParserContext.h>
|
||||
#include <react/renderer/core/propsConversions.h>
|
||||
#include <react/renderer/graphics/Color.h>
|
||||
@@ -89,11 +90,9 @@ class AndroidTextInputProps final : public BaseTextInputProps {
|
||||
Float maxFontSizeMultiplier{0.0};
|
||||
std::string keyboardType{};
|
||||
std::string returnKeyType{};
|
||||
bool multiline{false};
|
||||
bool secureTextEntry{false};
|
||||
std::string value{};
|
||||
bool selectTextOnFocus{false};
|
||||
std::string submitBehavior{};
|
||||
bool caretHidden{false};
|
||||
bool contextMenuHidden{false};
|
||||
SharedColor textShadowColor{};
|
||||
|
||||
-18
@@ -27,24 +27,6 @@ namespace facebook::react {
|
||||
|
||||
extern const char AndroidTextInputComponentName[] = "AndroidTextInput";
|
||||
|
||||
AndroidTextInputShadowNode::AndroidTextInputShadowNode(
|
||||
const ShadowNode& sourceShadowNode,
|
||||
const ShadowNodeFragment& fragment)
|
||||
: ConcreteViewShadowNode(sourceShadowNode, fragment) {
|
||||
auto& sourceTextInputShadowNode =
|
||||
static_cast<const AndroidTextInputShadowNode&>(sourceShadowNode);
|
||||
|
||||
if (ReactNativeFeatureFlags::enableCleanTextInputYogaNode()) {
|
||||
if (!fragment.children && !fragment.props &&
|
||||
sourceTextInputShadowNode.getIsLayoutClean()) {
|
||||
// This ParagraphShadowNode was cloned but did not change
|
||||
// in a way that affects its layout. Let's mark it clean
|
||||
// to stop Yoga from traversing it.
|
||||
cleanLayout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AndroidTextInputShadowNode::setContextContainer(
|
||||
ContextContainer* contextContainer) {
|
||||
ensureUnsealed();
|
||||
|
||||
-4
@@ -40,10 +40,6 @@ class AndroidTextInputShadowNode final
|
||||
|
||||
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
||||
|
||||
AndroidTextInputShadowNode(
|
||||
const ShadowNode& sourceShadowNode,
|
||||
const ShadowNodeFragment& fragment);
|
||||
|
||||
void setContextContainer(ContextContainer* contextContainer);
|
||||
|
||||
/*
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <react/renderer/attributedstring/conversions.h>
|
||||
#include <react/renderer/components/iostextinput/propsConversions.h>
|
||||
#include <react/renderer/components/textinput/baseConversions.h>
|
||||
#include <react/renderer/core/graphicsConversions.h>
|
||||
#include <react/renderer/core/propsConversions.h>
|
||||
|
||||
@@ -64,7 +65,7 @@ TextAttributes TextInputProps::getEffectiveTextAttributes(
|
||||
ParagraphAttributes TextInputProps::getEffectiveParagraphAttributes() const {
|
||||
auto result = paragraphAttributes;
|
||||
|
||||
if (!traits.multiline) {
|
||||
if (!multiline) {
|
||||
result.maximumNumberOfLines = 1;
|
||||
}
|
||||
|
||||
|
||||
+3
-20
@@ -20,24 +20,6 @@ namespace facebook::react {
|
||||
|
||||
extern const char TextInputComponentName[] = "TextInput";
|
||||
|
||||
TextInputShadowNode::TextInputShadowNode(
|
||||
const ShadowNode& sourceShadowNode,
|
||||
const ShadowNodeFragment& fragment)
|
||||
: ConcreteViewShadowNode(sourceShadowNode, fragment) {
|
||||
auto& sourceTextInputShadowNode =
|
||||
static_cast<const TextInputShadowNode&>(sourceShadowNode);
|
||||
|
||||
if (ReactNativeFeatureFlags::enableCleanTextInputYogaNode()) {
|
||||
if (!fragment.children && !fragment.props &&
|
||||
sourceTextInputShadowNode.getIsLayoutClean()) {
|
||||
// This ParagraphShadowNode was cloned but did not change
|
||||
// in a way that affects its layout. Let's mark it clean
|
||||
// to stop Yoga from traversing it.
|
||||
cleanLayout();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AttributedStringBox TextInputShadowNode::attributedStringBoxToMeasure(
|
||||
const LayoutContext& layoutContext) const {
|
||||
bool hasMeaningfulState =
|
||||
@@ -83,7 +65,7 @@ AttributedString TextInputShadowNode::getAttributedString(
|
||||
.string = getConcreteProps().text,
|
||||
.textAttributes = textAttributes,
|
||||
// TODO: Is this really meant to be by value?
|
||||
.parentShadowView = ShadowView{}});
|
||||
.parentShadowView = ShadowView(*this)});
|
||||
|
||||
auto attachments = Attachments{};
|
||||
BaseTextShadowNode::buildAttributedString(
|
||||
@@ -111,7 +93,8 @@ void TextInputShadowNode::updateStateIfNeeded(
|
||||
(!state.layoutManager || state.layoutManager == textLayoutManager_) &&
|
||||
"`StateData` refers to a different `TextLayoutManager`");
|
||||
|
||||
if (state.reactTreeAttributedString == reactTreeAttributedString &&
|
||||
if (state.reactTreeAttributedString.isContentEqual(
|
||||
reactTreeAttributedString) &&
|
||||
state.layoutManager == textLayoutManager_) {
|
||||
return;
|
||||
}
|
||||
|
||||
-4
@@ -32,10 +32,6 @@ class TextInputShadowNode final : public ConcreteViewShadowNode<
|
||||
public:
|
||||
using ConcreteViewShadowNode::ConcreteViewShadowNode;
|
||||
|
||||
TextInputShadowNode(
|
||||
const ShadowNode& sourceShadowNode,
|
||||
const ShadowNodeFragment& fragment);
|
||||
|
||||
static ShadowNodeTraits BaseTraits() {
|
||||
auto traits = ConcreteViewShadowNode::BaseTraits();
|
||||
traits.set(ShadowNodeTraits::Trait::LeafYogaNode);
|
||||
|
||||
-20
@@ -125,26 +125,6 @@ inline void fromRawValue(
|
||||
abort();
|
||||
}
|
||||
|
||||
inline void fromRawValue(
|
||||
const PropsParserContext& context,
|
||||
const RawValue& value,
|
||||
SubmitBehavior& result) {
|
||||
auto string = (std::string)value;
|
||||
if (string == "newline") {
|
||||
result = SubmitBehavior::Newline;
|
||||
return;
|
||||
}
|
||||
if (string == "submit") {
|
||||
result = SubmitBehavior::Submit;
|
||||
return;
|
||||
}
|
||||
if (string == "blurAndSubmit") {
|
||||
result = SubmitBehavior::BlurAndSubmit;
|
||||
return;
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
||||
inline void fromRawValue(
|
||||
const PropsParserContext& context,
|
||||
const RawValue& value,
|
||||
|
||||
+1
-20
@@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <react/renderer/components/textinput/basePrimitives.h>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
@@ -47,14 +48,6 @@ enum class ReturnKeyType {
|
||||
Continue,
|
||||
};
|
||||
|
||||
// iOS & Android.
|
||||
enum class SubmitBehavior {
|
||||
Default,
|
||||
Submit,
|
||||
BlurAndSubmit,
|
||||
Newline,
|
||||
};
|
||||
|
||||
// iOS-only
|
||||
enum class TextInputAccessoryVisibilityMode {
|
||||
Never,
|
||||
@@ -94,12 +87,6 @@ class Selection final {
|
||||
*/
|
||||
class TextInputTraits final {
|
||||
public:
|
||||
/*
|
||||
* iOS & Android
|
||||
* Default value: `false`.
|
||||
*/
|
||||
bool multiline{false};
|
||||
|
||||
/*
|
||||
* iOS & Android
|
||||
* Default value: `Sentences`.
|
||||
@@ -175,12 +162,6 @@ class TextInputTraits final {
|
||||
*/
|
||||
bool secureTextEntry{false};
|
||||
|
||||
/*
|
||||
* iOS & Android
|
||||
* Default value: `Default`.
|
||||
*/
|
||||
SubmitBehavior submitBehavior{SubmitBehavior::Default};
|
||||
|
||||
/*
|
||||
* iOS-only (implemented only on iOS for now)
|
||||
* Default value: `false`.
|
||||
|
||||
-12
@@ -21,12 +21,6 @@ static TextInputTraits convertRawProp(
|
||||
const TextInputTraits& defaultTraits) {
|
||||
auto traits = TextInputTraits{};
|
||||
|
||||
traits.multiline = convertRawProp(
|
||||
context,
|
||||
rawProps,
|
||||
"multiline",
|
||||
sourceTraits.multiline,
|
||||
defaultTraits.multiline);
|
||||
traits.autocapitalizationType = convertRawProp(
|
||||
context,
|
||||
rawProps,
|
||||
@@ -93,12 +87,6 @@ static TextInputTraits convertRawProp(
|
||||
"secureTextEntry",
|
||||
sourceTraits.secureTextEntry,
|
||||
defaultTraits.secureTextEntry);
|
||||
traits.submitBehavior = convertRawProp(
|
||||
context,
|
||||
rawProps,
|
||||
"submitBehavior",
|
||||
sourceTraits.submitBehavior,
|
||||
defaultTraits.submitBehavior);
|
||||
traits.clearTextOnFocus = convertRawProp(
|
||||
context,
|
||||
rawProps,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "EventBeat.h"
|
||||
|
||||
#include <react/debug/react_native_assert.h>
|
||||
#include <react/renderer/runtimescheduler/RuntimeScheduler.h>
|
||||
#include <utility>
|
||||
|
||||
@@ -18,6 +19,9 @@ EventBeat::EventBeat(
|
||||
: ownerBox_(std::move(ownerBox)), runtimeScheduler_(runtimeScheduler) {}
|
||||
|
||||
void EventBeat::request() const {
|
||||
react_native_assert(
|
||||
beatCallback_ &&
|
||||
"Unexpected state: EventBeat::setBeatCallback was not called before EventBeat::request.");
|
||||
isRequested_ = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,8 +104,6 @@ class EventEmitter {
|
||||
void dispatchUniqueEvent(std::string type, SharedEventPayload payload) const;
|
||||
|
||||
private:
|
||||
void toggleEventTargetOwnership_() const;
|
||||
|
||||
friend class UIManagerBinding;
|
||||
|
||||
mutable SharedEventTarget eventTarget_;
|
||||
|
||||
@@ -54,17 +54,18 @@ Scheduler::Scheduler(
|
||||
auto weakRuntimeScheduler =
|
||||
contextContainer_->find<std::weak_ptr<RuntimeScheduler>>(
|
||||
"RuntimeScheduler");
|
||||
auto runtimeScheduler = weakRuntimeScheduler.has_value()
|
||||
? weakRuntimeScheduler.value().lock()
|
||||
: nullptr;
|
||||
react_native_assert(
|
||||
weakRuntimeScheduler.has_value() &&
|
||||
"Unexpected state: RuntimeScheduler was not provided.");
|
||||
|
||||
if (runtimeScheduler && ReactNativeFeatureFlags::enableUIConsistency()) {
|
||||
auto runtimeScheduler = weakRuntimeScheduler.value().lock();
|
||||
|
||||
if (ReactNativeFeatureFlags::enableUIConsistency()) {
|
||||
runtimeScheduler->setShadowTreeRevisionConsistencyManager(
|
||||
uiManager->getShadowTreeRevisionConsistencyManager());
|
||||
}
|
||||
|
||||
if (runtimeScheduler &&
|
||||
ReactNativeFeatureFlags::enableReportEventPaintTime()) {
|
||||
if (ReactNativeFeatureFlags::enableReportEventPaintTime()) {
|
||||
runtimeScheduler->setEventTimingDelegate(eventPerformanceLogger_.get());
|
||||
}
|
||||
|
||||
|
||||
@@ -139,18 +139,13 @@ std::unique_ptr<JSRuntime> HermesInstance::createJSRuntime(
|
||||
gcConfig.withAllocInYoung(false).withRevertToYGAtTTI(true);
|
||||
}
|
||||
|
||||
int64_t vmExperimentFlags = reactNativeConfig
|
||||
? reactNativeConfig->getInt64("ios_hermes:vm_experiment_flags")
|
||||
: 0;
|
||||
|
||||
::hermes::vm::RuntimeConfig::Builder runtimeConfigBuilder =
|
||||
::hermes::vm::RuntimeConfig::Builder()
|
||||
.withGCConfig(gcConfig.build())
|
||||
.withEnableSampleProfiling(true)
|
||||
.withMicrotaskQueue(
|
||||
ReactNativeFeatureFlags::enableBridgelessArchitecture() &&
|
||||
!ReactNativeFeatureFlags::disableEventLoopOnBridgeless())
|
||||
.withVMExperimentFlags(vmExperimentFlags);
|
||||
!ReactNativeFeatureFlags::disableEventLoopOnBridgeless());
|
||||
|
||||
if (crashManager) {
|
||||
runtimeConfigBuilder.withCrashMgr(crashManager);
|
||||
|
||||
@@ -125,14 +125,6 @@ const definitions: FeatureFlagDefinitions = {
|
||||
purpose: 'release',
|
||||
},
|
||||
},
|
||||
enableCleanTextInputYogaNode: {
|
||||
defaultValue: false,
|
||||
metadata: {
|
||||
dateAdded: '2024-04-06',
|
||||
description: 'Clean yoga node when <TextInput /> does not change.',
|
||||
purpose: 'experimentation',
|
||||
},
|
||||
},
|
||||
enableCppPropsIteratorSetter: {
|
||||
defaultValue: false,
|
||||
metadata: {
|
||||
@@ -286,15 +278,6 @@ const definitions: FeatureFlagDefinitions = {
|
||||
purpose: 'experimentation',
|
||||
},
|
||||
},
|
||||
enableTextPreallocationOptimisation: {
|
||||
defaultValue: false,
|
||||
metadata: {
|
||||
dateAdded: '2024-09-12',
|
||||
description:
|
||||
'Text preallocation optimisation where unnecessary work is removed.',
|
||||
purpose: 'experimentation',
|
||||
},
|
||||
},
|
||||
enableUIConsistency: {
|
||||
defaultValue: false,
|
||||
metadata: {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<096ac17a630f7b29d3a029c704dbd8db>>
|
||||
* @generated SignedSource<<394b8d464269026a6bec25a488a3a35e>>
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
@@ -60,7 +60,6 @@ export type ReactNativeFeatureFlags = {
|
||||
enableAlignItemsBaselineOnFabricIOS: Getter<boolean>,
|
||||
enableAndroidLineHeightCentering: Getter<boolean>,
|
||||
enableBridgelessArchitecture: Getter<boolean>,
|
||||
enableCleanTextInputYogaNode: Getter<boolean>,
|
||||
enableCppPropsIteratorSetter: Getter<boolean>,
|
||||
enableDeletionOfUnmountedViews: Getter<boolean>,
|
||||
enableEagerRootViewAttachment: Getter<boolean>,
|
||||
@@ -79,7 +78,6 @@ export type ReactNativeFeatureFlags = {
|
||||
enablePropsUpdateReconciliationAndroid: Getter<boolean>,
|
||||
enableReportEventPaintTime: Getter<boolean>,
|
||||
enableSynchronousStateUpdates: Getter<boolean>,
|
||||
enableTextPreallocationOptimisation: Getter<boolean>,
|
||||
enableUIConsistency: Getter<boolean>,
|
||||
enableViewRecycling: Getter<boolean>,
|
||||
excludeYogaFromRawProps: Getter<boolean>,
|
||||
@@ -229,10 +227,6 @@ export const enableAndroidLineHeightCentering: Getter<boolean> = createNativeFla
|
||||
* Feature flag to enable the new bridgeless architecture. Note: Enabling this will force enable the following flags: `useTurboModules` & `enableFabricRenderer.
|
||||
*/
|
||||
export const enableBridgelessArchitecture: Getter<boolean> = createNativeFlagGetter('enableBridgelessArchitecture', false);
|
||||
/**
|
||||
* Clean yoga node when <TextInput /> does not change.
|
||||
*/
|
||||
export const enableCleanTextInputYogaNode: Getter<boolean> = createNativeFlagGetter('enableCleanTextInputYogaNode', false);
|
||||
/**
|
||||
* Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).
|
||||
*/
|
||||
@@ -305,10 +299,6 @@ export const enableReportEventPaintTime: Getter<boolean> = createNativeFlagGette
|
||||
* Dispatches state updates synchronously in Fabric (e.g.: updates the scroll position in the shadow tree synchronously from the main thread).
|
||||
*/
|
||||
export const enableSynchronousStateUpdates: Getter<boolean> = createNativeFlagGetter('enableSynchronousStateUpdates', false);
|
||||
/**
|
||||
* Text preallocation optimisation where unnecessary work is removed.
|
||||
*/
|
||||
export const enableTextPreallocationOptimisation: Getter<boolean> = createNativeFlagGetter('enableTextPreallocationOptimisation', false);
|
||||
/**
|
||||
* Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).
|
||||
*/
|
||||
|
||||
+1
-3
@@ -4,7 +4,7 @@
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @generated SignedSource<<ecde28c685e74022e2dcee6dcec41d0b>>
|
||||
* @generated SignedSource<<af633e24069a9e044194e0efbfeabbe4>>
|
||||
* @flow strict
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,6 @@ export interface Spec extends TurboModule {
|
||||
+enableAlignItemsBaselineOnFabricIOS?: () => boolean;
|
||||
+enableAndroidLineHeightCentering?: () => boolean;
|
||||
+enableBridgelessArchitecture?: () => boolean;
|
||||
+enableCleanTextInputYogaNode?: () => boolean;
|
||||
+enableCppPropsIteratorSetter?: () => boolean;
|
||||
+enableDeletionOfUnmountedViews?: () => boolean;
|
||||
+enableEagerRootViewAttachment?: () => boolean;
|
||||
@@ -52,7 +51,6 @@ export interface Spec extends TurboModule {
|
||||
+enablePropsUpdateReconciliationAndroid?: () => boolean;
|
||||
+enableReportEventPaintTime?: () => boolean;
|
||||
+enableSynchronousStateUpdates?: () => boolean;
|
||||
+enableTextPreallocationOptimisation?: () => boolean;
|
||||
+enableUIConsistency?: () => boolean;
|
||||
+enableViewRecycling?: () => boolean;
|
||||
+excludeYogaFromRawProps?: () => boolean;
|
||||
|
||||
Reference in New Issue
Block a user