Skip to content

feat!: deprecate Legacy API mode #2016

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 4 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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