Skip to content
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

fix: sort routes in a better way to resolve it well #446

Merged
merged 2 commits into from
Aug 30, 2024

Conversation

aralroca
Copy link
Collaborator

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:

  1. /web-components/web-component.js
  2. /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.

@aralroca aralroca self-assigned this Aug 30, 2024
@aralroca aralroca merged commit 617a6d8 into main Aug 30, 2024
0 of 3 checks passed
@aralroca aralroca deleted the aralroca/fix-routes branch August 30, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong route resolution
1 participant