rtfeldman / elm-workshop

An introductory Elm workshop. Video available on Frontend Masters!
https://frontendmasters.com/courses/elm/?u=ea0ec073ea98046a6a26ccd9a0adede4d5458676
Other
441 stars 173 forks source link

In part 7 of Frontend Masters course, 'elm-lang/core' references 5.0.0 api but video uses 4.0.0 api #16

Open EverybodyKurts opened 7 years ago

EverybodyKurts commented 7 years ago

In the Part 7 solution Frontend Masters Elm video @ the 3:00 minute mark, Mr. Feldman uses the 4.0.0 elm-lang/core api when writing the Task.perform function, which takes three arguments. Documentation can be found here.

However, the elm-lang/core dependency version referenced in elm-package.json is 5.0.0 <= v < 6.0.0. Here is the Task.perform documentation for version 5.1.1. It only takes two arguments.

I think the best course of action to simply roll back the elm-lang/core dependency to 4.0.0 and maybe leave 5.0.0 as an exercise left up to the reader once they feel comfortable with Elm. That's just my two cents though.

EverybodyKurts commented 7 years ago

After a bit more perusing, it seems elm-lang/core dependencies is tied to the elm-version. Is there such thing as a lock file for Elm that lists dependencies for each package?

richiekastl commented 7 years ago

@KurtRMueller I'm running into the same issue. I think I'm going to skip this exercise until I'm more comfortable with elm.

EverybodyKurts commented 7 years ago

What's interesting is that there's a lesson where Richard talks about semantic versioning. It seems like Elm going from 0.17 to 0.18 would indicate a minor version change and therefore its currently existing methods would keep the same api. Obviously, though, that's not the case :).

rtfeldman commented 7 years ago

Pre-1.0 Elm (the language) is currently versioned on "semver shifted by one digit" - in other words, 0.17.0 -> 0.18.0 is a breaking change, whereas 0.18.0 -> 0.18.1 would be a minor change.

Not much changed between 0.17 to 0.18 except for the Http library. Now the most common way people use it is with Http.send instead of Task.perform, and I thought it would be more useful to update the code sample to use the idiomatic 0.18 way (since it's only a few lines of code different) so people could see that. 🙂

I realize this means the code is out of sync with the slides in this section...sorry about that! I plan to do a refresher course with Frontend Masters sometime around early 2018, which will bring everything up to date!

nelsonic commented 6 years ago

anyone else "stuck" on this see: https://github.com/rtfeldman/elm-workshop/blob/solutions/part7/Main.elm for solution. 😉