NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Implementing native Node.js hot modules (technical write up) (immaculata.dev)
cyco130 3 days ago [-]
I believe at least the Vitest project considered using node:module hooks for live reloading but rejected it in the past. The reason given to me was that, there is no way to garbage-collect a real EcmaScript module since they're always reachable by the module ID string as per the specification.

This kind of leak was deemed acceptable in a browser tab (which we tend to close or reload often) but unacceptable for a long-running server process.

Pseudo-modules based on node:vm, on the other hand, will be collected normally when they become unreachable.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 00:03:14 GMT+0000 (Coordinated Universal Time) with Vercel.