braidnetworks / dynohot

Hot module reloading for nodejs
ISC License
90 stars 3 forks source link

implement hot module reloading for CommonJS modules as well #8

Closed kireerik closed 8 months ago

kireerik commented 8 months ago

Is it possible to implement this easily or is there maybe some simple workaround or something similar? Or maybe is there any existing loader or solution that would help with this?

This would be really nice to have. We could replace Nodemon with dynohot and have faster development experience.

laverdet commented 8 months ago

CommonJS is a fundamentally different module system and would require a pretty hefty implementation to get hot reloading right. I'm a militant supporter of ESM over CommonJS and would go so far as saying that continued support of CommonJS is an act of violence against the JavaScript community. There's just no reason to continue using CommonJS.

I think nodemon's popularity over dynohot is just a problem of publicity. I think any team that learns about and tries dynohot would immediately switch over.

kireerik commented 8 months ago

Yes, I agree.

I tried to find a codemod or something. The ones I tried were not working properly, but at least in the meantime, we can use both (Nodemon and dynohot).

Would be nice to have some Node.js module customization based solution if that makes sense as an alternative to Create React App and similar tools, but I couldn't find anything like that so far.