Skip to content

Conversation

@Cees-Kettenis
Copy link
Contributor

@Cees-Kettenis Cees-Kettenis commented Oct 17, 2025

  1. Added dev_watcher.go, it implements a file system watcher that monitors changes and assigns hashes to files for efficient change detection.

  2. Added reload.go, handles subscription and notification logic for broadcasting file change events to connected clients.

  3. Updated server.go, Integrates the new live reload functionality, enabling it only when dev = true in config.toml.

  4. Modified routes.go, adjusted static file handling to optionally bypass caching, allowing files to be reloaded during development.

5.Updated footer.gohtml, added JavaScript logic to establish a connection to the new reload endpoint for receiving live update messages.

…itors changes and assigns hashes to files for efficient change detection.

2. Added reload.go,  handles subscription and notification logic for broadcasting file change events to connected clients.

3. Updated server.go, Integrates the new live reload functionality, enabling it only when dev = true in config.toml.

4. Modified routes.go, adjusted static file handling to optionally bypass caching, allowing files to be reloaded during development.

5.Updated footer.gohtml, added JavaScript logic to establish a connection to the new reload endpoint for receiving live update messages.
@Cees-Kettenis Cees-Kettenis changed the title 1. Added dev_watcher.go, it implements a file system watcher that monitors changes and assigns hashes to files for efficient change detection. Added support for live reload for any template, static files. Oct 17, 2025
2. no longer copy all the funcs into a temp func i just call Funcs(devTemplateFuncs)
3. Reworked Subscribe() to take in a func so we no longer need unsubscribe.
4. renamed reloadNotifier "mutex" to "mu"
2.  moved the javascript to templates.gohtml under "live_reload_script"
3. updated the footer to use this new template.
Copy link
Owner

@topi314 topi314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good stuff

@topi314 topi314 merged commit 5807889 into topi314:master Oct 20, 2025
@Cees-Kettenis Cees-Kettenis deleted the feat/dev-live-reload branch December 8, 2025 10:02
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.

3 participants