Skip to content

Commit 67f2bae

Browse files
authored
breaking: drop allowComposition option (#1817)
1 parent 3b55d37 commit 67f2bae

File tree

7 files changed

+13
-801
lines changed

7 files changed

+13
-801
lines changed

docs/guide/migration/vue3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ From Vue I18n v9.2, the Legacy API mode can also be used with Composition API mo
1616

1717
### About supporting
1818

19-
:::warning NOTICE
19+
:::danger NOTICE
2020
This migration support will be removed in the next major version v10. If your Vue 3 application project has not yet been migrated, please migrate it to v9 and then upgrade to v10.
2121
:::
2222

e2e/composition.spec.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

examples/legacy/composition.html

Lines changed: 0 additions & 96 deletions
This file was deleted.

packages/vue-i18n-core/src/errors.ts

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,20 @@ export const I18nErrorCodes = {
1616
// i18n module errors
1717
MUST_BE_CALL_SETUP_TOP: inc(), // 26
1818
NOT_INSTALLED: inc(), // 27
19-
NOT_AVAILABLE_IN_LEGACY_MODE: inc(), // 28
2019
// directive module errors
21-
REQUIRED_VALUE: inc(), // 29
22-
INVALID_VALUE: inc(), // 30
20+
REQUIRED_VALUE: inc(), // 28
21+
INVALID_VALUE: inc(), // 29
2322
// vue-devtools errors
24-
CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: inc(), // 31
25-
NOT_INSTALLED_WITH_PROVIDE: inc(), // 32
23+
CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: inc(), // 30
24+
NOT_INSTALLED_WITH_PROVIDE: inc(), // 31
2625
// unexpected error
27-
UNEXPECTED_ERROR: inc(), // 33
26+
UNEXPECTED_ERROR: inc(), // 32
2827
// not compatible legacy vue-i18n constructor
29-
NOT_COMPATIBLE_LEGACY_VUE_I18N: inc(), // 34
30-
// need to define `i18n` option in `allowComposition: true` and `useScope: 'local' at `useI18n``
31-
MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION: inc(), // 35
28+
NOT_COMPATIBLE_LEGACY_VUE_I18N: inc(), // 33
3229
// Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly
33-
NOT_AVAILABLE_COMPOSITION_IN_LEGACY: inc(), // 36
30+
NOT_AVAILABLE_COMPOSITION_IN_LEGACY: inc(), // 34
3431
// for enhancement
35-
__EXTEND_POINT__: inc() // 3
32+
__EXTEND_POINT__: inc() // 35
3633
} as const
3734

3835
type I18nErrorCodes = (typeof I18nErrorCodes)[keyof typeof I18nErrorCodes]
@@ -55,16 +52,13 @@ export const errorMessages: { [code: number]: string } = {
5552
'Must be called at the top of a `setup` function',
5653
[I18nErrorCodes.NOT_INSTALLED]: 'Need to install with `app.use` function',
5754
[I18nErrorCodes.UNEXPECTED_ERROR]: 'Unexpected error',
58-
[I18nErrorCodes.NOT_AVAILABLE_IN_LEGACY_MODE]: 'Not available in legacy mode',
5955
[I18nErrorCodes.REQUIRED_VALUE]: `Required in value: {0}`,
6056
[I18nErrorCodes.INVALID_VALUE]: `Invalid value`,
6157
[I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: `Cannot setup vue-devtools plugin`,
6258
[I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE]:
6359
'Need to install with `provide` function',
6460
[I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N]:
6561
'Not compatible legacy VueI18n.',
66-
[I18nErrorCodes.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]:
67-
'Must define ‘i18n’ option or custom block in Composition API with using local scope in Legacy API mode',
6862
[I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]:
6963
'Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly'
7064
}

0 commit comments

Comments
 (0)