3 ms·
Sounds like you're trying to work backwards from your production setup into a "toy" one. Honestly, HMR is a double-edged sword. Your son is much more likely to
by lhorie 8y ago
Sounds like you're trying to work backwards from your production setup into a "toy" one. Honestly, HMR is a double-edged sword. Your son is much more likely to understand the fundamental HTTP request lifecycle if he needs to manually refresh, than if his environment does magical web-socket-based code rebinding.
I'd suggest going the opposite way: start off with vanilla local HTML files. At the very start, he's going to have his hands full with HTML and CSS, then eventually JS and dev tools. It will make way more sense for him down the road if you introduce templating/routing after he realizes the tediousness of copying and pasting layout changes across multiple HTML files.
For introducing server-side things, I'd suggest something web-centric like PHP. It may not be sexy, but it does two important things: 1) it won't bog him down as much as Node with configuration/plumbing stuff like setting up a database or adding static asset middleware, and 2) it will expand your son's horizon from just-javascript-development to polyglot development.