Closed BobbieGoede closed 2 months ago
Since it uses the vue-router type, it would be good if posva is able to review it.
@posva Can you review it ?, if you have the time π
@userquin
If you see some obvious structural improvements, feel free to suggest them, the must be some way to leave out the augmentations in internal-global-types.d.ts
π€
π Linked issue
2813
2976
β Type of change
π Description
I'm not very happy with the implementation right now, but it does work... I think the demand/convenience of this feature somewhat justifies adding this albeit under an experimental flag.
We should communicate very clearly that this relies on internals of Nuxt, Vue Router and
unplugin-vue-router
, perhaps we can make the types fallback to original behavior on failure (maybe it already does). A proper implementation will likely require collaboration with the maintainers of those packages, we should not expect this to keep working as is.This will need some documentation and basic tests so we know things fail if internals have changed.
Demo stackblitz project here: https://stackblitz.com/edit/bobbiegoede-nuxt-i18n-starter-srohiz?file=nuxt.config.ts&file=composables%2Ftest.ts
Demo of
localePath
autocompletionhttps://github.com/user-attachments/assets/29d00cb6-1cdc-409f-bb23-fa08153d4a4e
Demo of custom routes configuration autocompletion and basic validation (prefix
'/'
)https://github.com/user-attachments/assets/38c41d9d-deb7-4688-be02-1ce0c18a9628
π Checklist