Skip to content
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 Reloading #90

Closed
2 of 4 tasks
arctic-hen7 opened this issue Dec 12, 2021 · 2 comments
Closed
2 of 4 tasks

Hot Reloading #90

arctic-hen7 opened this issue Dec 12, 2021 · 2 comments
Assignees
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

Comments

@arctic-hen7
Copy link
Member

arctic-hen7 commented Dec 12, 2021

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 to perseus 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 with browsersync (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 using entr and browsersync manually is way too complex (check out the website's scripts in bonnie.toml).

Additional context

  • Add support for watching files with perseus build (No point to this.)
  • Add support for watching files with perseus export
  • Add support for watching files with perseus serve
  • Add support for actively reloading the browser automatically (somehow...)

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.

@arctic-hen7 arctic-hen7 self-assigned this Dec 12, 2021
@arctic-hen7 arctic-hen7 added A-cli Area: command line interface C-enhancement Category: enhancement D-hard Difficulty: hard P-medium Priority: medium S-in-design Status: in design labels Dec 12, 2021
@arctic-hen7
Copy link
Member Author

This will be released for Perseus v0.3.1 (if all goes to plan).

@arctic-hen7
Copy link
Member Author

Okay, I'll delegate automatic browser reloading to a future issue, and, as of v0.3.1, this is now live!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

1 participant