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

Update to Elm 0.18 #51

Merged
merged 13 commits into from
May 1, 2017
Merged

Update to Elm 0.18 #51

merged 13 commits into from
May 1, 2017

Conversation

ThomasWeiser
Copy link
Contributor

See Evan's upgrading guide.

Most changes will be mechanically ones.
Http API changed, will have to adapt.
Also have to wait for our dependencies to be updated.

@oliverbarnes oliverbarnes added this to the 0.0.1 milestone Nov 22, 2016
@oliverbarnes
Copy link
Collaborator

Looks like navigation will have to adapt too:

elm-lang/navigation no longer has its own concept of a Parser. You just turn a Navigation.Location into a message and it is fed into your normal update function. This means Navigation.program is now much closer to Html.program so this should simplify things a bit.

@ThomasWeiser
Copy link
Contributor Author

ThomasWeiser commented Nov 27, 2016

Update status of dependencies:

  • debois/elm-mdl (8.0.0 Release notes)
  • elm-community/result-extra
  • elm-lang/core
  • elm-lang/html
  • elm-lang/navigation
  • etaque/elm-simple-form (renamed to etaque/elm-form)
  • evancz/elm-http (moved to elm-lang/http)
  • evancz/url-parser
  • noahzgordon/elm-jsonapi
  • sporto/erl
  • sporto/hop (may be dropped according to sporto)

@ThomasWeiser
Copy link
Contributor Author

With the release of elm-mdl 8.x we are ready to update to Elm 0.18.

Will wait for #56 being merged.

@oliverbarnes oliverbarnes removed this from the 0.0.1 milestone Feb 21, 2017
@oliverbarnes
Copy link
Collaborator

Removing from the 0.0.1 milestone. Thought it's low hanging fruit, let's do it right after we're done with 0.0.1

@oliverbarnes oliverbarnes added this to the 0.0.1 milestone Apr 22, 2017
@ThomasWeiser ThomasWeiser changed the title Update to Elm 0.18 [WIP] Update to Elm 0.18 Apr 25, 2017
- No more primes in variable names
- Arguments flipped for `andThen`
- Changes in core library functions, modules `Json.Decode` and `Task`
- No more Html.App
We also now use lukewestby/elm-http-builder to replace our own helper
functions here.
Implementation currently won't support any non-empty basePath.
May be added back again later if needed.
The standard functions of elm-lang/http and lukewestby/elm-http-builder
to add a JSON body automatically set 'Content-Type: application/json' in
the header, which is not conforming to JSON API.
http://jsonapi.org/format/#introduction
The need for this change comes with elm-lang/http, as a naive `toString`
approach may result in very long text here.

Also don't save the httpError in the model. We don't need it.
@ThomasWeiser ThomasWeiser changed the title [WIP] Update to Elm 0.18 Update to Elm 0.18 Apr 26, 2017
@ThomasWeiser
Copy link
Contributor Author

Should be working now. @oliverbarnes please review.

Some notes about the migration:

  • Source is a little bit smaller (-21 lines) and a quite bit clearer now.
  • Reimplemented most of routing (bigger changes in elm-lang/navigation; no more need for sporto/hop). IMHO code got easier to understand.
  • Also some bigger changes as a result of new elm-lang/http. Pulled in lukewestby/elm-http-builder and could drop some own helper functions.
  • Good Elm experience again: The compiler with its type checking guides reliably and helpfully thru refactorizations like this one. It provides great confidence in the correctness of the changed code.

Copy link
Collaborator

@oliverbarnes oliverbarnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌 looks great, code is easier to understand indeed. thanks!

@oliverbarnes oliverbarnes merged commit 5d4790e into master May 1, 2017
@oliverbarnes oliverbarnes deleted the 51-elm-0.18 branch May 1, 2017 17:50
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.

2 participants