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 (#1859)

Co-authored-by: Riccardo Cipolleschi <cipolleschi@fb.com>
  • Loading branch information
cipolleschi and Riccardo Cipolleschi authored Mar 7, 2023
1 parent 90edee9 commit 8e8f51a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
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

0 comments on commit 8e8f51a

Please sign in to comment.