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: custom paths pages config should use route name as key #3286

Conversation

BobbieGoede
Copy link
Collaborator

@BobbieGoede BobbieGoede commented Dec 27, 2024

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to 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 with experimental.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

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

@BobbieGoede BobbieGoede self-assigned this Dec 27, 2024
@BobbieGoede BobbieGoede changed the title [DRAFT] fix: custom paths pages config should use route name as key fix: custom paths pages config should use route name as key Dec 27, 2024
@BobbieGoede BobbieGoede requested review from kazupon and removed request for kazupon December 27, 2024 18:17
@BobbieGoede BobbieGoede marked this pull request as ready for review December 28, 2024 09:10
@BobbieGoede BobbieGoede merged commit 3ba779c into nuxt-modules:main Dec 28, 2024
8 checks passed
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.

Nested route path was not translated
1 participant