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

[NO-ISSUE] Enable live reload of pages upon server restart #579

Merged
merged 2 commits into from
Sep 29, 2024

Conversation

tchoutri
Copy link
Contributor

@tchoutri tchoutri commented Sep 1, 2024

Proposed changes

This PR introduces a live reload websocket controlled by HTMX.
This requires us to switch to lucid2, for which some libraries are not yet compatible.

Opened tickets

Contributor checklist

  • My PR is related to <insert ticket number>
  • I have read and understood the CONTRIBUTING guide
  • I have inserted my change and a link to this PR in the CHANGELOG
  • I have updated documentation in ./docs/docs if a public feature has a behaviour change

@tchoutri tchoutri force-pushed the no-issue-livereload-websocket branch from 93ffb27 to 4561012 Compare September 1, 2024 23:31
@tchoutri tchoutri force-pushed the no-issue-livereload-websocket branch 4 times, most recently from 242ddee to 1fa2092 Compare September 10, 2024 07:38
@tchoutri
Copy link
Contributor Author

@TristanCacqueray I see in https://github.com/TristanCacqueray/haskell-xstatic/tree/main/demo-websockets-ki-htmx that you do not use the HTMX websocket extension. Is it worth it to do that myself or should I delegate as much work as possible?

@tchoutri tchoutri marked this pull request as draft September 10, 2024 11:44
@TristanCacqueray
Copy link

TristanCacqueray commented Sep 10, 2024

@tchoutri this was done in a earlier version of htmx which provided the extension out of the box, I think the latest version requires you to install the extension.

edit: actually this does use the extension, see the htmxExtWS value. Though for live reload purpose, that's not great, I think it's better to use SSE instead, that looks more reliable.

@tchoutri
Copy link
Contributor Author

Oh nice! I'll explore the SSE option

@tchoutri tchoutri force-pushed the no-issue-livereload-websocket branch 4 times, most recently from ed60f50 to 77ef447 Compare September 19, 2024 20:30
@tchoutri tchoutri force-pushed the no-issue-livereload-websocket branch 8 times, most recently from 77233b9 to 6efcdc8 Compare September 29, 2024 11:47
@tchoutri tchoutri force-pushed the no-issue-livereload-websocket branch 2 times, most recently from 798cc62 to 7347148 Compare September 29, 2024 12:21
@tchoutri tchoutri force-pushed the no-issue-livereload-websocket branch from 7347148 to 1d8f0e8 Compare September 29, 2024 12:23
@tchoutri tchoutri marked this pull request as ready for review September 29, 2024 12:24
@tchoutri tchoutri merged commit 3c0a1d2 into development Sep 29, 2024
7 checks passed
@tchoutri
Copy link
Contributor Author

Thanks a lot @MangoIV!

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