1.1.0
Note: If you use elm-watch together with run-pty, make sure to update run-pty to 4.0.2 or later!
New features
-
Added: An opt-in error overlay in the browser, with clickable error locations. When elm-watch’s browser UI shows “🚨 Compilation error”, click the UI to expand it and then click the “Show errors” button. That opens an overlay which shows the compilation errors. The overlay is visible until you close it again, or until you fix all errors. elm-watch remembers your choice to show errors in the browser per target, and opens the overlay again when there are new errors if you had previously opted to show it. Cool detail: The overlay uses the color theme from your terminal if possible! (That’s why run-pty needs to be updated – to support extracting the colors.)
-
Added: Buttons for moving the browser UI to another corner. If you’ve ever felt that the elm-watch browser UI was in the way, you can now move it. The position is remembered per target across page reloads.
-
Added: Support for running elm-watch in a Web Worker. Web Workers have no DOM, so you won’t get elm-watch’s browser UI. Instead, elm-watch gives you updates through browser console logs.
-
Added: Better support for HTTPS.
-
Added: You can now set the
ELM_WATCH_EXIT_ON_STDIN_END
environment variable (to any value) to have elm-watch end when stdin ends. This is useful to Phoenix users.
Improvements
- Improved: Elm can crash while printing JSON. If you run into such an Elm bug, elm-watch output is now easier to understand: It mentions that “Elm crashed” and shows Elm’s crash message, rather than text about the JSON unexpectedly being cut off.
- Improved: The error message for when window.Elm is undefined.
- Improved: Don’t expand the browser UI when a page reload is needed. That was pretty distracting.
- Changed: The WebSocket URL now uses
/elm-watch
as path, which helps people running elm-watch behind a proxy and need to do path matching to route to elm-watch and other origins. - Added: elm-watch now prints a message while it is shutting down, asking you to press ctrl+c (again) to close it more forcefully. Usually you won’t see it, but if you do it helps.
- Fixed: Catch syntax errors when hot reloading.
- Fixed: On the iPhone, if the phone locks while elm-watch is waiting for compilation to finish, the elm-watch browser UI used to be stuck in the “⏳ Waiting for compilation” state. Now, the browser UI should always update when coming back to the page.
- Fixed: Various edge cases around “elm.json related errors”.
- Fixed: If you accidentally run your dev server with HTTP caching, elm-watch no longer gets stuck in a reload loop and instead shows you a helpful error message.
- Fixed: If you rename a target after you have opened it in the browser, elm-watch no longer gets stuck in a weird state. elm-watch used to just complain about target names not matching up, and the only way to fix it was to remove the output JavaScript file. Now the error message tells you to reload the page, and once you do it starts working again with the new target name.
- Fixed:
../
in"source-directories"
in elm.json is now supported. Previously, elm-watch would never react to changes to files above elm.json.
(Note: If you installed the 1.1.0 beta versions – there are no changes since 1.1.0-beta.5, and the above is a summary of all changes since 1.0.2.)