[rn] enabled disableLegacyMode everywhere (#34947)

Stacked on https://github.com/facebook/react/pull/34946

This should be a noop, now that the legacy renderers are not being
sync'd.
This commit is contained in:
Ricky 2025-10-27 17:48:33 -04:00 committed by GitHub
parent 90817f8810
commit dd53a946ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 4 deletions

View File

@ -164,10 +164,10 @@ jobs:
# Delete the OSS renderers, these are sync'd to RN separately. # Delete the OSS renderers, these are sync'd to RN separately.
RENDERER_FOLDER=$BASE_FOLDER/react-native-github/Libraries/Renderer/implementations/ RENDERER_FOLDER=$BASE_FOLDER/react-native-github/Libraries/Renderer/implementations/
SHIM_FOLDER=$BASE_FOLDER/react-native-github/Libraries/Renderer/shims/
rm $RENDERER_FOLDER/ReactFabric-{dev,prod,profiling}.js rm $RENDERER_FOLDER/ReactFabric-{dev,prod,profiling}.js
# Delete the legacy renderer shim, this is not sync'd and will get deleted in the future. # Delete the legacy renderer shim, this is not sync'd and will get deleted in the future.
SHIM_FOLDER=$BASE_FOLDER/react-native-github/Libraries/Renderer/shims/
rm $SHIM_FOLDER/ReactNative.js rm $SHIM_FOLDER/ReactNative.js
# Copy eslint-plugin-react-hooks # Copy eslint-plugin-react-hooks

View File

@ -40,6 +40,7 @@ describe('created with ReactFabric called with ReactNative', () => {
require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface').getNativeTagFromPublicInstance; require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface').getNativeTagFromPublicInstance;
}); });
// @gate !disableLegacyMode
it('find Fabric instances with the RN renderer', () => { it('find Fabric instances with the RN renderer', () => {
const View = createReactNativeComponentClass('RCTView', () => ({ const View = createReactNativeComponentClass('RCTView', () => ({
validAttributes: {title: true}, validAttributes: {title: true},
@ -60,6 +61,7 @@ describe('created with ReactFabric called with ReactNative', () => {
expect(getNativeTagFromPublicInstance(instance)).toBe(2); expect(getNativeTagFromPublicInstance(instance)).toBe(2);
}); });
// @gate !disableLegacyMode
it('find Fabric nodes with the RN renderer', () => { it('find Fabric nodes with the RN renderer', () => {
const View = createReactNativeComponentClass('RCTView', () => ({ const View = createReactNativeComponentClass('RCTView', () => ({
validAttributes: {title: true}, validAttributes: {title: true},
@ -80,6 +82,7 @@ describe('created with ReactFabric called with ReactNative', () => {
expect(handle).toBe(2); expect(handle).toBe(2);
}); });
// @gate !disableLegacyMode
it('dispatches commands on Fabric nodes with the RN renderer', () => { it('dispatches commands on Fabric nodes with the RN renderer', () => {
nativeFabricUIManager.dispatchCommand.mockClear(); nativeFabricUIManager.dispatchCommand.mockClear();
const View = createReactNativeComponentClass('RCTView', () => ({ const View = createReactNativeComponentClass('RCTView', () => ({
@ -101,6 +104,7 @@ describe('created with ReactFabric called with ReactNative', () => {
expect(UIManager.dispatchViewManagerCommand).not.toBeCalled(); expect(UIManager.dispatchViewManagerCommand).not.toBeCalled();
}); });
// @gate !disableLegacyMode
it('dispatches sendAccessibilityEvent on Fabric nodes with the RN renderer', () => { it('dispatches sendAccessibilityEvent on Fabric nodes with the RN renderer', () => {
nativeFabricUIManager.sendAccessibilityEvent.mockClear(); nativeFabricUIManager.sendAccessibilityEvent.mockClear();
const View = createReactNativeComponentClass('RCTView', () => ({ const View = createReactNativeComponentClass('RCTView', () => ({
@ -143,6 +147,7 @@ describe('created with ReactNative called with ReactFabric', () => {
.ReactNativeViewConfigRegistry.register; .ReactNativeViewConfigRegistry.register;
}); });
// @gate !disableLegacyMode
it('find Paper instances with the Fabric renderer', () => { it('find Paper instances with the Fabric renderer', () => {
const View = createReactNativeComponentClass('RCTView', () => ({ const View = createReactNativeComponentClass('RCTView', () => ({
validAttributes: {title: true}, validAttributes: {title: true},
@ -163,6 +168,7 @@ describe('created with ReactNative called with ReactFabric', () => {
expect(instance._nativeTag).toBe(3); expect(instance._nativeTag).toBe(3);
}); });
// @gate !disableLegacyMode
it('find Paper nodes with the Fabric renderer', () => { it('find Paper nodes with the Fabric renderer', () => {
const View = createReactNativeComponentClass('RCTView', () => ({ const View = createReactNativeComponentClass('RCTView', () => ({
validAttributes: {title: true}, validAttributes: {title: true},
@ -183,6 +189,7 @@ describe('created with ReactNative called with ReactFabric', () => {
expect(handle).toBe(3); expect(handle).toBe(3);
}); });
// @gate !disableLegacyMode
it('dispatches commands on Paper nodes with the Fabric renderer', () => { it('dispatches commands on Paper nodes with the Fabric renderer', () => {
UIManager.dispatchViewManagerCommand.mockReset(); UIManager.dispatchViewManagerCommand.mockReset();
const View = createReactNativeComponentClass('RCTView', () => ({ const View = createReactNativeComponentClass('RCTView', () => ({
@ -205,6 +212,7 @@ describe('created with ReactNative called with ReactFabric', () => {
expect(nativeFabricUIManager.dispatchCommand).not.toBeCalled(); expect(nativeFabricUIManager.dispatchCommand).not.toBeCalled();
}); });
// @gate !disableLegacyMode
it('dispatches sendAccessibilityEvent on Paper nodes with the Fabric renderer', () => { it('dispatches sendAccessibilityEvent on Paper nodes with the Fabric renderer', () => {
ReactNativePrivateInterface.legacySendAccessibilityEvent.mockReset(); ReactNativePrivateInterface.legacySendAccessibilityEvent.mockReset();
const View = createReactNativeComponentClass('RCTView', () => ({ const View = createReactNativeComponentClass('RCTView', () => ({

View File

@ -35,7 +35,7 @@ export const disableCommentsAsDOMContainers: boolean = true;
export const disableInputAttributeSyncing: boolean = false; export const disableInputAttributeSyncing: boolean = false;
export const disableLegacyContext: boolean = false; export const disableLegacyContext: boolean = false;
export const disableLegacyContextForFunctionComponents: boolean = false; export const disableLegacyContextForFunctionComponents: boolean = false;
export const disableLegacyMode: boolean = false; export const disableLegacyMode: boolean = true;
export const disableSchedulerTimeoutInWorkLoop: boolean = false; export const disableSchedulerTimeoutInWorkLoop: boolean = false;
export const disableTextareaChildren: boolean = false; export const disableTextareaChildren: boolean = false;
export const enableAsyncDebugInfo: boolean = false; export const enableAsyncDebugInfo: boolean = false;

View File

@ -21,7 +21,7 @@ export const disableCommentsAsDOMContainers: boolean = true;
export const disableInputAttributeSyncing: boolean = false; export const disableInputAttributeSyncing: boolean = false;
export const disableLegacyContext: boolean = true; export const disableLegacyContext: boolean = true;
export const disableLegacyContextForFunctionComponents: boolean = true; export const disableLegacyContextForFunctionComponents: boolean = true;
export const disableLegacyMode: boolean = false; export const disableLegacyMode: boolean = true;
export const disableSchedulerTimeoutInWorkLoop: boolean = false; export const disableSchedulerTimeoutInWorkLoop: boolean = false;
export const disableTextareaChildren: boolean = false; export const disableTextareaChildren: boolean = false;
export const enableAsyncDebugInfo: boolean = false; export const enableAsyncDebugInfo: boolean = false;

View File

@ -16,7 +16,7 @@ export const disableCommentsAsDOMContainers = true;
export const disableInputAttributeSyncing = false; export const disableInputAttributeSyncing = false;
export const disableLegacyContext = false; export const disableLegacyContext = false;
export const disableLegacyContextForFunctionComponents = false; export const disableLegacyContextForFunctionComponents = false;
export const disableLegacyMode = false; export const disableLegacyMode = true;
export const disableSchedulerTimeoutInWorkLoop = false; export const disableSchedulerTimeoutInWorkLoop = false;
export const disableTextareaChildren = false; export const disableTextareaChildren = false;
export const enableAsyncDebugInfo = false; export const enableAsyncDebugInfo = false;