fix: custom paths pages
config should use route name as key
#3286
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.
🔗 Linked issue
❓ Type of change
📚 Description
Resolves #3185
It appears the documentation is incorrect and has likely been so since v9, at the moment custom paths configuration using the
pages
property only supports using route paths (without leading/
) as keys, this is especially problematic since the generated types withexperimental.typedPages
will give type completion for route names as keys...This PR resolves this by supporting both paths and names as keys, and I am planning to deprecate the path keys in the next major version. I'm not 100% sure if this has potential to collide with existing path configurations, but I haven't found scenarios in which that would be possible, if there are we may need to make this change configurable (opt-in), but supporting both would mean the existing documentation would be correct again.
📝 Checklist