Skip to content

Conversation

kazupon
Copy link
Member

@kazupon kazupon commented Dec 5, 2024

Reason

The advantage of v-t was that it could optimize performance using the vue compiler transform and the pre-translation of vue-i18n-extension.

This feature was supported from Vue 2.
About details see the blog article: https://medium.com/@kazu_pon/performance-optimization-of-vue-i18n-83099eb45c2d

In Vue 3, due to the Composition API, the pre-translation of vue-i18n-extension is now limited only for global scope.

In addition, Vue 3 Virtual DOM optimization has been introduced, and the optimization provided by vue-i18n-extension is no longer very effective. We need to require settings for SSR, the benefits of using v-t have disappeared. And DX of templates using v-t is not good. Custom directives do not work with key completion in editors (e.g. vscode).

For compatibility, v-t mode still works in v11, but will be removed entirely in v12, so v-t will not work after that version.

@kazupon kazupon added the Type: Breaking Includes backwards-incompatible fixes label Dec 5, 2024
@kazupon kazupon requested a review from BobbieGoede December 5, 2024 10:13
Copy link

cloudflare-workers-and-pages bot commented Dec 5, 2024

Deploying vue-i18n-next with  Cloudflare Pages  Cloudflare Pages

Latest commit: f57b836
Status: ✅  Deploy successful!
Preview URL: https://1eeee1f0.vue-i18n-next.pages.dev
Branch Preview URL: https://deprecate-v-t.vue-i18n-next.pages.dev

View logs

Copy link

pkg-pr-new bot commented Dec 5, 2024

Open in Stackblitz

@intlify/core

npm i https://pkg.pr.new/@intlify/core@2045

@intlify/devtools-types

npm i https://pkg.pr.new/@intlify/devtools-types@2045

@intlify/core-base

npm i https://pkg.pr.new/@intlify/core-base@2045

petite-vue-i18n

npm i https://pkg.pr.new/petite-vue-i18n@2045

@intlify/message-compiler

npm i https://pkg.pr.new/@intlify/message-compiler@2045

@intlify/shared

npm i https://pkg.pr.new/@intlify/shared@2045

vue-i18n

npm i https://pkg.pr.new/vue-i18n@2045

@intlify/vue-i18n-core

npm i https://pkg.pr.new/@intlify/vue-i18n-core@2045

commit: f57b836

Copy link
Member

@BobbieGoede BobbieGoede left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kazupon kazupon merged commit 959f271 into master Dec 6, 2024
26 checks passed
@kazupon kazupon deleted the deprecate/v-t branch December 6, 2024 05:34
@putianyi889
Copy link

In addition, Vue 3 Virtual DOM optimization has been introduced, and the optimization provided by vue-i18n-extension is no longer very effective. We need to require settings for SSR, the benefits of using v-t have disappeared.

Can you elaborate? What is the recommended choice then, in terms of performance? Is there an in-depth discussion of this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Breaking Includes backwards-incompatible fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants