Skip to content

drop Legacy API #2110

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

Merged
merged 18 commits into from
Feb 16, 2025
Merged

drop Legacy API #2110

merged 18 commits into from
Feb 16, 2025

Conversation

babu-ch
Copy link
Contributor

@babu-ch babu-ch commented Feb 14, 2025

closes #2100

Is there any problem with this understanding of drop legacyAPI?

May still need to revise about JSDOC and Type

Copy link

Size Report

Bundles

File Size Gzip Brotli
core.esm-browser.prod.js 37.16 kB 11.35 kB 10.12 kB
core.global.prod.js 30.50 kB 10.55 kB 9.52 kB
core.prod.cjs 0.88 kB 0.43 kB 0.34 kB
core.runtime.esm-browser.prod.js 22.87 kB 7.45 kB 6.65 kB
core.runtime.global.prod.js 17.48 kB 6.81 kB 6.12 kB
message-compiler.esm-browser.prod.js 19.28 kB 5.76 kB 5.14 kB
message-compiler.global.prod.js 17.32 kB 5.54 kB 4.97 kB
message-compiler.prod.cjs 57.50 kB 10.06 kB 8.60 kB
petite-vue-i18n-core.esm-browser.prod.js 20.13 kB (-0.22 kB) 6.76 kB (-0.08 kB) 6.08 kB (-0.07 kB)
petite-vue-i18n-core.global.prod.js 15.40 kB (-0.22 kB) 5.96 kB (-0.09 kB) 5.40 kB (-0.07 kB)
petite-vue-i18n-core.prod.cjs 25.39 kB (-0.57 kB) 5.95 kB (-0.19 kB) 5.16 kB (-0.15 kB)
petite-vue-i18n.esm-browser.prod.js 36.62 kB (-0.22 kB) 11.24 kB (-0.09 kB) 10.09 kB (-0.05 kB)
petite-vue-i18n.global.prod.js 29.63 kB (-0.22 kB) 10.09 kB (-0.09 kB) 9.12 kB (-0.07 kB)
petite-vue-i18n.prod.cjs 25.07 kB (-0.57 kB) 5.86 kB (-0.19 kB) 5.09 kB (-0.15 kB)
petite-vue-i18n.runtime.esm-browser.prod.js 22.19 kB (-0.22 kB) 7.23 kB (-0.08 kB) 6.53 kB (-0.06 kB)
petite-vue-i18n.runtime.global.prod.js 16.63 kB (-0.22 kB) 6.32 kB (-0.09 kB) 5.73 kB (-0.07 kB)
vue-i18n.esm-browser.prod.js 50.23 kB (-6.19 kB) 15.02 kB (-1.40 kB) 13.44 kB (-1.25 kB)
vue-i18n.global.prod.js 40.28 kB (-5.77 kB) 13.49 kB (-1.38 kB) 12.15 kB (-1.22 kB)
vue-i18n.prod.cjs 0.72 kB 0.34 kB 0.28 kB
vue-i18n.runtime.esm-browser.prod.js 35.80 kB (-6.19 kB) 11.03 kB (-1.41 kB) 9.92 kB (-1.29 kB)
vue-i18n.runtime.global.prod.js 27.26 kB (-5.77 kB) 9.76 kB (-1.37 kB) 8.83 kB (-1.21 kB)

Usages

Name Size Gzip Brotli
packages/size-check-core (@intlify/core) 9.10 kB 3.76 kB 3.41 kB
packages/size-check-petite-vue-i18n (petite-vue-i18n) 77.58 kB (-0.23 kB) 30.23 kB (-0.10 kB) 27.24 kB (-0.04 kB)
packages/size-check-vue-i18n (vue-i18n) 82.59 kB (-0.23 kB) 31.65 kB (-0.09 kB) 28.44 kB (-0.07 kB)

Copy link

pkg-pr-new bot commented Feb 14, 2025

Open in Stackblitz

@intlify/core

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

@intlify/core-base

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

@intlify/devtools-types

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

@intlify/message-compiler

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

petite-vue-i18n

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

@intlify/shared

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

vue-i18n

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

@intlify/vue-i18n-core

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

commit: cd0c762

@kazupon kazupon added the Type: Breaking Includes backwards-incompatible fixes label Feb 14, 2025
: GeneratedInstanceType extends true
? VueI18n
: ExportedGlobalComposer
export type VueI18nInstance = ExportedGlobalComposer
Copy link
Member

Choose a reason for hiding this comment

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

@BobbieGoede
I think this change will be affected nuxt-i18n.
Can you check whether this change is okay with nuxt-i18n? 🙏

Copy link
Member

Choose a reason for hiding this comment

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

Since these changes are for the next major of vue-i18n removing it should be fine!

We're actually still not yet (functionally) making use of the conditional type in nuxt-i18n v9 (uses vue-i18n v10), but we will in nuxt-i18n v10 (with vue-i18n v11).

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for quickly comment! 💚
Okay, We'll go on as we are!

// @ts-ignore
expect(messages.en.mainMenu.buttonStart).toEqual('Start!')
})

test('composition mode', () => {
Copy link
Member

Choose a reason for hiding this comment

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

By the legacy API dropping, users no longer need to be aware of the composition API. Let's roll up this test case into createI18n with flat json messages and simplify it!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your review!
Is there any problem with this kind of understanding?
cd0c762?w=1

Copy link
Member

Choose a reason for hiding this comment

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

Yeah! That's right! 💯
Thanks!

await nextTick()
expect(html()).toMatchSnapshot('en')
})

test('composable', async () => {
Copy link
Member

Choose a reason for hiding this comment

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

same as https://github.com/intlify/vue-i18n/pull/2110/files#r1956294943
Let's try to roll up to test case, if it's possible to do.

Copy link
Member

@kazupon kazupon left a comment

Choose a reason for hiding this comment

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

Thank you so much!
Your contribution is so outstanding!

I've just reviewed your PR!
I've put some comments.
Please check it out!

@kazupon
Copy link
Member

kazupon commented Feb 14, 2025

May still need to revise about JSDOC and Type

FYI:
About jsdoc (tsdoc), I'm going to refine API docs near soon.
related issue
#2102

@babu-ch babu-ch requested a review from kazupon February 15, 2025 01:54
Copy link
Member

@kazupon kazupon left a comment

Choose a reason for hiding this comment

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

Well done!
Thank you ❤️ !

@kazupon kazupon merged commit f350103 into intlify:master Feb 16, 2025
28 checks passed
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.

drop Legacy API
3 participants