Skip to content

Commit 4ea393f

Browse files
rubennortefacebook-github-bot
authored andcommitted
Make fabric parameter always true in renderApplication
Summary: Changelog: [Internal] Remove the fabric parameter from renderApplication and AppContainer. The parameter is kept in renderApplication for backwards compatibility but is always treated as true internally. The legacy Paper renderer path is no longer used. Differential Revision: D101353116
1 parent 65c561e commit 4ea393f

6 files changed

Lines changed: 10 additions & 28 deletions

File tree

packages/react-native/Libraries/ReactNative/AppContainer-dev.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ const ReactDevToolsOverlayDeferred = ({
100100

101101
const AppContainer = ({
102102
children,
103-
fabric,
104103
initialProps,
105104
internal_excludeInspector = false,
106105
internal_excludeLogBox = false,
@@ -165,7 +164,7 @@ const AppContainer = ({
165164

166165
if (WrapperComponent != null) {
167166
innerView = (
168-
<WrapperComponent initialProps={initialProps} fabric={fabric === true}>
167+
<WrapperComponent initialProps={initialProps}>
169168
{innerView}
170169
</WrapperComponent>
171170
);

packages/react-native/Libraries/ReactNative/AppContainer-prod.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import * as React from 'react';
1717

1818
const AppContainer = ({
1919
children,
20-
fabric,
2120
initialProps,
2221
rootTag,
2322
WrapperComponent,
@@ -27,7 +26,7 @@ const AppContainer = ({
2726

2827
if (WrapperComponent != null) {
2928
innerView = (
30-
<WrapperComponent initialProps={initialProps} fabric={fabric === true}>
29+
<WrapperComponent initialProps={initialProps}>
3130
{innerView}
3231
</WrapperComponent>
3332
);

packages/react-native/Libraries/ReactNative/AppContainer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import * as React from 'react';
1515

1616
export type Props = Readonly<{
1717
children?: React.Node,
18-
fabric?: boolean,
1918
rootTag: number | RootTag,
2019
initialProps?: {...},
2120
WrapperComponent?: ?React.ComponentType<any>,

packages/react-native/Libraries/ReactNative/AppRegistry.flow.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export type AppConfig = {
3131
export type AppParameters = {
3232
initialProps: Readonly<{[string]: unknown, ...}>,
3333
rootTag: RootTag,
34-
fabric?: boolean,
3534
};
3635
export type Runnable = (
3736
appParameters: AppParameters,

packages/react-native/Libraries/ReactNative/AppRegistryImpl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function registerComponent(
9494
appParameters.rootTag,
9595
wrapperComponentProvider && wrapperComponentProvider(appParameters),
9696
rootViewStyleProvider && rootViewStyleProvider(appParameters),
97-
appParameters.fabric,
97+
true, // fabric - deprecated, always true
9898
scopedPerformanceLogger,
9999
appKey === 'LogBox', // is logbox
100100
appKey,

packages/react-native/Libraries/ReactNative/renderApplication.js

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import type {IPerformanceLogger} from '../Utilities/createPerformanceLogger';
1313

1414
import GlobalPerformanceLogger from '../Utilities/GlobalPerformanceLogger';
1515
import PerformanceLoggerContext from '../Utilities/PerformanceLoggerContext';
16-
import warnOnce from '../Utilities/warnOnce';
1716
import AppContainer from './AppContainer';
1817
import DisplayMode, {type DisplayModeType} from './DisplayMode';
1918
import getCachedComponentWithDebugName from './getCachedComponentWithDebugName';
@@ -37,7 +36,9 @@ export default function renderApplication<Props extends Object>(
3736
rootTag: any,
3837
WrapperComponent?: ?React.ComponentType<any>,
3938
rootViewStyle?: ?ViewStyleProp,
40-
fabric?: boolean,
39+
// Keep this parameter for backwards compatibility only. It is always treated as
40+
// true internally.
41+
fabric?: true | void,
4142
scopedPerformanceLogger?: IPerformanceLogger,
4243
isLogBox?: boolean,
4344
debugName?: string,
@@ -52,7 +53,6 @@ export default function renderApplication<Props extends Object>(
5253
<PerformanceLoggerContext.Provider value={performanceLogger}>
5354
<AppContainer
5455
rootTag={rootTag}
55-
fabric={fabric}
5656
WrapperComponent={WrapperComponent}
5757
rootViewStyle={rootViewStyle}
5858
initialProps={initialProps ?? Object.freeze({})}
@@ -87,32 +87,18 @@ export default function renderApplication<Props extends Object>(
8787
);
8888
}
8989

90-
// We want to have concurrentRoot always enabled when you're on Fabric.
91-
const useConcurrentRoot = Boolean(fabric);
92-
9390
performanceLogger.startTimespan('renderApplication_React_render');
94-
performanceLogger.setExtra(
95-
'usedReactConcurrentRoot',
96-
useConcurrentRoot ? '1' : '0',
97-
);
98-
performanceLogger.setExtra('usedReactFabric', fabric ? '1' : '0');
91+
performanceLogger.setExtra('usedReactConcurrentRoot', '1');
92+
performanceLogger.setExtra('usedReactFabric', '1');
9993
performanceLogger.setExtra(
10094
'usedReactProfiler',
10195
Renderer.isProfilingRenderer(),
10296
);
10397
Renderer.renderElement({
10498
element: renderable,
10599
rootTag,
106-
useFabric: Boolean(fabric),
107-
useConcurrentRoot,
100+
useFabric: true,
101+
useConcurrentRoot: true,
108102
});
109-
110-
const newArchitecture = !!fabric;
111-
if (!newArchitecture) {
112-
warnOnce(
113-
'[OSS][OldArchDeprecatedWarning]',
114-
'The app is running using the Legacy Architecture. The Legacy Architecture is deprecated and will be removed in a future version of React Native. Please consider migrating to the New Architecture. For more information, please see https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-here',
115-
);
116-
}
117103
performanceLogger.stopTimespan('renderApplication_React_render');
118104
}

0 commit comments

Comments
 (0)