-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
wip server entry + standalone build #1342
Conversation
41638c5
to
1cd3c35
Compare
If you:
Logs like Using this PR and At this point, I'm 99% sure, that if the PR is released, the logs will show for the user when |
I need some help with this part: https://github.com/vikejs/vike/pull/1342/files#diff-9e4f75824c2dea66c574aef0b7effc3ab5d1452038290c19e25fc6af458f880eR104-R177 It needs to reliably copy files and create relative symlinks in dist/node_modules. The folder structure in dist has to look like this when using a pnpm monorepo: This kind of works right now, but I don't know how stable it is. References: |
I will have a look at it.
My guess is that it's because Vike's server runtime is now processed by Vite whereas before it wasn't. Which means we need to use FYI I'm further refactoring |
I did a little bit of reviewing during the flight :)
|
I removed nextTick, it's not necessary.
I think it is already as fast as it gets, but prove me wrong. Maybe I'm missing some information, but in my head it's the opposite: If we use esbuild(which is faster than Rollup), we can skip Rollup chunking, and instead let esbuild bundle all the externals that Rollup didn't.
Next and Astro use nft.
I don't know where to handle this:
|
725d71a
to
de48ba0
Compare
I just pushed a commit that fixes it. The server still shuts down if the error is thrown for the very first server start, but I think this can also be fixed by wrapping the other |
app.get('*', async (req, res, next) => {
foo still breaks it |
What do you think about this? https://github.com/vikejs/vike/pull/1342/files#diff-ae1a4d37b5cb5aa071d99d1d5140bdc01eaed4f2abb7236c6f89ef4e58cd918fR68-R77 Now, if the inner user server process exits with 1, the cli doesn't exit, but waits for the next file change in I'm not sure if hooking |
I'd usually agree, but I think it's fine for our use case because we aren't preventing the server from terminating: we do terminate the server, it's just that we preserve the process. I wonder if there is much of a difference between auto-reloading upon a normal change and auto-reloading upon an error: in both situations we (equally?) risk not cleaning side-effects.
I like it. The downside though is that it triggers a slow complete reload instead of a quick vavite reload. The upside of injecting a I guess we can go for the chockidar solution if it makes our lives non-negligibly easier. |
I think I've been wrong: upon a quick vavite reload, we close the HTTP server, therefore terminating the forever-hanging HTTP request. |
Good point. Is this fine then? https://github.com/vikejs/vike/pull/1342/files#diff-a23fb21ec8d5ef2351248affc34cde56e016ee0d80d16878b29f30457af67e90R116-R122 |
Neat. I just tried and it indeed seems to work. I'm just understanding that my mistake was to listen to the wrong process (the parent CLI process instead of child server process). So no need to inject the listeners to the user severy entry then 👌 |
Good point and you're right esbuild is probably a lot faster at processing (FYI I just pushed some commits and the code generated by
Indeed that would be nice. Chunking is quite complex and I can see Rollup spending quite some time on it. |
bf2799f
to
8119e71
Compare
In my opinion we don't need two separate shortcuts for "fast" and "full" reload. |
I think a user who uses |
I'd like to summarize the recent changes:
|
Neat & makes sense. FYI brillout/react-streaming@f4da7fc which is released in |
273b3c6
to
02d8158
Compare
Continued in #1513 |
No description provided.