Skip to content

feat: forked dev server - #81

Merged
danielroe merged 2 commits into
mainfrom
feat/dev-fork
Aug 24, 2023
Merged

danielroe merged 2 commits into
mainfrom
feat/dev-fork

Conversation

@pi0

@pi0 pi0 commented Aug 21, 2023

Copy link
Copy Markdown
Member

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
Comment thread src/commands/dev.ts Resolved
Comment thread src/commands/dev-internal.ts Resolved
@danielroe danielroe mentioned this pull request Aug 24, 2023
@danielroe
danielroe merged commit 785119f into main Aug 24, 2023
@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
Copy Markdown
Contributor

@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