Skip to content

RFC0894: Removing deep imports from react-native #894

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

Merged

Conversation

huntie
Copy link
Collaborator

@huntie huntie commented Apr 4, 2025

Proposes deprecating and removing subpath imports (or "deep imports") from the react-native npm package to simplify the API, reduce its surface area, and enhance maintainability.

By defining a clear, root-level JavaScript API contract, we aim to minimise future React Native breaking changes and improve long-term predictability for the ecosystem.

View the rendered RFC

@huntie huntie requested review from rubennorte and cortinico April 4, 2025 15:53
@huntie huntie changed the title RFC0893: Removing deep imports from react-native RFC0894: Removing deep imports from react-native Apr 4, 2025
@huntie huntie force-pushed the proposal-deprecate-subpath-imports branch from dc1ae5f to 49ce56d Compare April 4, 2025 16:06
@huntie huntie force-pushed the proposal-deprecate-subpath-imports branch from a6ba7a8 to eb368f9 Compare April 6, 2025 17:02
@shirakaba
Copy link

shirakaba commented Apr 9, 2025

Please expose parseErrorStack, as there's really no alternative to it:

import parseErrorStack from "react-native/Libraries/Core/Devtools/parseErrorStack";

It's necessary for doing things like printing out error.cause the same way Node.js does.

I notice it's not currently in the provisional public API.


- **Deprecate in 0.80**, with an API consultation period of at least two major releases.
- **Offer tools**: Provide migration aids, including dev-mode warnings, an ESLint rule, and via related TypeScript changes.
- **Fully remove when confident**.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this 0.82 right?

Copy link
Collaborator Author

@huntie huntie Apr 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, 0.82 or later.

coado added a commit to coado/react-native that referenced this pull request Apr 14, 2025
)

Summary:

After TS types generation is completed, react native deep imports will be deprecated. This rule produces warnings to let users know to use root imports instead. For more information about why this rule was added, please check [RFC](react-native-community/discussions-and-proposals#894).


Changelog:
[General][Added] - Added no-deep-imports rule to eslint-plugin-react-native.

Reviewed By: robhogan

Differential Revision: D71398004
coado added a commit to coado/react-native that referenced this pull request Apr 14, 2025
)

Summary:

After TS types generation is completed, react native deep imports will be deprecated. This rule produces warnings to let users know to use root imports instead. For more information about why this rule was added, please check [RFC](react-native-community/discussions-and-proposals#894).


Changelog:
[General][Added] - Added no-deep-imports rule to eslint-plugin-react-native.

Reviewed By: robhogan

Differential Revision: D71398004
coado added a commit to coado/react-native that referenced this pull request Apr 14, 2025
)

Summary:
Pull Request resolved: facebook#50542

After TS types generation is completed, react native deep imports will be deprecated. This rule produces warnings to let users know to use root imports instead. For more information about why this rule was added, please check [RFC](react-native-community/discussions-and-proposals#894).

Changelog:
[General][Added] - Added no-deep-imports rule to eslint-plugin-react-native.

Reviewed By: robhogan

Differential Revision: D71398004
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Apr 14, 2025
Summary:
Pull Request resolved: #50542

After TS types generation is completed, react native deep imports will be deprecated. This rule produces warnings to let users know to use root imports instead. For more information about why this rule was added, please check [RFC](react-native-community/discussions-and-proposals#894).

Changelog:
[General][Added] - Added no-deep-imports rule to eslint-plugin-react-native.

Reviewed By: robhogan

Differential Revision: D71398004

fbshipit-source-id: 69104f69b1b1c59b5b0f115dcdd708a46d8d614d
coado added a commit to coado/react-native that referenced this pull request Apr 18, 2025
…ve imports

Summary:
The plugin analyses the source of all `import`, `require`, and `export` statements and injects the `console.warn` statement for each path targeting deep react-native source code. It runs only on a dev mode so there is no need to keep that in the `if (__DEV__) ` block. It is possible to disable this plugin by setting `disableDeepImportWarnings: true` and **resetting** the Metro cache:

```js
module.exports = {
  presets: [['module:react-native/babel-preset', {
    "disableDeepImportWarnings": true
  }]],
};
```

Changelog:
[General][Internal] - Added plugin to react-native/babel-preset injecting `console.warn` for each react native deep import in dev mode.

For a given code:
```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
``` 

The transformed output should look like:

```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Components/View/View').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Text/Text').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Pressability/PressabilityDebug').");
```

For more information about why this plugin was needed, please check [RFC](react-native-community/discussions-and-proposals#894).

Reviewed By: huntie

Differential Revision: D70783145
uffoltzl pushed a commit to uffoltzl/react-native that referenced this pull request Apr 18, 2025
)

Summary:
Pull Request resolved: facebook#50542

After TS types generation is completed, react native deep imports will be deprecated. This rule produces warnings to let users know to use root imports instead. For more information about why this rule was added, please check [RFC](react-native-community/discussions-and-proposals#894).

Changelog:
[General][Added] - Added no-deep-imports rule to eslint-plugin-react-native.

Reviewed By: robhogan

Differential Revision: D71398004

fbshipit-source-id: 69104f69b1b1c59b5b0f115dcdd708a46d8d614d
coado added a commit to coado/react-native that referenced this pull request Apr 24, 2025
…njection under deep react native imports (facebook#50802)

Summary:

The plugin analyses the source of all `import`, `require`, and `export` statements and injects the `console.warn` statement for each path targeting deep react-native source code. It runs only on a dev mode so there is no need to keep that in the `if (__DEV__) ` block. It is possible to disable this plugin by setting `disableDeepImportWarnings: true` and **resetting** the Metro cache:

```js
module.exports = {
  presets: [['module:react-native/babel-preset', {
    "disableDeepImportWarnings": true
  }]],
};
```

Changelog:
[General][Internal] - Added plugin to react-native/babel-preset injecting `console.warn` for each react native deep import in dev mode.

For a given code:
```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
``` 

The transformed output should look like:

```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Components/View/View').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Text/Text').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Pressability/PressabilityDebug').");
```

For more information about why this plugin was needed, please check [RFC](react-native-community/discussions-and-proposals#894).

Reviewed By: huntie

Differential Revision: D70783145
coado added a commit to coado/react-native that referenced this pull request Apr 24, 2025
…njection under deep react native imports (facebook#50802)

Summary:
Pull Request resolved: facebook#50802

The plugin analyses the source of all `import`, `require`, and `export` statements and injects the `console.warn` statement for each path targeting deep react-native source code. It runs only on a dev mode so there is no need to keep that in the `if (__DEV__) ` block. It is possible to disable this plugin by setting `disableDeepImportWarnings: true` and **resetting** the Metro cache:

```js
module.exports = {
  presets: [['module:react-native/babel-preset', {
    "disableDeepImportWarnings": true
  }]],
};
```

Changelog:
[General][Internal] - Added plugin to react-native/babel-preset injecting `console.warn` for each react native deep import in dev mode.

For a given code:
```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
```

The transformed output should look like:

```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Components/View/View').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Text/Text').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Pressability/PressabilityDebug').");
```

For more information about why this plugin was needed, please check [RFC](react-native-community/discussions-and-proposals#894).

Reviewed By: huntie

Differential Revision: D70783145
coado added a commit to coado/react-native that referenced this pull request Apr 24, 2025
…njection under deep react native imports (facebook#50802)

Summary:

The plugin analyses the source of all `import`, `require`, and `export` statements and injects the `console.warn` statement for each path targeting deep react-native source code. It runs only on a dev mode so there is no need to keep that in the `if (__DEV__) ` block. It is possible to disable this plugin by setting `disableDeepImportWarnings: true` and **resetting** the Metro cache:

```js
module.exports = {
  presets: [['module:react-native/babel-preset', {
    "disableDeepImportWarnings": true
  }]],
};
```

Changelog:
[General][Internal] - Added plugin to react-native/babel-preset injecting `console.warn` for each react native deep import in dev mode.

For a given code:
```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
``` 

The transformed output should look like:

```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Components/View/View').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Text/Text').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Pressability/PressabilityDebug').");
```

For more information about why this plugin was needed, please check [RFC](react-native-community/discussions-and-proposals#894).

Reviewed By: huntie

Differential Revision: D70783145
coado added a commit to coado/react-native that referenced this pull request Apr 24, 2025
…njection under deep react native imports (facebook#50802)

Summary:
Pull Request resolved: facebook#50802

The plugin analyses the source of all `import`, `require`, and `export` statements and injects the `console.warn` statement for each path targeting deep react-native source code. It runs only on a dev mode so there is no need to keep that in the `if (__DEV__) ` block. It is possible to disable this plugin by setting `disableDeepImportWarnings: true` and **resetting** the Metro cache:

```js
module.exports = {
  presets: [['module:react-native/babel-preset', {
    "disableDeepImportWarnings": true
  }]],
};
```

Changelog:
[General][Internal] - Added plugin to react-native/babel-preset injecting `console.warn` for each react native deep import in dev mode.

For a given code:
```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
```

The transformed output should look like:

```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Components/View/View').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Text/Text').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Pressability/PressabilityDebug').");
```

For more information about why this plugin was needed, please check [RFC](react-native-community/discussions-and-proposals#894).

Reviewed By: huntie

Differential Revision: D70783145
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Apr 24, 2025
…njection under deep react native imports (#50802)

Summary:
Pull Request resolved: #50802

The plugin analyses the source of all `import`, `require`, and `export` statements and injects the `console.warn` statement for each path targeting deep react-native source code. It runs only on a dev mode so there is no need to keep that in the `if (__DEV__) ` block. It is possible to disable this plugin by setting `disableDeepImportWarnings: true` and **resetting** the Metro cache:

```js
module.exports = {
  presets: [['module:react-native/babel-preset', {
    "disableDeepImportWarnings": true
  }]],
};
```

Changelog:
[General][Internal] - Added plugin to react-native/babel-preset injecting `console.warn` for each react native deep import in dev mode.

For a given code:
```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
```

The transformed output should look like:

```js
import { Image } from 'react-native';
import View from 'react-native/Libraries/Components/View/View';
const Text = require('react-native/Libraries/Text/Text');
export { PressabilityDebugView } from 'react-native/Libraries/Pressability/PressabilityDebug';
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Components/View/View').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Text/Text').");
console.warn("Deep imports from the 'react-native' package are deprecated ('react-native/Libraries/Pressability/PressabilityDebug').");
```

For more information about why this plugin was needed, please check [RFC](react-native-community/discussions-and-proposals#894).

Reviewed By: huntie

Differential Revision: D70783145

fbshipit-source-id: ae145db6471d861099566a8faf2fbd93bd136450
@migueldaipre
Copy link

migueldaipre commented Apr 24, 2025

Hey folks, please expose TextNativeComponent.

import { NativeText } from 'react-native/Libraries/Text/TextNativeComponent';

Many apps and component libraries use this under the hood because it is more performant.

huntie added a commit to huntie/react-native that referenced this pull request Apr 25, 2025
Summary:
Redesigns React Native's `NewAppScreen` component, and moves it into a new `react-native/new-app-screen` package with a single component export.

{F1977434404}

**Motivation**

- **Reduces our public API** (see react-native-community/discussions-and-proposals#894)
    - Separates this screen from the main `react-native` package, where it was a number of subpath exports.
    - Reduces the size of the main `react-native` package, including image assets — which are redundant for consumers like Expo.
- **Updated visual treatment**
    - Replace outdated logo, update to a responsive tablet/windowed layout.
    - Removes outdated guidance (e.g. "use cmd+R to reload"), and generally simplifies the layout (with the aim of reducing future maintenance).
- **Simplifies template boilerplate**
    - `NewAppScreen` is now a fully encapsulated screen layout, avoiding the cruft of the previous modular design.

**Integration plan**

When we cut the `0.80-stable` branch, we'll update [the template](https://github.com/react-native-community/template/blob/main/template/App.tsx) to import and use `<NewAppScreen />`.

- This will cause an extra runtime dependency in the template `package.json`, which will require user cleanup. We are happy with this tradeoff, given the self-evident package name, reduction of template boilerplate, and size reduction on the main `react-native` package.

Changelog:
[General][Added] - Create new `react-native/new-app-screen` package

Differential Revision: D73657878
@huntie
Copy link
Collaborator Author

huntie commented Apr 25, 2025

@migueldaipre I've added this API to our internal tracking (will also aim to share this publicly). 0.80 will be the start of our deprecation period, in which there's plenty of time to decide how we'll handle individual APIs 👍🏻

@huntie huntie merged commit 094e7c9 into react-native-community:main Apr 25, 2025
@huntie huntie deleted the proposal-deprecate-subpath-imports branch April 25, 2025 14:09
huntie added a commit to huntie/react-native that referenced this pull request Apr 25, 2025
Summary:
Pull Request resolved: facebook#50939

Redesigns React Native's `NewAppScreen` component, and moves it into a new `react-native/new-app-screen` package with a single component export. Deletes the old New App Screen under `'react-native/Libraries/NewAppScreen/'`.

{F1977434404}

**Motivation**

- **Reduces our public API** (see react-native-community/discussions-and-proposals#894)
    - Separates this screen from the main `react-native` package, where it was a number of subpath exports.
    - Reduces the size of the main `react-native` package, including image assets — which are redundant for consumers like Expo.
- **Updated visual treatment**
    - Replace outdated logo, update to a responsive tablet/windowed layout.
    - Removes outdated guidance (e.g. "use cmd+R to reload"), and generally simplifies the layout (with the aim of reducing future maintenance).
- **Simplifies template boilerplate**
    - `NewAppScreen` is now a fully encapsulated screen layout, avoiding the cruft of the previous modular design.

**Integration plan**

When we cut the `0.80-stable` branch, we'll update [the template](https://github.com/react-native-community/template/blob/main/template/App.tsx) to import and use `<NewAppScreen />`.

- This will cause an extra runtime dependency in the template `package.json`, which will require user cleanup. We are happy with this tradeoff, given the self-evident package name, reduction of template boilerplate, and size reduction on the main `react-native` package.

Changelog:
[General][Breaking] - The `NewAppScreen` component is redesigned and moved to the `react-native/new-app-screen` package

Differential Revision: D73657878
huntie added a commit to huntie/react-native that referenced this pull request Apr 25, 2025
Summary:
Pull Request resolved: facebook#50939

Redesigns React Native's `NewAppScreen` component, and moves it into a new `react-native/new-app-screen` package with a single component export. Deletes the old New App Screen under `'react-native/Libraries/NewAppScreen/'`.

{F1977434404}

**Motivation**

- **Reduces our public API** (see react-native-community/discussions-and-proposals#894)
    - Separates this screen from the main `react-native` package, where it was a number of subpath exports.
    - Reduces the size of the main `react-native` package, including image assets — which are redundant for consumers like Expo.
- **Updated visual treatment**
    - Replace outdated logo, update to a responsive tablet/windowed layout.
    - Removes outdated guidance (e.g. "use cmd+R to reload"), and generally simplifies the layout (with the aim of reducing future maintenance).
- **Simplifies template boilerplate**
    - `NewAppScreen` is now a fully encapsulated screen layout, avoiding the cruft of the previous modular design.

**Integration plan**

When we cut the `0.80-stable` branch, we'll update [the template](https://github.com/react-native-community/template/blob/main/template/App.tsx) to import and use `<NewAppScreen />`.

- This will cause an extra runtime dependency in the template `package.json`, which will require user cleanup. We are happy with this tradeoff, given the self-evident package name, reduction of template boilerplate, and size reduction on the main `react-native` package.

Changelog:
[General][Breaking] - The `NewAppScreen` component is redesigned and moved to the `react-native/new-app-screen` package

Differential Revision: D73657878
huntie added a commit to huntie/react-native that referenced this pull request Apr 25, 2025
Summary:
Pull Request resolved: facebook#50939

Redesigns React Native's `NewAppScreen` component, and moves it into a new `react-native/new-app-screen` package with a single component export. Deletes the old New App Screen under `'react-native/Libraries/NewAppScreen/'`.

{F1977434404}

**Motivation**

- **Reduces our public API** (see react-native-community/discussions-and-proposals#894)
    - Separates this screen from the main `react-native` package, where it was a number of subpath exports.
    - Reduces the size of the main `react-native` package, including image assets — which are redundant for consumers like Expo.
- **Updated visual treatment**
    - Replace outdated logo, update to a responsive tablet/windowed layout.
    - Removes outdated guidance (e.g. "use cmd+R to reload"), and generally simplifies the layout (with the aim of reducing future maintenance).
- **Simplifies template boilerplate**
    - `NewAppScreen` is now a fully encapsulated screen layout, avoiding the cruft of the previous modular design.

**Integration plan**

When we cut the `0.80-stable` branch, we'll update [the template](https://github.com/react-native-community/template/blob/main/template/App.tsx) to import and use `<NewAppScreen />`.

- This will cause an extra runtime dependency in the template `package.json`, which will require user cleanup. We are happy with this tradeoff, given the self-evident package name, reduction of template boilerplate, and size reduction on the main `react-native` package.

Changelog:
[General][Breaking] - The `NewAppScreen` component is redesigned and moved to the `react-native/new-app-screen` package

Differential Revision: D73657878
huntie added a commit to huntie/react-native that referenced this pull request Apr 25, 2025
Summary:
Pull Request resolved: facebook#50939

Redesigns React Native's `NewAppScreen` component, and moves it into a new `react-native/new-app-screen` package with a single component export. Deletes the old New App Screen under `'react-native/Libraries/NewAppScreen/'`.

{F1977434404}

**Motivation**

- **Reduces our public API** (see react-native-community/discussions-and-proposals#894)
    - Separates this screen from the main `react-native` package, where it was a number of subpath exports.
    - Reduces the size of the main `react-native` package, including image assets — which are redundant for consumers like Expo.
- **Updated visual treatment**
    - Replace outdated logo, update to a responsive tablet/windowed layout.
    - Removes outdated guidance (e.g. "use cmd+R to reload"), and generally simplifies the layout (with the aim of reducing future maintenance).
- **Simplifies template boilerplate**
    - `NewAppScreen` is now a fully encapsulated screen layout, avoiding the cruft of the previous modular design.

**Integration plan**

When we cut the `0.80-stable` branch, we'll update [the template](https://github.com/react-native-community/template/blob/main/template/App.tsx) to import and use `<NewAppScreen />`.

- This will cause an extra runtime dependency in the template `package.json`, which will require user cleanup. We are happy with this tradeoff, given the self-evident package name, reduction of template boilerplate, and size reduction on the main `react-native` package.

Changelog:
[General][Breaking] - The `NewAppScreen` component is redesigned and moved to the `react-native/new-app-screen` package

Differential Revision: D73657878
// import {Alert} from 'react-native';
```

**Under the hood**: As we are unsure about the % usage of [@react-native/eslint-config](https://www.npmjs.com/package/@react-native/eslint-config), we believe integrating via Metro is important for consistent visibility.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo there should be a separate eslint-plugin. the config includes way more things and mostly a collection of configs which people may or may not want, since a lot of them will be according to preference.

with a eslint plugin everyone can include it in their config regardless of if they want to use the official config or not, and get the benefit of autofix (and any future react native specific features).

huntie added a commit to huntie/react-native that referenced this pull request Apr 25, 2025
Summary:
Pull Request resolved: facebook#50939

Redesigns React Native's `NewAppScreen` component, and moves it into a new `react-native/new-app-screen` package with a single component export. Deletes the old New App Screen under `'react-native/Libraries/NewAppScreen/'`.

{F1977434404}

**Motivation**

- **Reduces our public API** (see react-native-community/discussions-and-proposals#894)
    - Separates this screen from the main `react-native` package, where it was a number of subpath exports.
    - Reduces the size of the main `react-native` package, including image assets — which are redundant for consumers like Expo.
- **Updated visual treatment**
    - Replace outdated logo, update to a responsive tablet/windowed layout.
    - Removes outdated guidance (e.g. "use cmd+R to reload"), and generally simplifies the layout (with the aim of reducing future maintenance).
- **Simplifies template boilerplate**
    - `NewAppScreen` is now a fully encapsulated screen layout, avoiding the cruft of the previous modular design.

**Integration plan**

When we cut the `0.80-stable` branch, we'll update [the template](https://github.com/react-native-community/template/blob/main/template/App.tsx) to import and use `<NewAppScreen />`.

- This will cause an extra runtime dependency in the template `package.json`, which will require user cleanup. We are happy with this tradeoff, given the self-evident package name, reduction of template boilerplate, and size reduction on the main `react-native` package.

Changelog:
[General][Breaking] - The `NewAppScreen` component is redesigned and moved to the `react-native/new-app-screen` package

Reviewed By: cipolleschi

Differential Revision: D73657878
huntie added a commit to huntie/react-native that referenced this pull request Apr 26, 2025
Summary:
Pull Request resolved: facebook#50939

Redesigns React Native's `NewAppScreen` component, and moves it into a new `react-native/new-app-screen` package with a single component export. Deletes the old New App Screen under `'react-native/Libraries/NewAppScreen/'`.

{F1977434404}

**Motivation**

- **Reduces our public API** (see react-native-community/discussions-and-proposals#894)
    - Separates this screen from the main `react-native` package, where it was a number of subpath exports.
    - Reduces the size of the main `react-native` package, including image assets — which are redundant for consumers like Expo.
- **Updated visual treatment**
    - Replace outdated logo, update to a responsive tablet/windowed layout.
    - Removes outdated guidance (e.g. "use cmd+R to reload"), and generally simplifies the layout (with the aim of reducing future maintenance).
- **Simplifies template boilerplate**
    - `NewAppScreen` is now a fully encapsulated screen layout, avoiding the cruft of the previous modular design.

**Integration plan**

When we cut the `0.80-stable` branch, we'll update [the template](https://github.com/react-native-community/template/blob/main/template/App.tsx) to import and use `<NewAppScreen />`.

- This will cause an extra runtime dependency in the template `package.json`, which will require user cleanup. We are happy with this tradeoff, given the self-evident package name, reduction of template boilerplate, and size reduction on the main `react-native` package.

Changelog:
[General][Breaking] - The `NewAppScreen` component is redesigned and moved to the `react-native/new-app-screen` package

Reviewed By: cipolleschi

Differential Revision: D73657878
huntie added a commit to huntie/react-native that referenced this pull request Apr 26, 2025
Summary:
Pull Request resolved: facebook#50939

Redesigns React Native's `NewAppScreen` component, and moves it into a new `react-native/new-app-screen` package with a single component export. Deletes the old New App Screen under `'react-native/Libraries/NewAppScreen/'`.

{F1977434404}

**Motivation**

- **Reduces our public API** (see react-native-community/discussions-and-proposals#894)
    - Separates this screen from the main `react-native` package, where it was a number of subpath exports.
    - Reduces the size of the main `react-native` package, including image assets — which are redundant for consumers like Expo.
- **Updated visual treatment**
    - Replace outdated logo, update to a responsive tablet/windowed layout.
    - Removes outdated guidance (e.g. "use cmd+R to reload"), and generally simplifies the layout (with the aim of reducing future maintenance).
- **Simplifies template boilerplate**
    - `NewAppScreen` is now a fully encapsulated screen layout, avoiding the cruft of the previous modular design.

**Integration plan**

When we cut the `0.80-stable` branch, we'll update [the template](https://github.com/react-native-community/template/blob/main/template/App.tsx) to import and use `<NewAppScreen />`.

- This will cause an extra runtime dependency in the template `package.json`, which will require user cleanup. We are happy with this tradeoff, given the self-evident package name, reduction of template boilerplate, and size reduction on the main `react-native` package.

Changelog:
[General][Breaking] - The `NewAppScreen` component is redesigned and moved to the `react-native/new-app-screen` package

Reviewed By: cipolleschi

Differential Revision: D73657878
facebook-github-bot pushed a commit to facebook/react-native that referenced this pull request Apr 28, 2025
Summary:
Pull Request resolved: #50939

Redesigns React Native's `NewAppScreen` component, and moves it into a new `react-native/new-app-screen` package with a single component export. Deletes the old New App Screen under `'react-native/Libraries/NewAppScreen/'`.

{F1977434404}

**Motivation**

- **Reduces our public API** (see react-native-community/discussions-and-proposals#894)
    - Separates this screen from the main `react-native` package, where it was a number of subpath exports.
    - Reduces the size of the main `react-native` package, including image assets — which are redundant for consumers like Expo.
- **Updated visual treatment**
    - Replace outdated logo, update to a responsive tablet/windowed layout.
    - Removes outdated guidance (e.g. "use cmd+R to reload"), and generally simplifies the layout (with the aim of reducing future maintenance).
- **Simplifies template boilerplate**
    - `NewAppScreen` is now a fully encapsulated screen layout, avoiding the cruft of the previous modular design.

**Integration plan**

When we cut the `0.80-stable` branch, we'll update [the template](https://github.com/react-native-community/template/blob/main/template/App.tsx) to import and use `<NewAppScreen />`.

- This will cause an extra runtime dependency in the template `package.json`, which will require user cleanup. We are happy with this tradeoff, given the self-evident package name, reduction of template boilerplate, and size reduction on the main `react-native` package.

Changelog:
[General][Breaking] - The `NewAppScreen` component is redesigned and moved to the `react-native/new-app-screen` package

Reviewed By: cipolleschi

Differential Revision: D73657878

fbshipit-source-id: 9ca07afa9fbdd6f32015eafa2f27d52ed182918e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants