resolve
resolve copied to clipboard
Startup appears to happen twice
This behavior happens with any newly created reSolve project:
➜ npm run dev
> [email protected] dev /Users/oliversturm/temp/resolvedemo2
> babel-node ./run.js dev
[ Shared client ESM chunks ] Time: 2078ms
Built at: 09/29/2020 12:59:15
[ Client IIFE entries ] Time: 3422ms
Built at: 09/29/2020 12:59:16
[ Server local entry point, local bus broker, local event store ] Time: 2092ms
Built at: 09/29/2020 12:59:15
[ Shared server ESM chunks ] Time: 807ms
Built at: 09/29/2020 12:59:14
Application listening on port 3000!
[ Shared client ESM chunks ] Time: 1005ms
Built at: 09/29/2020 12:59:24
[ Client IIFE entries ] Time: 2277ms
Built at: 09/29/2020 12:59:25
[ Server local entry point, local bus broker, local event store ] Time: 1054ms
Built at: 09/29/2020 12:59:24
[ Shared server ESM chunks ] Time: 183ms
Built at: 09/29/2020 12:59:23
Server is still loading - please wait...
Server is still loading - please wait...
Server is still loading - please wait...
Application listening on port 3000!
You can now view resolvedemo2 in the browser.
Local: http://localhost:3000/
On Your Network: http://10.0.0.19:3000/
Note that the development build is not optimized.
To create a production build, use:
npm run build.
npm start.
It clearly looks to me like most of the startup process is run twice before the application is really started up. This was not the case when I worked with reSolve in the past.
I have seen this on two different machines, but both use current versions of Node (12.18.3 and 12.18.4) - maybe that's related?
Hi @oliversturm ! Maybe console output looks unobvious, but there is no several startups of application. First output is from reset
mode and second output is from dev
mode, as it explicitly specified in run.js
file https://github.com/reimagined/resolve/blob/master/examples/hacker-news/run.js#L71-L79. You can easily drop reset
mode invocation or forcefully suppress output from it. Anyway there is no under-the-hood code, and behavior can be changed directly in run.js
in current application.
Ah yes, that is interesting. I know how the startup works, since I've previously fiddled with run.js
for unrelated reasons. However, I forgot about it and it confused me... so here's the prize question: what do we do about this so that the startup process "makes sense" to first-time users?
Update: in a newly created project (seems to be reSolve version 0.25.18) this does not happen anymore. Did you know this problem was fixed?
Hm, looks like run.js
is different now... and the reset
part is not processed as part of dev
anymore. So a conceptual rather than a technical change.