Repository navigation
fix(esm): hot-reloading - #114
Merged
Merged
Conversation
Declare the package-local lamdera executable as a test build tool so CLI tests use the compiler being built rather than an installed release. Amp-Thread-ID: https://ampcode.com/threads/T-01a16fb0-c28b-735f-9d66-ed30ae50404e Co-authored-by: Eli <elisha.dukes@gmail.com>
Use the platform exporter to register development hot-reload and cleanup hooks while retaining the named Elm export. Cover state-preserving reloads in development and debug modes and the optimized export contract through the current CLI. Co-authored-by: Eli <elisha.dukes@gmail.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a16fb0-c28b-735f-9d66-ed30ae50404e
Reject explicit HTML targets and the single-main default with guidance to select JavaScript output. Cover all build modes and preserve classic HTML, ESM JavaScript, multiple-main defaults, and no-output compilation. Co-authored-by: Eli <elisha.dukes@gmail.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a16fb0-c28b-735f-9d66-ed30ae50404e
Member
|
Thanks @lishaduck |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I figured that seeing as Lamdera 1.5.0 was eminent, I might as well toss some tokens at the human-written #78 to make sure I didn't miss some edge cases before it's released.
As it turns out, although I did check that it ran with the hot-reloading code, I didn't check that hot-reloading actually works. We now add back the scopes that were removed in the esm code paths but are now relevant to hot-reloading; as a bonus, the code is simpler and IMO easier to grok.
I also forgot about html output, which is now incompatible with --esm (it was non-trivial to add, and I don't think there's actually any use to doing so; if it's in the html you can't
importit anyway).While we're there, adds some more tests too.
I've read every line of the diff, I understand it, and I stand by it.1 The thread is public if that provides more (or less—it's good to know if I'm just slopping everywhere) confidence.
Footnotes
With the exception of the cabal change which seemed correct but I'll admit I'm not familiar enough with it to know if there's a better way, hence it's its own commit for easy reversion if needed. ↩