Giter Club home page Giter Club logo

elm-route's People

Contributors

bogdanp avatar gdennie avatar gjaldon avatar nanoxd avatar prikhi avatar sabine avatar thomasweiser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elm-route's Issues

Composable routes

Hello,

Now I have something like this:

articleListR   = ArticleListPage   := "articles" <//> static ""
articleDetailR = ArticleDetilPage  := "articles" <//> int
articleCreateR = ArticleCreatePage := "articles" <//> static "create"
articleUpdateR = ArticleUpdatePage := "articles" <//> int <> "update"
articleDeleteR = ArticleDeletePage := "articles" <//> int <> "delete"

If I add users, groups etc. to my app, you can guess how it would look like. My Page type looks like this:

type Page
  = ArticleListPage ()
  | ArticleDetilPage Int
  | ArticleCreatePage ()
  | ArticleUpdatePage Int
  | ArticleDeletePage Int

And here the same story, this kind of flat sitemap is going to grow fast in real (big) application. I would like to define listR, detailR, createR, updateR and deleteR like this:

listR   = ListPage   := static ""
detailR = DetailPage := int
createR = CreatePage := static "create"
updateR = UpdatePage := int <> "update"
deleteR = DeletePage := int <> "delete"

and then reuse them. I would like to define one route for each submodule of my app like:

articleR = ArticlePages  := "articles"
userR    = UserPages     := "users"
groupR   = GroupPages    := "groups"

and the I would like to combine them as I need, for example:

route (articleR <//> listR) []   ==> "/articles/"
route (userR <//> updateR) [1]   ==> "/users/1/update/"

My new Page type would look something like this:

type BasicPage
  = ListPage ()
  | DetailPage Int
  | CreatePage ()
  | UpdatePage Int
  | DeletePage Int

type Page
  = ArticlePage BasicPage
  | UserPage BasicPage
  | GroupPage BasicPage

Is it possible to do something like this with current version? And if yes, then how?

Package not published to elm-community

I noticed with the repo change, the package itself isn't published to elm-community/elm-route. I'm new to the Elm community, will it be moved to the package namespace at some point? If so, I can make a pull request to update the readme ๐Ÿ˜„

Thanks for the project! It's been great to have this library to think about how to structure routes.

Wildcard paths or multiple paths resolving to the same route

I'm currently working on a multi lingual app where I have routes such as:

  • /en/about
  • /jp/about

I would like them to resolve to the same route: aboutR, or to have this route defined as a wildcard on the path /*/about.

Do you have any advice on this?

Thanks!

Define simple multi level static routes

Hi, I've been trying to create a route of en/about.

I tried this:

aboutEnR : Route Sitemap
aboutEnR =
    AboutEnR := static "en/about"

and:

aboutEnR : Route Sitemap
aboutEnR =
    AboutEnR := static "en" </> static "about"

Neither produce any output at that route, it is not realised. Could you point me to docs where something like this is defined, or let me know what I'm doing wrong. I see posts/<int> etc., but not this simple static case. Thanks

Problem in dependency Bogdanp/elm-route 3.0.2

Hi, I'm still fairly new to Elm so please excuse me if this is an issue my end, but when I try to use this package I get this compiler error on 0.17.1:

Error: Compiler process exited with error Compilation failed
Problem in dependency Bogdanp/elm-route 3.0.2

The elm-package.json constraints of 'Bogdanp/elm-route' are probably
letting too much stuff through. Definitely open an issue on the relevant github
repo to get this fixed and save other people from this pain.

In the meantime, take a look through the direct dependencies of the broken
package and see if any of them have had releases recently. If you find the new
thing that is causing problems, you can artificially constrain things by adding
some extra constraints to your elm-package.json as a stopgap measure.


Detected errors in 1 module.

Route vs. Routes vs. SiteMap confusion

Hello !

First of all nice job for this package ! ๐Ÿ‘

There is an error within the README.md where the example mix up Route the module with Route the type with SiteMap the undefined type. And the match function in Route vs. Routes modules in the end is confusing as well (Routes isn't defined anywhere as well). I don't know how you would rather named them so I didn't proposed a PR but these details bugged me for a while.

Thanks again for your great work !

Regards,

Camille

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.