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

Add hot reload via elm-live #1621

Merged
merged 5 commits into from
Feb 2, 2024
Merged

Add hot reload via elm-live #1621

merged 5 commits into from
Feb 2, 2024

Conversation

bcardiff
Copy link
Member

@bcardiff bcardiff commented Feb 2, 2024

Changes ./script/develop.sh to use elm-live with hot reload.

You might need to drop the local .direnv directory if elm-live is not available, I'm not sure how to force the nix-profile to be rebuilt in other way.

In case you are blocked the old script is in ./script/legacy-develop.sh, we can clean things later and probably drop python as a dependency.

In order to make hot reload work the Example/UsageExample needs to be tweaked a bit. Before this PR we stored them fully in the App model. This included the view, so the hot reload making its magic restored the old views 🙃 . We now store only the example state in the App model. Additionally examples now define init instead of state field and the view functions receive the state explicitly. Example and UsageExample are now immutable declarations.

🍐 with @tesk9

You might need to delete your local .direnv to update it
The formar python is left for a bit in case elm-live does not work fully, we then do cleanup later.
Otherwise the hot reload will not update the view, which was stored in the App model.
Copy link
Contributor

@tesk9 tesk9 left a comment

Choose a reason for hiding this comment

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

AHHHHHHHHHH SO GOOD

The modeling changes make the CC WAY better, and live reload is 💯 !

🏆 Best noredink-ui PR of the year award 🏆

@tesk9 tesk9 merged commit 9dbfc73 into master Feb 2, 2024
8 checks passed
@tesk9 tesk9 deleted the hot-reload branch February 2, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants