Skip to content

feat: live reload#370

Merged
rochacbruno merged 4 commits intorochacbruno:mainfrom
guibeira:feat/livereload
Oct 16, 2025
Merged

feat: live reload#370
rochacbruno merged 4 commits intorochacbruno:mainfrom
guibeira:feat/livereload

Conversation

@guibeira
Copy link
Copy Markdown
Contributor

This pull request introduces a WebSocket-based live reload feature to the Marmite development server, allowing browsers to automatically refresh when site files change during development. It adds a new live reload script endpoint, injects the script into served HTML files, and manages live reload connections and notifications. The documentation is updated to explain how to use the new feature.

Live reload feature:

  • Added a WebSocket-based live reload system, including a new LiveReload struct for managing client connections and sending reload notifications when site files change. [1] [2] [3]
  • Injected a live reload script snippet into served HTML files when live reload is enabled, and exposed the script at /__marmite__/livereload.js. [1] [2]
  • Updated the server to handle WebSocket upgrade requests at /__marmite__/livereload and broadcast reload events to connected clients. [1] [2]

Configuration and dependency updates:

  • Added the tungstenite crate for WebSocket support and updated server code to accept an optional LiveReload argument. [1] [2] [3]

Documentation:

  • Updated the README.md with instructions for enabling live reload in development, including how to add the script snippet to templates.

@rochacbruno rochacbruno merged commit 915102b into rochacbruno:main Oct 16, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants