Skip to content

Commit

Permalink
feat: add the 'unstable_reactLegacyComponentNames' field to iOS proje…
Browse files Browse the repository at this point in the history
…ct config
  • Loading branch information
Riccardo Cipolleschi committed Mar 7, 2023
1 parent 90edee9 commit cba2bad
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
15 changes: 14 additions & 1 deletion docs/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ The following settings are available on iOS and Android:
```ts
type IOSProjectParams = {
sourceDir?: string;
unstable_reactLegacyComponentNames?: string[] | null;
};

type AndroidProjectParams = {
Expand All @@ -81,6 +82,18 @@ type AndroidProjectParams = {
A path to a directory where iOS source files are located. In most cases, you shouldn't need to set it, unless you have
multiple `Podfile` files in your project.

#### project.ios.unstable_reactLegacyComponentNames

> Note: Only applicable when new architecture is turned on.
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"`).

#### project.android.appName

A name of the app in the Android `sourceDir`, equivalent to Gradle project name. By default it's `app`.
Expand Down Expand Up @@ -109,7 +122,7 @@ Please note that this is part of the **Unstable Fabric Interop Layer**, and migh
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 on the New Architecture, libreries that are legacy and haven't been migrated yet.
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"`).

Expand Down
4 changes: 4 additions & 0 deletions packages/cli-config/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ export const projectConfig = t
// IOSProjectParams
.object({
sourceDir: t.string(),
unstable_reactLegacyComponentNames: t
.array()
.items(t.string())
.default([]),
})
.default({}),
android: t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('ios::getProjectConfig', () => {
Object {
"sourceDir": "/ios",
"xcodeProject": null,
}
"unstable_reactLegacyComponentNames": undefined,
`);
});
it('returns correct configuration when multiple Podfile are present', () => {
Expand All @@ -46,6 +46,7 @@ describe('ios::getProjectConfig', () => {
Object {
"sourceDir": "/ios",
"xcodeProject": null,
"unstable_reactLegacyComponentNames": undefined,
}
`);
});
Expand Down

0 comments on commit cba2bad

Please sign in to comment.