Skip to content

Conversation

@IncognitaDev
Copy link
Contributor

@IncognitaDev IncognitaDev commented Apr 10, 2025

What is this Contribution About?

This PR fixes the URLPattern build to handle optional paths

https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API#group_delimiters

the old way scapes the group delimiters and read all '?' tokens as a search params, make the optional paths like: /requiredPath{/optionalPath}? or /{optinalPath/}?requiredPath} not able to work once the {} are encoded and ? read as a search param.

This new way handle both, optional paths and search params

This PR also fix the paths ranking for optional paths

before this PR the ranking for optional paths were:

...
/path/path
/path
/{optionalPath/}?*
/ 
...

after:

...
/path/path
/path
/ 
/{optionalPath/}?* 
...

https://www.loom.com/share/a51b17205b8f4100ab0280a215503cb7?sid=d6192642-5c85-4578-a1ea-990eb8ef496f

This PR Depends on this PR: deco#898

@github-actions
Copy link
Contributor

Tagging Options

Should a new tag be published when this PR is merged?

  • 👍 for Patch 0.70.1 update
  • 🎉 for Minor 0.71.0 update
  • 🚀 for Major 1.0.0 update

@IncognitaDev
Copy link
Contributor Author

without the PR on deco we have a crash on render when used both, optional path and search param

@IncognitaDev IncognitaDev merged commit ce27591 into main Apr 17, 2025
1 check passed
@IncognitaDev IncognitaDev deleted the optional-paths branch April 17, 2025 13:24
guitavano added a commit that referenced this pull request Apr 23, 2025
guitavano added a commit that referenced this pull request Apr 23, 2025
@IncognitaDev IncognitaDev mentioned this pull request Apr 29, 2025
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.

4 participants