Hot Reloading #90
Labels
A-cli
Area: command line interface
C-enhancement
Category: enhancement
D-hard
Difficulty: hard
P-medium
Priority: medium
S-in-design
Status: in design
Is your feature request related to a problem? Please describe.
It's about time Perseus supported reloading the server based on file changes.
Describe the solution you'd like
A new flag
-w/--watch
should be added toperseus serve
and the other commands that will watch files for changes and reload the server. That shouldn't be too hard, though the next part will be reloading the browser automatically, which could either be done manually with a WebSocket server, or it could be done withbrowsersync
(which other projects like Eleventy depend on, though it is JS some I'm a little apprehensive about that one).Describe alternatives you've considered
People could just use a tool like
entr
, but not having this built in is quite silly I think, it's been requested since the earliest days of the project, and usingentr
andbrowsersync
manually is way too complex (check out the website's scripts inbonnie.toml
).Additional context
Add support for watching files with(No point to this.)perseus build
perseus export
perseus serve
Also, quick note on HMR (Hot Module Reloading, keeping page state between reloads): I believe this would require significant integrations with Sycamore's state systems, so this is off the table for now, though I'm certainly not ruling it out as a longer-term feature.
The text was updated successfully, but these errors were encountered: