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

Improve development time application reload #239

Merged
merged 38 commits into from Feb 24, 2023

Conversation

fjvallarino
Copy link
Owner

@fjvallarino fjvallarino commented Dec 5, 2022

This PR implements several improvements to the development workflow:

  • Reuse the active window when saving changes to files and reloading the application. This handles the feature requested here: Ghcid not working properly #88
  • Reuse the latest version of the model when saving changes and reloading the application. This allows for a faster development experience since the application will be restored to its previous state (in most cases, at least)

To take advantage of the model reuse feature, applications need to provide a new configuration attribute. If the model implements a derived version of Show, it can be enabled as follows:

config = [
...
  appModelFingerprint show
...
]

The appModelFingerprint function receives a function from the model's type to String. Details can be found here.

…red to avoid artifacts. It still does not render every frame
@Dretch
Copy link
Contributor

Dretch commented Dec 28, 2022

I just had a play around with this. It mostly worked nicely: it is good to be able to keep the same window and model 😄

One issue I had is that I had to save a file twice before the UI updated: the first time I saved the file, ghci printed *** Exception: <<loop>> - but then when I re-saved it worked as expected. I was using a .ghcid file like this one: https://github.com/fjvallarino/monomer-starter/blob/main/.ghcid (only difference is the app name) and no .ghci file, on Linux (the project is private but I can probably make a project to demo the issue).

@fjvallarino
Copy link
Owner Author

@Dretch wow, I missed this too 😞. I was reviewing this PR in order to merge it and saw the comment.

I wonder if it's related to not having the .ghci file. I'll test more tomorrow to see if I can replicate it.

Thanks for testing it!

@fjvallarino fjvallarino merged commit 5b90aeb into main Feb 24, 2023
@fjvallarino fjvallarino deleted the feature/reload-improvements branch February 24, 2023 17:14
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.

None yet

2 participants