Closed matt-erhart closed 1 year ago
Thanks, @matt-erhart . I am a remix fun. I am very attracted remix's power. I'll review the issue and try to fix it.
Can you share the timing reports by remix dev
in your terminal? If you are seeing slow app server ready
times, you can look into using manual mode (https://remix.run/docs/en/main/other-api/dev-v2#manual-mode).
It was something like 300-500ms to build, and 3-4 seconds to restart the app server. V1 is working ok for me, so I probably won't go down the manual mode rabbit hole on v2. The main issue is that that v2 feels like a performance and/or setup time regression.
v2_dev
has to support more than remix-serve
. Whereas remix-serve
only supports Node and CJS, v2_dev
supports any runtime in any JS format. That added responsibility makes the setup for non-remix-serve
apps a bit more onerous, but we're looking to make it easier to opt into.
For example, the current Express template already has everything wired up for you. So you could just copy that if you wanted.
Given that the "restarting app server is slow" issue is addressed via manual mode, going to close this.
Will go take a look at the express template, sounds like the Indie Stack example app is not using the optimal DX setup for v2, maybe let KCD? or who ever authored them know? I use the real-ish app examples to get a sense of new libraries, so anyone else who does the same will assume remix has slow edit times if they spin up the Indie Stack atm.
It sounds like in order to get all platforms to work without writing a compiler for each (months/quarters of work?), you needed to add a bit of copy paste and manual mode to get something working in the near term. This is honestly probably fine (but not legendary yet) if it's included in all the remix examples and doesn't really need to be changed. Manual does feel like library code I shouldn't be changing both because it's exposing chokidar direct and because things become 'my responsibility' which implies that I shouldn't be doing it, but to get the best DX I should be doing it?
I think part of the issue with the Indie stack is that it also launches the mock service worker server, so the initial startup isn't optimized for the new v2 dev server.
If you change the dev
script to "dev": "remix dev"
, you'll see that HMR works as expected, and it doesn't have to reboot the app server.
I also tested by ejecting from Remix App Server to Express, using my rmx-cli eject-ras
script.
Changes
"scripts": {
"dev": "remix dev -c \"node server.mjs\"",
}
// server.mjs
import morgan from "morgan";
+import "./mocks/index.js";
installGlobals();
Can confirm good edit response times from npx create-remix@latest --template https://github.com/remix-run/remix/tree/main/templates/express remix_express
What version of Remix are you using?
1.19
Are all your remix dependencies & dev-dependencies using the same version?
Steps to Reproduce
"dev": "remix dev"
(ie remove msw which was taking an extra 10 seconds per edit)dev_v2 appears to be restarting after each edit.
I'm on windows 11, node 16.
Bonus side note: Thanks for building such a well thought out framework that's basically leading the ecosystem. React/nextjs seem to have basically endorsed the approach, and are now catching up. I think remix has a simpler, more elegant design but nextjs has a big social/marketing advantage. With nextjs/react in experimental turmoil for the 3+ months, now might be the time to really nail the social aspects of getting a framework out. A comparison table with eg dev server perf (updated with each nextjs release) and more YT would really help me sell remix to the other engineers.
Expected Behavior