Skip to content

Commit f350103

Browse files
authored
drop Legacy API (#2110)
* remove legacy source * fix test * update config * fix e2e * fix e2e * fix exports * fix others * remove mode * fix others * fix others * fix others * fix others * fix jsdoc * fix jsdoc * remove legacy examples * fix others * fix others * rollup test cases
1 parent d078097 commit f350103

File tree

139 files changed

+369
-6302
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+369
-6302
lines changed

benchmark/complex-jit-aot.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ const ctx = createCoreContext({
4545
})
4646

4747
const i18n = createI18n({
48-
legacy: false,
4948
locale: 'en',
5049
modifiers: {
5150
caml: val => val

benchmark/complex-jit.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const ctx = createCoreContext({
3434
})
3535

3636
const i18n = createI18n({
37-
legacy: false,
3837
locale: 'en',
3938
modifiers: {
4039
caml: val => val

benchmark/complex.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ const ctx = createCoreContext({
2828
})
2929

3030
const i18n = createI18n({
31-
legacy: false,
3231
locale: 'en',
3332
modifiers: {
3433
caml: val => val

benchmark/simple-jit-aot.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ const ctx = createCoreContext({
4040
})
4141

4242
const i18n = createI18n({
43-
legacy: false,
4443
locale: 'en',
4544
messages: {
4645
en: precompiledResources

benchmark/simple-jit.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ const ctx = createCoreContext({
2929
})
3030

3131
const i18n = createI18n({
32-
legacy: false,
3332
locale: 'en',
3433
messages: {
3534
en: resources

benchmark/simple.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const ctx = createCoreContext({
2323
})
2424

2525
const i18n = createI18n({
26-
legacy: false,
2726
locale: 'en',
2827
messages: {
2928
en: resources

e2e/components/datetime-format.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'legacy'].forEach(pattern => {
2+
;['composition'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(

e2e/components/number-format.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'legacy'].forEach(pattern => {
2+
;['composition'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/components/number-format.html`))

e2e/components/translation.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'legacy'].forEach(pattern => {
2+
;['composition'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/components/translation.html`))

e2e/datetime.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from './helper'
2-
;['composition', 'legacy'].forEach(pattern => {
2+
;['composition'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/datetime.html`))

e2e/fallback/basic.spec.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
const warnings: string[] = []
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
88
const text = msg.text()
9-
if (
10-
!text.match(/^\[intlify\] Legacy API mode has been/) &&
11-
!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)
12-
) {
9+
if (!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)) {
1310
warnings.push(msg.text())
1411
}
1512
}

e2e/fallback/component.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/fallback/component.html`))

e2e/fallback/default-format.spec.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import { getText, url } from '../helper'
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
88
const text = msg.text()
9-
if (
10-
!text.match(/^\[intlify\] Legacy API mode has been/) &&
11-
!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)
12-
) {
9+
if (!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)) {
1310
warnings.push(msg.text())
1411
}
1512
}

e2e/fallback/format.spec.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
const warnings: string[] = []
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
88
const text = msg.text()
9-
if (
10-
!text.match(/^\[intlify\] Legacy API mode has been/) &&
11-
!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)
12-
) {
9+
if (!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)) {
1310
warnings.push(msg.text())
1411
}
1512
}

e2e/fallback/option.spec.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import { getText, url } from '../helper'
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
88
const text = msg.text()
9-
if (
10-
!text.match(/^\[intlify\] Legacy API mode has been/) &&
11-
!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)
12-
) {
9+
if (!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)) {
1310
warnings.push(msg.text())
1411
}
1512
}

e2e/fallback/suppress.spec.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
const warnings: string[] = []
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
88
const text = msg.text()
9-
if (
10-
!text.match(/^\[intlify\] Legacy API mode has been/) &&
11-
!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)
12-
) {
9+
if (!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)) {
1310
warnings.push(msg.text())
1411
}
1512
}

e2e/formatting/linked.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/formatting/linked.html`))

e2e/formatting/list.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/formatting/list.html`))

e2e/formatting/literal.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/formatting/literal.html`))

e2e/formatting/named.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/formatting/named.html`))

e2e/functions/linked.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/functions/linked.html`))

e2e/functions/list.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/functions/list.html`))

e2e/functions/named.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/functions/named.html`))

e2e/functions/plural.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/functions/plural.html`))

e2e/hotfix/CVE-2024-52809.html

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
}
5050

5151
const i18n = createI18n({
52-
legacy: false,
5352
locale: 'en',
5453
messages: {
5554
en

e2e/missing/handler.spec.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
const warnings: string[] = []
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
88
const text = msg.text()
9-
if (
10-
!text.match(/^\[intlify\] Legacy API mode has been/) &&
11-
!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)
12-
) {
9+
if (!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)) {
1310
warnings.push(msg.text())
1411
}
1512
}

e2e/missing/option.spec.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ import { getText, url } from '../helper'
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
88
const text = msg.text()
9-
if (
10-
!text.match(/^\[intlify\] Legacy API mode has been/) &&
11-
!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)
12-
) {
9+
if (!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)) {
1310
warnings.push(msg.text())
1411
}
1512
}

e2e/missing/suppress.spec.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
const warnings: string[] = []
55
beforeAll(async () => {
66
page.on('console', msg => {
77
if (msg.type() === 'warning') {
88
const text = msg.text()
9-
if (
10-
!text.match(/^\[intlify\] Legacy API mode has been/) &&
11-
!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)
12-
) {
9+
if (!text.match(/^\[intlify\] 'v-t' has been deprecated in v11/)) {
1310
warnings.push(msg.text())
1411
}
1512
}

e2e/number.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from './helper'
2-
;['composition', 'legacy'].forEach(pattern => {
2+
;['composition'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/number.html`))

e2e/plural/basic.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/plural/basic.html`))

e2e/plural/custom.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/plural/custom.html`))

e2e/scope/global.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/scope/global.html`))

e2e/scope/inherit-locale.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/scope/inherit-locale.html`))

e2e/scope/local.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from '../helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/scope/local.html`))

e2e/started.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getText, url } from './helper'
2-
;['composition', 'petite', 'legacy'].forEach(pattern => {
2+
;['composition', 'petite'].forEach(pattern => {
33
describe(`${pattern}`, () => {
44
beforeAll(async () => {
55
await page.goto(url(`/examples/${pattern}/started.html`))

examples/backend/src/main.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ import type { Locales } from './constants'
1111
const messages = await load<Locales>(locales)
1212

1313
// create i18n instance
14-
const i18n = createI18n<[ResourceSchema], Locales, false>({
15-
legacy: false,
14+
const i18n = createI18n<[ResourceSchema], Locales>({
1615
locale: 'en',
1716
messages
1817
})

examples/composition/components/datetime-format.html

-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ <h2>slot usages:</h2>
3939
const { createI18n } = VueI18n
4040

4141
const i18n = createI18n({
42-
legacy: false,
4342
locale: 'en-US',
4443
datetimeFormats: {
4544
'en-US': {

examples/composition/components/number-format.html

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ <h2>slot usages:</h2>
4747
const { createI18n } = VueI18n
4848

4949
const i18n = createI18n({
50-
legacy: false,
5150
locale: 'en-US',
5251
numberFormats: {
5352
'en-US': {

examples/composition/components/translation.html

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ <h2>localize with using plural:</h2>
5959
const { createI18n, useI18n } = VueI18n
6060

6161
const i18n = createI18n({
62-
legacy: false,
6362
locale: 'ja',
6463
messages: {
6564
en: {

examples/composition/datetime.html

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ <h1>DateTime Localization for Composition API</h1>
2323
const { createI18n, useI18n } = VueI18n
2424

2525
const i18n = createI18n({
26-
legacy: false,
2726
locale: 'ja-JP',
2827
messages: {
2928
'en-US': {

examples/composition/fallback/basic.html

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
const { createI18n, useI18n } = VueI18n
1616

1717
const i18n = createI18n({
18-
legacy: false,
1918
locale: 'ja',
2019
fallbackLocale: ['en'],
2120
messages: {

examples/composition/fallback/component.html

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ <h1>Root</h1>
2525
const { createI18n, useI18n } = VueI18n
2626

2727
const i18n = createI18n({
28-
legacy: false,
2928
locale: 'ja',
3029
messages: {
3130
en: {

examples/composition/fallback/default-format.html

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
const { createI18n, useI18n } = VueI18n
2828

2929
const i18n = createI18n({
30-
legacy: false,
3130
locale: 'ja',
3231
fallbackLocale: ['en'],
3332
messages: {

examples/composition/fallback/format.html

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
const { createI18n, useI18n } = VueI18n
1616

1717
const i18n = createI18n({
18-
legacy: false,
1918
locale: 'ja',
2019
fallbackFormat: true, // enable, fallback to locale message key
2120
messages: {

0 commit comments

Comments
 (0)