fix: sort routes in a better way to resolve it well #446
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #445
This change I have fixed the order of the routes so that the symbols appear at the end. When it compares it compares it by order, so the dynamic routes it looks at them later and prioritizes first the exact ones.
After this change, there is a little breaking change (rare case), if you had 2 web components with the same name but in different folders, now it prioritizes the name without folder:
/web-components/web-component.js
/web-components/web/component.js
Now to do
<web-component />
would go to the first one, while before it was the second one.Of course this is a case to avoid and a warning is issued when there are web components with the same selector. That is why it is a rare breaking change.