exhibitionist-digital / ultra

Zero-Legacy Deno/React Suspense SSR Framework

Home Page:https://ultrajs.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat(hmr): Use HMR in Deno 1.38 to create HMR in Ultra

cdoremus opened this issue · comments

Hot module replacement was just added to the Deno runtime in version 1.38. This should be leveraged to implement HMR in Ultra.

The Deno team has repeatedly said that it plans to use this feature to give Fresh client-side HMR and yesterday it gave a hint on how they will do it. In essence, they suggest listening to the "hmr" event and capturing the Event.detail value that contains the path to the file that changed and triggered the event, and sending that information to the front end that would cause a reload of that file (or perhaps the page that uses that file).

To see that demo on the livestream that discussed using the "hmr" event, take a look at: https://youtu.be/5tUDSrnHFPk?t=1857