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

feat(serve)!: implement live reloading with websockets #42

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

NTBBloodbath
Copy link
Owner

  • Add tokio-tungstenite and futures-util dependencies for websocket handling
  • Implement a websocket server that listens for connections and sends reload commands
  • Inject a livereload.js script into HTML pages that establishes the websocket connection
  • Change the reload mechanism to trigger a websocket message instead of polling
  • Update the server to serve the livereload.js file

This replaces the hacky polling live reload mechanism with websockets for more efficient and responsive updates. Closes #35

- Added `tokio-tungstenite` and `futures-util` dependencies for websocket handling
- Implemented a websocket server that listens for connections and sends reload commands
- Injected a `livereload.js` script into HTML pages that establishes the websocket connection
- Changed the reload mechanism to trigger a websocket message instead of polling
- Updated the server to serve the `livereload.js` file

This replaces the hacky polling live reload mechanism with websockets for more efficient
and responsive updates. Closes #35
@NTBBloodbath NTBBloodbath added the enhancement New feature or request label Feb 5, 2025
@NTBBloodbath NTBBloodbath merged commit 9c2cebf into master Feb 5, 2025
4 checks passed
@NTBBloodbath NTBBloodbath deleted the push-xruztllxpysk branch February 5, 2025 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: migrate web server to livereload.js
1 participant