Closed pzingg closed 7 years ago
I refactored things in commit 6471019 to remove all the copying. See if it works for you.
I used elm-make --warn to generate the type annotations for the "Impl" functions that were not annotated in 6471019, so 3cd56fc now is fully annotated.
@rgrempel please, accept this PR!
This is impressive -- I had started on updating for Elm 0.18, but not gotten this far. Thanks!
I expect it will take me a few days to review all of this.
I enjoyed using your package as a learning tool. i also dissected things and put them back another way--it's not as slick an encapsulation, but ends up exposing what is going on under the hood a little more. You can see that approach here: http://package.elm-lang.org/packages/pzingg/elm-navigation-extra/latest
It's probably more error-prone to someone forgetting to make certain "router" calls, but it doesn't add that much complexity to a stock Navigation.program
.
How do I go about using the @pzingg repository until this (or something else) is merged?
Thanks again for your work on this!
I've pretty much got my additional changes ready to go on #22 -- I'll take one more look through that tomorrow and then hopefully publish the new version.
@pzingg @rgrempel great work.
Has it been published yet?
I got caught up in other things -- hopefully tomorrow.
Now published as version 3.0.
I gave myself an exercise to update your package to Elm 0.18. I'm somewhat of an Elm newbie so I just could not get the "withFlags" and "withoutFlags" variants to compile following the way you extended AppWithFlags in your Elm 0.17 version. So you will see a lot of duplication of code.
The 5ef8746 commit actually compiled without all the unnecessary copying, but when I tried to run the examples in elm-reactor, I got this curious run-time message:
"Are you trying to sneak a Never value into Elm? Trickster! It looks like Main.main is defined with
programWithFlags
but has typeProgram Never
."I guess because it doesn't the underlying program having flags, but being called as Program Never.
I also did a bit of copying in the examples, because the Elm 0.18 version of Http doesn't include the url method anymore. I grabbed the code from Elm 0.17 and put it inline in Examples 5, 6, and 7, renaming the method urlWithArgs.