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: forked dev server #81

Merged
merged 2 commits into from
Aug 24, 2023
Merged

feat: forked dev server #81

merged 2 commits into from
Aug 24, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Aug 21, 2023

Resolves #29

Resolves #73

This PR adds back new architecture of forked dev server using citty and unjs/httpxy. With this we will have feature parity with the current upstream nuxi CLI (and more!)

The main difference between new implementation and previous, is that the main listener lives in the main Node.js process and requests will get proxied to the actual dev server listening on a random HTTP port. This adds little overhead but adds lots of stability without need to restart HTTP(s) server, tunnel, possible devtools and IDE extensions using a fully standalone controller host.

Another small feature I've added with this PR is to enable Node.js --enable-source-maps by default.

Previous:

image

Now:

image

@pi0 pi0 requested review from antfu and danielroe August 21, 2023 21:54
src/commands/dev.ts Outdated Show resolved Hide resolved
@danielroe danielroe mentioned this pull request Aug 24, 2023
@danielroe danielroe merged commit 785119f into main Aug 24, 2023
2 checks passed
@danielroe danielroe deleted the feat/dev-fork branch August 24, 2023 13:03
@pi0 pi0 mentioned this pull request Aug 28, 2023
@Eckhardt-D
Copy link

@pi0 @danielroe The one regression this brings is that bunx --bun nuxt dev no longer works because bun does not implement IPC on child processes yet. Now there is a silent exit 0 being called in childProc.on("close") and weird behaviour where it prints out the bun help 😆 I know this is Bun's responsibility to fix. But shall I open a issue anyway so people at least know the limitation?

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.

Support --inspect for dev mode Reimplement forked dev server
3 participants