Skip to content

Drop legacy cli-server-api reference in dev server (#57653)#57653

Open
huntie wants to merge 5 commits into
react:mainfrom
huntie:export-D113412986
Open

Drop legacy cli-server-api reference in dev server (#57653)#57653
huntie wants to merge 5 commits into
react:mainfrom
huntie:export-D113412986

Conversation

@huntie

@huntie huntie commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary:

Actions TODO comment dependant on react-native-community/cli#2605 (landed).

This drops our local dependency on react-native-community/cli-server-api Flow types, as well as avoiding this transient dependency in end user projects.

Other changes

  • Promote debug log to a user-facing warn — several features in RN will break/degrade in this case and we want to flag explicitly.

Changelog: [Internal]

Differential Revision: D113412986

huntie added 2 commits July 23, 2026 07:29
Summary:
Remove the unused `--version` option from the standalone bundle script wrapper. The React Native version remains available through the main CLI.

Changelog: [Internal]

Differential Revision: D113389459
Summary:
Move the standalone bundle wrapper's Commander setup into `react-native/community-cli-plugin`, where the canonical bundle option descriptors live. Expose the internal `unstable_createBundleCommandParser` helper so `react-native/scripts/bundle.js` only handles wrapper-specific config loading and invocation.

Move the direct `commander` dependency from `react-native` to `react-native/community-cli-plugin`, retain Commander-generated base help, and remove the unused `program` export from the script wrapper.

Changelog: [Internal]

Differential Revision: D113389458
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 23, 2026
@meta-codesync

meta-codesync Bot commented Jul 23, 2026

Copy link
Copy Markdown

@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D113412986.

huntie added a commit to huntie/react-native that referenced this pull request Jul 23, 2026
Summary:
Pull Request resolved: react#57653

Actions TODO comment dependant on react-native-community/cli#2605 (landed).

This drops our local dependency on `react-native-community/cli-server-api` Flow types, as well as avoiding this transient dependency in end user projects.

**Other changes**

- Promote `debug` log to a user-facing `warn` — several features in RN will break/degrade in this case and we want to flag explicitly.

Changelog: [Internal]

Differential Revision: D113412986
@huntie
huntie force-pushed the export-D113412986 branch from ce43ec1 to 2211935 Compare July 23, 2026 16:49
@meta-codesync meta-codesync Bot changed the title Drop legacy cli-server-api reference in dev server Drop legacy cli-server-api reference in dev server (#57653) Jul 23, 2026
huntie added 3 commits July 23, 2026 09:53
Summary:
Migrate the `codegen` and `spm` command implementations out of `react-native.config.js` and into the `react-native/community-cli-plugin` package, alongside the existing `bundleCommand` and `startCommand`.

This continues moving command definitions into the plugin so `react-native.config.js` becomes a thin routing layer, as the file's own comment already calls for.

**Changes**

- Add `src/commands/spm/index.js` and `src/commands/codegen/index.js`, each defining and default-exporting its command (unchanged `name`, `description`, and `options`) plus an exported args type — mirroring the `bundle`/`start` command structure.
- Export `spmCommand` and `codegenCommand` from `src/index.flow.js`.
- Drop the inline `spmCommand` and `codegenCommand` definitions from `react-native.config.js`.

Changelog: [Internal]

Differential Revision: D113412987
Summary:
Reorganise these modules under a `src/dev-server/` directory, more clearly identifying this unit of the codebase.

No public API change: the package still exports `startCommand` unchanged.

Renames inside this directory:

- `middleware.js` → `loadCommunityMiddleware.js`
- `runServer.js` → `runDevServer.js`

Changelog: [Internal]

Differential Revision: D113412985
Summary:
Pull Request resolved: react#57653

Actions TODO comment dependant on react-native-community/cli#2605 (landed).

This drops our local dependency on `react-native-community/cli-server-api` Flow types, as well as avoiding this transient dependency in end user projects.

**Other changes**

- Promote `debug` log to a user-facing `warn` — several features in RN will break/degrade in this case and we want to flag explicitly.

Changelog: [Internal]

Differential Revision: D113412986
@huntie
huntie force-pushed the export-D113412986 branch from 2211935 to 1d3240d Compare July 23, 2026 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant