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
This pattern has worked in versions 0.2.15 and lower.. but #1585 added a Array.prototype.sort to the route rules. The sort algorithm implemented in Chrome is not stable (https://bugs.chromium.org/p/v8/issues/detail?id=90).. so if you have a lot of routes defined in your application, then routes with the same prefix end up getting put into a somewhat random order.
I have added a link to 2 code pens which show this issue. You can view them in debug mode to see the URLs. You can notice the issue when you click the hij.step.1 button after loading the pen.. it will take you to step 3 in Chrome. Also, in debug mode if you add #/hij to the URL, it will take you to step 3 by default in Chrome.
I think sorting rules by prefix length to avoid clashes is appropriate, but I think we should ensure a stable sort so that the first rule that matches is the first rule that is defined in the application.
The text was updated successfully, but these errors were encountered:
I have a routing use case where I have nested/wizard states that must keep the same URL.
For example:
/something/create
I was able to do this by defining the following states (Also, I'm very open to better solutions for this use case):
This pattern has worked in versions 0.2.15 and lower.. but #1585 added a
Array.prototype.sort
to the route rules. The sort algorithm implemented in Chrome is not stable (https://bugs.chromium.org/p/v8/issues/detail?id=90).. so if you have a lot of routes defined in your application, then routes with the same prefix end up getting put into a somewhat random order.I have added a link to 2 code pens which show this issue. You can view them in debug mode to see the URLs. You can notice the issue when you click the
hij.step.1
button after loading the pen.. it will take you to step 3 in Chrome. Also, in debug mode if you add#/hij
to the URL, it will take you to step 3 by default in Chrome.v0.2.16: http://codepen.io/cdriscol/pen/adGBoX
v0.2.15: http://codepen.io/cdriscol/pen/bEKoXL
I think sorting rules by prefix length to avoid clashes is appropriate, but I think we should ensure a stable sort so that the first rule that matches is the first rule that is defined in the application.
The text was updated successfully, but these errors were encountered: