New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make a Router #4
Comments
Are you basically looking for a port of Vue's router? |
Thanks for the links. I'm not really sure yet what the right approach is. The Vue router is pretty cool but there are things that I "feel I should be able to do" with it that are not simple. For example, if I'm making some big screen with various controls in it, it would be really handy to be able to just "bind" the query parameters (or perhaps something in the path too?) directly to the data in my component. The rough pseudocode would be like:
And this would result in I'm not aware of a way to do this with the Vue router. But it's functionality that I've often wanted. I'd like to figure out a design that solves it (without precluding other cases that Vue's router does solve well). This is something I will give more thought to over the coming days and then prototype. Suggestions welcome. Some more random thoughts, just so I don't forget: "Browser" seems like an interface to me, with a "BrowseTo" method or some such. Likewise, the difference between encoding data into the query string or into the fragment could be two different router implementations. Figuring out how to effectively use the Go type system will be important here, otherwise the result will be one giant struct with a bunch of random options on it and will be hard to reason about and maintain. The functionality show in the code snippet above could be described by a "Binder" interface, possibly. |
Vugu Router works reasonably well now: https://www.vugu.org/doc/routing |
There's a lot of functionality that is only feasible with a "router", although we need to define what that means.
Examples of things that need to work:
Needs some careful thought on the design and maybe a prototype or two. Likely a separate package.
The text was updated successfully, but these errors were encountered: