> On Nov 10, 2015, at 6:51 PM, Sean Wolfe <swo...@kabaminc.com> wrote:
> 
> I'm new to node, getting used to the ecosystem. One thing I've noticed is 
> that when I save changes to files, the server restarts, which takes 7-15 
> seconds each cycle.

That restarting behavior is not inherent -- that's something the server or 
build system you're using chose.

> 
> What sort of hotswap / hotplugging options are out there? I see 
> 
> https://www.npmjs.com/package/hotswap 
> 
> which I'm working with but haven't got working yet. Also that repo is a 
> couple years since the last commit.


the problem is that references to old versions can still be loaded -- it will 
behave differently, in theory, than freshly loaded. Not a problem in some 
cases, definitely a source of mysterious bugs in others. Any tool like this is 
going to be very focused on particular cases, or ignoring edge cases entirely. 
There's no general solution for how hot swapping should be done.

> 
> Is hotplugging code, ie. reloading individual changed files without 
> restarting, popular for node? Are there other npm's that I'm not finding? Why 
> isn't this supported out of the box? Also, is 7-15 seconds a long time for a 
> nodejs server? I'm guessing yes ...

Indeed: My approach has been to build smaller servers that do less (and less at 
startup), and if possible with well defined single purposes.

npm's website starts in about 2 seconds for me, I want to get that time down to 
250ms at some point. That's my personal approach right now.

Aria

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/C6734B32-8C5C-45C0-95CF-F05488CB159F%40dinhe.net.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to