Skip to content

Simplify react-native/setup-env require in community-cli-plugin#57498

Closed
huntie wants to merge 1 commit into
react:mainfrom
huntie:export-D111225671
Closed

Simplify react-native/setup-env require in community-cli-plugin#57498
huntie wants to merge 1 commit into
react:mainfrom
huntie:export-D111225671

Conversation

@huntie

@huntie huntie commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary:
Motivation

While sanity checking #57492, I double checked why we use path.join(ctx.reactNativePath, ...) here when adjacent OOT platforms resolve by package name.

It turns out this complexity is historic and redundant:

  • reactNativePath doesn't customize the react-native package name — it only resolves the node_modules directory. [1]
  • We now (since ~2 years ago) resolve using {paths: [ctx.root]}, making the manual path.join redundant.

This diff

Drops the reactNativePath option and resolves react-native/setup-env directly by package name.

Purely a refactor. No need to pick to 0.87.

Changelog: [Internal]

Differential Revision: D111225671

Summary:
**Motivation**

While sanity checking react#57492, I double checked why we use `path.join(ctx.reactNativePath, ...)` here when adjacent OOT platforms resolve by package name.

It turns out this complexity is historic and redundant:

- `reactNativePath` doesn't customize the `react-native` package name — it only resolves the `node_modules` directory.
  [[1]](https://github.com/react-native-community/cli/blame/main/packages/cli-tools/src/findPackageDependencyDir.ts#L81)
- We now (since ~2 years ago) resolve using `{paths: [ctx.root]}`, making the manual `path.join` redundant.

**This diff**

Drops the `reactNativePath` option and resolves `react-native/setup-env` directly by package name.

Purely a refactor. No need to pick to 0.87.

Changelog: [Internal]

Differential Revision: D111225671
@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 9, 2026
@meta-codesync

meta-codesync Bot commented Jul 9, 2026

Copy link
Copy Markdown

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

@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jul 9, 2026
@meta-codesync meta-codesync Bot closed this in 4237f1a Jul 10, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Jul 10, 2026
@meta-codesync

meta-codesync Bot commented Jul 10, 2026

Copy link
Copy Markdown

This pull request has been merged in 4237f1a.

@huntie huntie deleted the export-D111225671 branch July 10, 2026 13:20
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. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant