A 0.19 Update Experience Report

I just completed updating my photo album app to 0.19! :slight_smile:

I kept all my incremental work in small commits on a branch in case anyone’s curious to look them over individually. But mainly I wanted to share my summary that I wrote in the merge commit.

I’m more than happy to expand on any of these points if folks are curious about the details!

elm-upgrade reported several incompatible dependencies. most have
since updated to 0.19 and are used in the usual way. two have not yet
completed the update (touch-events and elm-route-url); their
0.19-compatible branches are included here as git submodules, until
they’re released.

the new scroll api oddly uses floats instead of ints, even though it’s
measuring pixels.

the new parser api was tricky to get right, as its documentation
relies a lot on examples that don’t align with what we need to do
here.

elm-route-url does seem to still be necessary: Browser.application
still has a “double-update problem”.

the only use of a port, for setting the page title, goes away with
Browser.Document.

the JS api for loading the app changed in two ways: the name of the
function to call is different (which is documented), and the format of
the JSON object to pass in flags is different (which is not [well]
documented).

even with elm-route-url, we still need to take care not to produce
different intermediate URLs when reacting to the back button &
restoring scroll position, otherwise extra history entries are created
and back doesn’t behave as expected.

DebugSupport seems to be a good strategy for allowing debugging hooks
to remain in the code but be “turned off” in one central place so that
–optimize can be used.

determination of what’s an internal vs. external link can be
surprising (depends on whether the presumed-external link points
somewhere on the same domain), and since the home link is dif’t in
testing environments, it was hard to debug.

nix expressions have been made to work with 0.19 by reusing some of
the plumbing that was initially developed for building elm 0.19
itself.

[Update: the Understanding the “double update” behavior of Browser.application thread has more discussion on that point.]

Thanks to everyone who worked on 0.19!

8 Likes

Thank you for the submodule idea and adding those to source-directories in elm.json

That should enable me to update without bugging package maintainers :slight_smile:

2 Likes

You might find elm-pointer-events useful

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.