Conversation
|
Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖 Please select which version do you want to release:
And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.
|
athoscouto
left a comment
There was a problem hiding this comment.
From what I could grasp, your algorithm is a little bit different from the ASP.NET one.
If two or more routes draw on the precedence, ASP.NET will count the number of matched parameters and use it to decide which route should match the URL.
This is where the witchcraft happens.
For example let the URL be /x/y/z be the URL, even though routes /*a/x/*b/ and /*a/y/*b have the same precedence, /*a/y/*b/ should be the one to match the URL, because *a would match some not empty subpath only on the second route.
Even though I'm stating it works like this, I'm really not confident on my C#, so I may be metendo os pés pelas mãos.
Another detail (here) is that when it cannot decide between two routes, it throws an error. This blog says that:
And that's it as we don't have any ties to break, but if a tie between two routes did exist, then a case-insensitive comparison of the route template names would resolve it.
But I haven't found anything on code that would back that up.
Other than this questions regarding the equivalency of the algorithms, there is one minor issue with the code.
thiagomurakami
left a comment
There was a problem hiding this comment.
Nice. It looks much simpler than before :D
LGTM
|
I think that jest was configured before test-tools was created 🤔
…On Sat, Jun 22, 2019, 15:42 Breno Calazans ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In react/package.json
<#328 (comment)>
:
> "typescript": "3.5.2"
+ },
+ "jest": {
Why not use https://github.com/vtex/test-tools? And follow the TS steps
https://github.com/vtex/test-tools/tree/master/examples/typescript
I feel attacked
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#328?email_source=notifications&email_token=ACPLEVDALTCETWOXAROSUZTP3ZXBRA5CNFSM4H2VIL22YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB4LBBFA#pullrequestreview-253104276>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACPLEVFWVDJAI63QWMUBK53P3ZXBRANCNFSM4H2VIL2Q>
.
|
1f11506 to
1fce2b5
Compare
|
@athoscouto you're right. The new algorithm doesn't perfect match the server-side one. I created this issue #330 For now this PR will fix some navigation bugs we are experiencing but we can come back to this issue later. |
This character is nothing special and can be anything.
1fce2b5 to
c65eb12
Compare
|
Your PR has been merged! App is being published. 🚀 |
This PR makes our routing precedence algorithm work like the server-side one, implemented in C#
It fixes inconsistencies between client-side and server-side navigation.
The new implementation is based on this code: https://github.com/aspnet/AspNetWebStack/blob/master/src/Common/Routing/RoutePrecedence.cs