-
Notifications
You must be signed in to change notification settings - Fork 13
Ideas #6
Comments
@guilhermeaiolfi Thanks - I won't pretend to understand all of it from an initial reading of the code, but I'm relieved to know that other people have had similar problems. Makes me feel like I'm not crazy. I opted to focus on the simple a <-> b transition rather than maintaining a full state history because it seemed like an unsolved problem that was small enough to tackle ( |
This project has some nice ideas: https://github.com/erikringsmuth/app-router |
"Maybe I've fundamentally misunderstood the problem. If someone can point me to a decent router that solves these issues, let me know so that I can stop working on this one." Did you change your mind? Find something better? Or is this still something you're using? |
Still using it. All the other routers these days seem to be view-layer-specific. I'd rather have something that's less coupled to the rest of my stack and lets me be imperative when I want to be imperative. There's certainly more sophisticated options out there but I've never had whatever problems they're trying to solve |
Word. I'm going to start using it. Maybe I'll become a contributor. ;) |
Just started using roadtrip this week after I saw it recommended by the Page.js maintainers. I was planning on building something similar and custom for this project, but roadtrip has handled my use-case so closely and so smoothly that it is almost spooky. Exactly what I need for this project and so many projects in the past (and almost certainly the future). Fantastic work @Rich-Harris |
Thanks! That's great to hear |
Sometime ago I started working in a router that could do what you're trying to do with roadtrip. It started as an ember project and it was so difficult to replace the ember router (eventually I did succeed) that I started looking how that would work for other libraries and that's the main reason I'm using ractive in my projects now.
For my router I created a transition object that would hold all the info about the transition and its state. So you could get the next route, previous route, first, last, etc. And do stuff to them like rewind, reset, next.
Since you have control over the transition object, it can do async (for example, load code in one route and resume the transition when the code finish loading) or some other crazy stuff. You can see it here: https://github.com/guilhermeaiolfi/ember-craziness/blob/master/lib/routing/router.js
The whole thing is just ~300 LOC. To be honest, it is just an abstraction on top of https://github.com/tildeio/route-recognizer. But it worked.
Maybe it won't help you. Maybe it will. I thought I would mention because I'm very interested in something like that. I've tried all routers and was very disappointed.
The text was updated successfully, but these errors were encountered: