elm-upgrade icon indicating copy to clipboard operation
elm-upgrade copied to clipboard

elm-upgrade checklist additions (elm/json, elm/url, elm/browser)

Open mordrax opened this issue 7 years ago • 2 comments

  • Json.Encode.list takes care of mapping ( a -> Value ) now eg List.map toValue |> Json.Encode.list -> Json.Encode.list toValue

  • Navigation.newUrl -> Browser.Navigation.pushUrl

  • jweir/elm-iso8601 now converts between Posix (elm/time) and ISO8601: https://package.elm-lang.org/packages/jweir/elm-iso8601/latest/ISO8601#toPosix

  • rm -rf elm-stuff is a very reasonable solution to common elm: not enough bytes issues due to compiler performance gains

  • UrlParser.custom -> Url.Parser.custom ( returns Maybe now instead of Result )

more to come as I work out Navigation: https://gist.github.com/mordrax/efcd34739ed56bb64d2b12d2401b7291

mordrax avatar Sep 04 '18 03:09 mordrax

  • As inline js and innerHTML is not longuer supported, it would be handy to have a warning about it. I don't know how feasible it would be to detect code doing it (href with javascript:? onxxx as attributes?) but displaying a warning when elm-upgrade runs would be a start. And mention web component as an upgrade path.
  • If the project has tests, remove the elm-package.json in the test folder and put dependencies in test-dependencies alongside elm-explirations/test.

kuon avatar Sep 05 '18 08:09 kuon

In my recent run, this import was not updated:

import UrlParser as Url exposing ((</>), Parser, parseHash, s, string)

My upgrade failed due to websocket dependency, so I haven't tested, but I think it ought to be:

import Url exposing ((</>), Parser, parseHash, s, string)

jhillyerd avatar Nov 04 '18 03:11 jhillyerd