Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove deprecated react legacy components from config #2554

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 1 addition & 30 deletions docs/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,10 @@ multiple `Podfile` files in your project.

Array of strings that will be passed to the `npx react-native run-ios` command when running in watch mode.

#### project.ios.unstable_reactLegacyComponentNames

> [!CAUTION]
> Deprecated in React Native 0.74, where this behavior is detected automatically and this config does nothing. You can safely remove it from your project.

Please note that this is part of the **Unstable Fabric Interop Layer**, and might be subject to breaking change in the future,
hence the `unstable_` prefix.

An array with a list of Legacy Component Name that you want to be registered with the Fabric Interop Layer.
This will allow you to use libraries that haven't been migrated yet on the New Architecture.

The list should contain the name of the components, as they're registered in the ViewManagers (i.e. just `"Button"`).

Since React Native 0.74, this property is ignored as the Interop Layer is **Automatic**, you don't need to register the Legacy Components anymore and they will be discovered automatically.

#### project.ios.automaticPodsInstallation

A boolean value to determine if you want to automatically install CocoaPods when running `run-ios` or `build-ios` command when:

- they are not yet installed
- a new dependency visible for autolinking is installed
- a version of existing native dependency has changed
Expand Down Expand Up @@ -147,21 +133,6 @@ See [`dependency.platforms.android.configuration`](dependencies.md#platformsandr

Array of strings that will be passed to the `npx react-native run-android` command when running in watch mode.

#### project.android.unstable_reactLegacyComponentNames

> [!CAUTION]
> Deprecated in React Native 0.74, where this behavior is detected automatically and this config does nothing. You can safely remove it from your project.

Please note that this is part of the **Unstable Fabric Interop Layer**, and might be subject to breaking change in the future,
hence the `unstable_` prefix.

An array with a list of Legacy Component Name that you want to be registered with the Fabric Interop Layer.
This will allow you to use libraries that haven't been migrated yet on the New Architecture.

The list should contain the name of the components, as they're registered in the ViewManagers (i.e. just `"Button"`).

Since React Native 0.74, this property is ignored as the Interop Layer is **Automatic**, you don't need to register the Legacy Components anymore and they will be discovered automatically.

### project.android.assets

Array of folder paths that will be passed to the `npx react-native link-assets` command to specify the assets to be linked to Android project.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Object {
"mainActivity": ".MainActivity",
"packageName": "com.some.example",
"sourceDir": "/flat/android",
"unstable_reactLegacyComponentNames": undefined,
"watchModeCommandParams": undefined,
}
`;
Expand All @@ -23,7 +22,6 @@ Object {
"mainActivity": ".MainActivity",
"packageName": "com.some.example",
"sourceDir": "/multiple/android",
"unstable_reactLegacyComponentNames": undefined,
"watchModeCommandParams": undefined,
}
`;
Expand All @@ -37,7 +35,6 @@ Object {
"mainActivity": ".MainActivity",
"packageName": "com.some.example",
"sourceDir": "/nested/android",
"unstable_reactLegacyComponentNames": undefined,
"watchModeCommandParams": undefined,
}
`;
11 changes: 1 addition & 10 deletions packages/cli-config-android/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
import {findLibraryName} from './findLibraryName';
import {findComponentDescriptors} from './findComponentDescriptors';
import {findBuildGradle} from './findBuildGradle';
import {CLIError, logger} from '@react-native-community/cli-tools';
import {CLIError} from '@react-native-community/cli-tools';
import getMainActivity from './getMainActivity';

/**
Expand Down Expand Up @@ -68,13 +68,6 @@ export function projectConfig(
: packageName;
const mainActivity = getMainActivity(manifestPath || '') ?? '';

// @todo remove for RN 0.75
if (userConfig.unstable_reactLegacyComponentNames) {
logger.warn(
'The "project.android.unstable_reactLegacyComponentNames" config option is not necessary anymore for React Native 0.74 and does nothing. Please remove it from the "react-native.config.js" file.',
);
}

return {
sourceDir,
appName,
Expand All @@ -83,8 +76,6 @@ export function projectConfig(
mainActivity,
dependencyConfiguration: userConfig.dependencyConfiguration,
watchModeCommandParams: userConfig.watchModeCommandParams,
// @todo remove for RN 0.75
unstable_reactLegacyComponentNames: undefined,
assets: userConfig.assets ?? [],
};
}
Expand Down
9 changes: 1 addition & 8 deletions packages/cli-config-apple/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
IOSProjectConfig,
IOSDependencyConfig,
} from '@react-native-community/cli-types';
import {CLIError, logger} from '@react-native-community/cli-tools';
import {CLIError} from '@react-native-community/cli-tools';
import {BuilderCommand} from '../types';

/**
Expand Down Expand Up @@ -47,13 +47,6 @@ export const getProjectConfig =

const xcodeProject = findXcodeProject(fs.readdirSync(sourceDir));

// @ts-ignore @todo remove for RN 0.75
if (userConfig.unstable_reactLegacyComponentNames) {
logger.warn(
'The "project.ios.unstable_reactLegacyComponentNames" config option is not necessary anymore for React Native 0.74 and does nothing. Please remove it from the "react-native.config.js" file.',
);
}

return {
sourceDir,
watchModeCommandParams: userConfig.watchModeCommandParams,
Expand Down
10 changes: 0 additions & 10 deletions packages/cli-config/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,6 @@ export const projectConfig = t
.object({
sourceDir: t.string(),
watchModeCommandParams: t.array().items(t.string()),
// @todo remove for RN 0.75
unstable_reactLegacyComponentNames: t
.array()
.items(t.string())
.optional(),
automaticPodsInstallation: t.bool().default(false),
assets: t.array().items(t.string()).default([]),
})
Expand All @@ -173,11 +168,6 @@ export const projectConfig = t
packageName: t.string(),
dependencyConfiguration: t.string(),
watchModeCommandParams: t.array().items(t.string()),
// @todo remove for RN 0.75
unstable_reactLegacyComponentNames: t
.array()
.items(t.string())
.optional(),
assets: t.array().items(t.string()).default([]),
})
.default({}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ let androidProject: AndroidProjectConfig = {
mainActivity: '.MainActivity',
dependencyConfiguration: undefined,
watchModeCommandParams: undefined,
unstable_reactLegacyComponentNames: undefined,
};

const shellStartCommand = ['shell', 'am', 'start'];
Expand Down
4 changes: 0 additions & 4 deletions packages/cli-types/src/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ export interface AndroidProjectConfig {
mainActivity: string;
dependencyConfiguration?: string;
watchModeCommandParams?: string[];
// @todo remove for RN 0.75
unstable_reactLegacyComponentNames?: string[] | null;
assets: string[];
}

Expand All @@ -18,8 +16,6 @@ export type AndroidProjectParams = {
packageName?: string;
dependencyConfiguration?: string;
watchModeCommandParams?: string[];
// @todo remove for RN 0.75
unstable_reactLegacyComponentNames?: string[] | null;
assets?: string[];
};

Expand Down
Loading