i18next / i18next-vue

Internationalization for Vue 2 & 3 using the i18next ecosystem
https://i18next.github.io/i18next-vue/
MIT License
74 stars 8 forks source link

Fix typescript module augmentation #22

Closed FlorianBruckner closed 1 month ago

FlorianBruckner commented 1 month ago

This PR fixes a type declaration issue with vue.

The package augments the ComponentCustomProperties type to include declarations for $t and $i18next. The current release does this by augmenting the module @vue/runtime-core

This conflicts with augmentation for the module "vue" - only one of the augmented modules will be effective, and the recommended module is "vue". Other packages have made that transition (e.g. vue-router), leading to typescript issues.

To allow this package to be included as a git dependency in a project, a "prepare" task has been added to package.json. While not strictly related to the issue with module augmentations, this allows us to use the updated module from our fork without having to publish a package.

Checklist

Checklist (for documentation change)

kkuegler commented 1 month ago

Thanks for the PR!

Looking at https://github.com/vuejs/router/pull/2295 and the PRs referencing that, this is really about consistency across all libraries. For existing (working) setups this looks like a potentially breaking change.

Thus, I released this as a new major release 5.0.