# How to upgrade from the 0.18 'Navigation' to the 0.19 'Browser'?

**URL:** <https://discourse.elm-lang.org/t/how-to-upgrade-from-the-0-18-navigation-to-the-0-19-browser/1866>\
**Category:** Learn\
**Created:** [September 2, 2018, 7:41pm UTC](https://discourse.elm-lang.org/t/how-to-upgrade-from-the-0-18-navigation-to-the-0-19-browser/1866 "2018-09-02T19:41:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qqwy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/qqwy/32/1062_2.png) [@Qqwy](https://discourse.elm-lang.org/u/Qqwy)\
**Post date:** [September 2, 2018, 7:41pm UTC](https://discourse.elm-lang.org/t/how-to-upgrade-from-the-0-18-navigation-to-the-0-19-browser/1866/1 "2018-09-02T19:41:03Z")

</div>

In Elm 0.18, we have the `elm-lang/navigation` package.  
In my current Elm-app, I’ve used the setup explained in [elm-navigation-example](https://github.com/sircharleswatson/elm-navigation-example) to use the Navigation package to handle routing.

However, upgrading this to the 0.19 approach is not straightforward, so now I have some questions:

- The `Navigation.Location` type is gone, what to use instead? Browser has both `Key` and `UrlRequest`, so I don’t think there is a 1:1 mapping.
- I used to parse the URL using the `UrlParser` that the package exposed, but this module no longer exists. What to use instead?
- Before, my `Main.main` implementation was a `Navigation.program`. Do I now use `Browser.application` or something else?

Help is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![hkgumbs](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/hkgumbs/32/1251_2.png) [@hkgumbs](https://discourse.elm-lang.org/u/hkgumbs)\
**Post date:** [September 2, 2018, 10:18pm UTC](https://discourse.elm-lang.org/t/how-to-upgrade-from-the-0-18-navigation-to-the-0-19-browser/1866/2 "2018-09-02T22:18:34Z")

</div>

These pages on the new guide cover these exact topics:  
[https://guide.elm-lang.org/webapps/navigation.html](https://guide.elm-lang.org/webapps/navigation.html)  
[https://guide.elm-lang.org/webapps/url\_parsing.html](https://guide.elm-lang.org/webapps/url_parsing.html)

---

<div class="post-metadata">

**Author:** ![Sebastian](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/sebastian/32/98_2.png) [@Sebastian](https://discourse.elm-lang.org/u/Sebastian)\
**Post date:** [September 3, 2018, 2:46am UTC](https://discourse.elm-lang.org/t/how-to-upgrade-from-the-0-18-navigation-to-the-0-19-browser/1866/3 "2018-09-03T02:46:03Z")

</div>

> [@Qqwy](#):
>
> - The `Navigation.Location` type is gone, what to use instead? Browser has both `Key` and `UrlRequest` , so I don’t think there is a 1:1 mapping.

This is now Url.Url from [url 1.0.0](https://package.elm-lang.org/packages/elm/url/latest/)

> [@](#):
>
> - I used to parse the URL using the `UrlParser` that the package exposed, but this module no longer exists. What to use instead?

Url.Parser [Url.Parser - url 1.0.0](https://package.elm-lang.org/packages/elm/url/latest/Url-Parser)

> [@](#):
>
> - Before, my `Main.main` implementation was a `Navigation.program` . Do I now use `Browser.application` or something else?

Yes, Browser.application.

Here is an small example app [GitHub - sporto/elm-example-app: An example Elm single page application](https://github.com/sporto/elm-tutorial-app)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [September 13, 2018, 2:46am UTC](https://discourse.elm-lang.org/t/how-to-upgrade-from-the-0-18-navigation-to-the-0-19-browser/1866/4 "2018-09-13T02:46:04Z")

</div>

Closed on September 13, 2018, 2:46am UTC

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