Skip to content

Commit cf94430

Browse files
rubennortemeta-codesync[bot]
authored andcommitted
Make fabric parameter always true in renderApplication (facebook#56517)
Summary: Pull Request resolved: facebook#56517 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. Reviewed By: javache, huntie Differential Revision: D101353116 fbshipit-source-id: 6b8a24ea09c7a44840396ed6f97b2c1dd8c32725
1 parent ea38382 commit cf94430

7 files changed

Lines changed: 16 additions & 35 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
}

packages/react-native/ReactNativeApi.d.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<c018df63c1391fd6906f66f9bb80bb27>>
7+
* @generated SignedSource<<ad3edd7df03c5d97bc1bbfc138e3b283>>
88
*
99
* This file was generated by scripts/js-api/build-types/index.js.
1010
*/
@@ -1638,7 +1638,6 @@ declare type AppearancePreferences = {
16381638
colorScheme?: ColorSchemeName
16391639
}
16401640
declare type AppParameters = {
1641-
fabric?: boolean
16421641
initialProps: {
16431642
readonly [$$Key$$: string]: unknown
16441643
}
@@ -6013,8 +6012,8 @@ export {
60136012
AlertType, // 5ab91217
60146013
AndroidKeyboardEvent, // e03becc8
60156014
Animated, // a77a3944
6016-
AppConfig, // ebddad4b
6017-
AppRegistry, // f7a253e4
6015+
AppConfig, // ce4209a7
6016+
AppRegistry, // 5edf0524
60186017
AppState, // 12012be5
60196018
AppStateEvent, // 80f034c3
60206019
AppStateStatus, // 447e5ef2
@@ -6183,15 +6182,15 @@ export {
61836182
RefreshControlProps, // e747ed5d
61846183
RefreshControlPropsAndroid, // 99f64c97
61856184
RefreshControlPropsIOS, // 72a36381
6186-
Registry, // e1ed403e
6185+
Registry, // 6c39216d
61876186
ResponderSyntheticEvent, // fb10247c
61886187
ReturnKeyTypeOptions, // afd47ba3
61896188
Role, // af7b889d
61906189
RootTag, // 3cd10504
61916190
RootTagContext, // 38bfc8f6
61926191
RootViewStyleProvider, // d4818465
6193-
Runnable, // 2cb32c54
6194-
Runnables, // d3749ae1
6192+
Runnable, // 594dd93a
6193+
Runnables, // 4367c557
61956194
SafeAreaView, // 9589fa67
61966195
ScaledSize, // 07e417c7
61976196
ScrollEvent, // 5d529218

0 commit comments

Comments
 (0)