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

feat: support experimental RN debugger interaction #757

Merged
merged 19 commits into from
Oct 28, 2024

Conversation

artus9033
Copy link
Contributor

@artus9033 artus9033 commented Sep 26, 2024

Summary

This PR introduces support for the TUI 'j' interaction and implementations of this interaction for Webpack & Rspack.
It also refactors code in setupInteractions.ts to properly warn about possible (currently none) unsupported interactions in the underlying bundler wrapper implementation, as well as replaces a series of if-else expressions with a switch and replacing object arrow functions with object literal methods shorthand syntax.

Demo

Live interaction:
demo-repack-exp-debugger

Initial help message:

With experimental debugger capability Without experimental debugger capability
Screenshot 2024-09-26 at 18 17 03 Screenshot 2024-09-26 at 18 23 26

Test plan

  • Run without --experimental-debugger & pressing 'j' should result in warning: DevTools require the '--experimental-debugger' flag to be passed to the bundler process
  • Run with --experimental-debugger & pressing 'j' should result in the DevTools being opened, both for Webpack & Rspack

Copy link

changeset-bot bot commented Sep 26, 2024

🦋 Changeset detected

Latest commit: 0aaed0b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@callstack/repack Minor
@callstack/repack-dev-server Minor
@callstack/repack-init Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Sep 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
repack-website ⬜️ Ignored (Inspect) Visit Preview Oct 28, 2024 5:25pm

@artus9033 artus9033 force-pushed the feat/support-new-rn-debugger branch 2 times, most recently from ae485b1 to 222629f Compare September 26, 2024 12:20
@artus9033 artus9033 force-pushed the feat/support-new-rn-debugger branch from 222629f to c6f19f2 Compare September 26, 2024 12:23
@thymikee
Copy link
Member

demo pls!

@artus9033
Copy link
Contributor Author

demo pls!

I've just updated the root comment to include a demo GIF.

@thymikee
Copy link
Member

Do we have a way to display the shortcuts that you can press?

@artus9033
Copy link
Contributor Author

For sure we can, I will have this implemented as well.

@thymikee
Copy link
Member

Let's make it dead simple, like logging the options once. No need to do anything fancier for now

@artus9033
Copy link
Contributor Author

artus9033 commented Sep 26, 2024

Done in b93c3f7, also added screenshots ✅

Copy link
Member

@jbroma jbroma left a comment

Choose a reason for hiding this comment

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

few quick ones for now

packages/repack/src/commands/webpack/start.ts Outdated Show resolved Hide resolved
packages/repack/src/commands/rspack/start.ts Outdated Show resolved Hide resolved
packages/repack/src/commands/rspack/start.ts Outdated Show resolved Hide resolved
packages/repack/src/commands/consts.ts Outdated Show resolved Hide resolved
packages/repack/src/commands/common/setupInteractions.ts Outdated Show resolved Hide resolved
packages/repack/src/commands/common/setupInteractions.ts Outdated Show resolved Hide resolved
packages/repack/src/commands/common/setupInteractions.ts Outdated Show resolved Hide resolved
packages/repack/src/commands/common/setupInteractions.ts Outdated Show resolved Hide resolved
packages/repack/src/commands/common/setupInteractions.ts Outdated Show resolved Hide resolved
packages/repack/src/commands/common/setupInteractions.ts Outdated Show resolved Hide resolved
Copy link
Member

@jbroma jbroma left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@jbroma
Copy link
Member

jbroma commented Oct 28, 2024

this is how final output looks like now:

image

@jbroma jbroma merged commit 8a90731 into main Oct 28, 2024
5 checks passed
@jbroma jbroma deleted the feat/support-new-rn-debugger branch October 28, 2024 17:28
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.

3 participants