Skip to content

Commit

Permalink
feat!: deprecate Legacy API mode (#2016)
Browse files Browse the repository at this point in the history
* fix: deprecated Legacy API mode

* fix: e2e errors

* fix
  • Loading branch information
kazupon authored Nov 14, 2024
1 parent 23c85d2 commit e1d966e
Show file tree
Hide file tree
Showing 16 changed files with 557 additions and 437 deletions.
5 changes: 4 additions & 1 deletion e2e/fallback/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { getText } from '../helper'
beforeAll(async () => {
page.on('console', msg => {
if (msg.type() === 'warning') {
warnings.push(msg.text())
const text = msg.text()
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
warnings.push(msg.text())
}
}
})
await page.goto(
Expand Down
5 changes: 4 additions & 1 deletion e2e/fallback/format.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { getText } from '../helper'
beforeAll(async () => {
page.on('console', msg => {
if (msg.type() === 'warning') {
warnings.push(msg.text())
const text = msg.text()
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
warnings.push(msg.text())
}
}
})
await page.goto(
Expand Down
5 changes: 4 additions & 1 deletion e2e/fallback/option.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { getText } from '../helper'
beforeAll(async () => {
page.on('console', msg => {
if (msg.type() === 'warning') {
warnings.push(msg.text())
const text = msg.text()
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
warnings.push(msg.text())
}
}
})
await page.goto(
Expand Down
5 changes: 4 additions & 1 deletion e2e/fallback/suppress.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { getText } from '../helper'
beforeAll(async () => {
page.on('console', msg => {
if (msg.type() === 'warning') {
warnings.push(msg.text())
const text = msg.text()
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
warnings.push(msg.text())
}
}
})
await page.goto(
Expand Down
5 changes: 4 additions & 1 deletion e2e/missing/handler.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { getText } from '../helper'
beforeAll(async () => {
page.on('console', msg => {
if (msg.type() === 'warning') {
warnings.push(msg.text())
const text = msg.text()
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
warnings.push(msg.text())
}
}
})
await page.goto(
Expand Down
5 changes: 4 additions & 1 deletion e2e/missing/option.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { getText } from '../helper'
beforeAll(async () => {
page.on('console', msg => {
if (msg.type() === 'warning') {
warnings.push(msg.text())
const text = msg.text()
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
warnings.push(msg.text())
}
}
})
await page.goto(
Expand Down
5 changes: 4 additions & 1 deletion e2e/missing/suppress.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { getText } from '../helper'
beforeAll(async () => {
page.on('console', msg => {
if (msg.type() === 'warning') {
warnings.push(msg.text())
const text = msg.text()
if (!text.match(/^\[intlify\] Legacy API mode has been/)) {
warnings.push(msg.text())
}
}
})
await page.goto(
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@types/minimist": "^1.2.5",
"@types/node": "^22.5.3",
"@types/rc": "^1.2.4",
"@vitest/coverage-v8": "^2.0.0",
"@vitest/coverage-v8": "^2.1.5",
"api-docs-gen": "^0.4.0",
"benchmark": "^2.1.4",
"brotli": "^1.3.2",
Expand Down Expand Up @@ -145,7 +145,7 @@
"typescript": "^5.5.3",
"typescript-eslint": "^8.4.0",
"vitepress": "1.5.0",
"vitest": "^2.0.4",
"vitest": "^2.1.5",
"vue": "3.5.12",
"vue-i18n": "workspace:*"
},
Expand Down Expand Up @@ -177,7 +177,7 @@
"pnpm": {
"overrides": {
"vue": "3.5.12",
"vite": "^5.1.2"
"vite": "^5.4.11"
}
}
}
60 changes: 59 additions & 1 deletion packages/size-check-petite-vue-i18n/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,69 @@ import { createApp } from 'vue'
import { createI18n } from 'vue-i18n'
import App from './App.vue'

const ast = {
type: 0,
start: 0,
end: 6,
loc: {
start: {
line: 1,
column: 1,
offset: 0
},
end: {
line: 1,
column: 7,
offset: 6
},
source: 'hello!'
},
body: {
type: 2,
start: 0,
end: 6,
loc: {
start: {
line: 1,
column: 1,
offset: 0
},
end: {
line: 1,
column: 7,
offset: 6
}
},
items: [
{
type: 3,
start: 0,
end: 6,
loc: {
start: {
line: 1,
column: 1,
offset: 0
},
end: {
line: 1,
column: 7,
offset: 6
}
},
value: 'hello!'
}
],
static: 'hello!'
},
cacheKey: '{"l":"en","k":"hello","s":"hello!"}'
}

const i18n = createI18n({
locale: 'en',
messages: {
en: {
hello: 'hello!'
hello: ast
}
}
})
Expand Down
Loading

0 comments on commit e1d966e

Please sign in to comment.