-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hot-reload #10
Comments
In order to implement this without over-engineering, we need denoland/deno#8327. Currently, with a server started, we can listen to changes on a filesystem and trigger a rebuild. This rebuild is done with the cached modules loaded by Deno. This means that we will react to a change to a module, but a refresh will produce the old page (because the module cache was populated with the old module). As a workaround we could run frugal in a worker and the server in the main thread. Instead of invoking frugal methods, the server would exchange messages with a worker. When a filesystem event is triggered, we destroy and recreate the worker. But i think it's not a good idea :
|
Solution implemented in #18. Starting frugal in dev mode starts a livereload server and generates a module that will be run as a subprocess in watch mode (meaning the module cache is reloaded on each filesystem change event). Parent and subprocess exchange messages through The livereload client is "side loaded" if frugal is started in dev mode, and triggers a page reload. |
In dev mode, use SSE to trigger refresh on rebuild. Not HMR, but this should allow rapid developpment cycle.
The text was updated successfully, but these errors were encountered: