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

Question / Suggestion: Consider using elm-hot? #146

Closed
mdevlamynck opened this issue Oct 25, 2018 · 3 comments
Closed

Question / Suggestion: Consider using elm-hot? #146

mdevlamynck opened this issue Oct 25, 2018 · 3 comments

Comments

@mdevlamynck
Copy link

klazuka/elm-hot provides the low-level features for hot swapping elm code with model state preservation between reloads (only 0.19).

Would it make sense for this project to use it?

@wking-io
Copy link
Owner

I have actually discussed with klazula doing just that, but haven't gotten around to it. If you are interested in taking a stab at it feel free!

@lucamug
Copy link
Contributor

lucamug commented May 31, 2019

Ok, I have done some experimenting about hot swap and I was able to make it working in elm-live.

Few caveats:

The script injected by elm-live need to run in the browser BEFORE the elm compiled javascript. So I moved it before everything. I am afraid this is going to break the html so we probably need to be smarter here (adding it just after <head>?)

We need to extrapolate the relative path of the elm compiled javascript. For the moment I used one argument of elm make (--output) and one argument of elm-live (dir). This should probably be done in a more robust way

Probably we need a configuration flag to toggle this feature (simple)

The code for testing is available at https://github.com/lucamug/elm-live/tree/enhancements

I will start using this version at work to see if it is reliable

elm-live-hot-swap

@wking-io
Copy link
Owner

This should be available in the new alpha! You can check the README for how to install it.

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

No branches or pull requests

3 participants