Skip to content
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

breaking: Replace launchEditor implementation #2587

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

huntie
Copy link
Collaborator

@huntie huntie commented Jan 28, 2025

Summary:

Replace the custom implementation of launchEditor in the cli-tools package with a call to launch-editor.

  • This PR is marked as breaking due to anticipated misalignments for esoteric editor setups.

Why launch-editor?

  • Originally forked from react-dev-utils, which is the same base implementation that was originally copied into this repo.
  • Well-maintained packages with 21 commits in 2024.
    • e.g. has support for Cursor, where we do not.
  • 7.7M weekly downloads and depended on by Vue.js' CLI utils (@vue/cli-shared-utils).

Test Plan:

  • Build this repo via yarn build.
  • Link @react-native-community/cli-tools and @react-native-community/cli-server-api into a local checkout of react-native via yarn link.
  • Open RNTester, modified to throw an error on launch.
Screen.Recording.2025-01-29.at.13.01.33.mov

✅ RedBox is rendered with stack trace
✅ Tapping item in component stack opens in my active editor (VS Code)
✅ Assert new code is called with temp console log

Checklist

  • Documentation is up to date to reflect these changes.
  • Follows commit message convention described in CONTRIBUTING.md

@huntie huntie force-pushed the launch-editor-pkg branch from c03c021 to a7cc06a Compare January 28, 2025 15:54
@huntie huntie marked this pull request as ready for review January 29, 2025 13:01
@huntie huntie requested review from szymonrybczak and removed request for adamTrz January 29, 2025 13:02
fileName: string,
lineNumber: number,
projectRoots: ReadonlyArray<string>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: why do we keep this argument instead of just removing it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For now, to not break the API of the cli-tools package itself. (Although, doing this isn't far off 👀)

Copy link
Collaborator

@szymonrybczak szymonrybczak left a comment

Choose a reason for hiding this comment

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

Awesome! Thank you for working on this 👏

@huntie huntie merged commit c8b527a into react-native-community:main Jan 29, 2025
8 checks passed
@huntie huntie deleted the launch-editor-pkg branch January 29, 2025 13:49
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.

2 participants