gabrielmoreira / riot-router

Riot Router - A simple routing solution for Riot
MIT License
77 stars 13 forks source link

breaks on riot 3 #29

Open mikey0000 opened 7 years ago

mikey0000 commented 7 years ago

riot-route is now a seperate module.

blub0hr commented 7 years ago

I forked and updated the router to work with riot 3. It's a breaking change tho. Check out https://github.com/blub0hr/riot-router

I am up to create a pull request but not sure about the breaking changes yet.

gabrielmoreira commented 7 years ago

Hi @blub0hr ! Thank you for your work.

I'm also trying to make compatible. I'm having some difficulties with the tests, but I believe this change will allow you to use the riot-router with riot 2 and riot 3. I need to test it better to be sure. If it does not work, I'll only be compatible with riot-3.

If you want to take a look, see also in this branch: https://github.com/gabrielmoreira/riot-router/tree/riot3

stukennedy commented 7 years ago

how is this coming along? I'm currently refactoring for a Riot2 -> Riot3 upgrade and have had to write my own router. Getting some issues, so it'd be great if I could use your new one in our project ... how ready is it?

gabrielmoreira commented 7 years ago

@continuata @blub0hr

I've released version 0.9.x with support for Riot 3. I'm using this version in a project that will be put into production, and for now I had no problems.

I had to adjust some things. The router is now accessible in the window.router variable, and has a direct dependency on the riot-route. https://unpkg.com/riot-router@0.9/dist/router.min.js

If you prefer, you can use the router.core, which has no dependency on riot-route. https://unpkg.com/riot-router@0.9/dist/router.core.min.js

var router = window.router = Router.create({ route: require ('riot-route') });

Unfortunately I did not have time to do good documentation, and update the page.

blub0hr commented 7 years ago

Thanks a lot. I'll be using it in production as well soonish.