You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Y.Router#route() only accepts a string or regex path as its first argument, it then processes that into a route config object. It would also be useful if Router accepted an already processed route config object provided by the caller.
To coordinate routes between the server (like Express) and client, it's important to make sure subtle things like whether to use optional trailing slashes are preserved. The best way to do this is to provide Y.Router with the same regex path that's used server side. The problem in doing so is when a regex path is used, you have to use unnamed params in route handlers. Allowing the following would resolve this issue:
This adds support to Router to accept fully-processed route objects.
This is useful when passing one route's routes to another router, and
for accepting route config objects generated by the server and applying
them to a Y.Router instance on the client.
Closesyui#1067
Currently,
Y.Router#route()
only accepts a string or regexpath
as its first argument, it then processes that into a route config object. It would also be useful if Router accepted an already processed route config object provided by the caller.To coordinate routes between the server (like Express) and client, it's important to make sure subtle things like whether to use optional trailing slashes are preserved. The best way to do this is to provide
Y.Router
with the same regex path that's used server side. The problem in doing so is when a regex path is used, you have to use unnamed params in route handlers. Allowing the following would resolve this issue:This would allow
keys
to be supplied with theregexp
, giving the route handlers named params.The text was updated successfully, but these errors were encountered: