Skip to content

Commit

Permalink
breaking: drop allowComposition option
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Apr 22, 2024
1 parent 3b55d37 commit ab77bfe
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 801 deletions.
2 changes: 1 addition & 1 deletion docs/guide/migration/vue3.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ From Vue I18n v9.2, the Legacy API mode can also be used with Composition API mo

### About supporting

:::warning NOTICE
:::danger NOTICE
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.
:::

Expand Down
27 changes: 0 additions & 27 deletions e2e/composition.spec.ts

This file was deleted.

96 changes: 0 additions & 96 deletions examples/legacy/composition.html

This file was deleted.

22 changes: 8 additions & 14 deletions packages/vue-i18n-core/src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,20 @@ export const I18nErrorCodes = {
// i18n module errors
MUST_BE_CALL_SETUP_TOP: inc(), // 26
NOT_INSTALLED: inc(), // 27
NOT_AVAILABLE_IN_LEGACY_MODE: inc(), // 28
// directive module errors
REQUIRED_VALUE: inc(), // 29
INVALID_VALUE: inc(), // 30
REQUIRED_VALUE: inc(), // 28
INVALID_VALUE: inc(), // 29
// vue-devtools errors
CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: inc(), // 31
NOT_INSTALLED_WITH_PROVIDE: inc(), // 32
CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: inc(), // 30
NOT_INSTALLED_WITH_PROVIDE: inc(), // 31
// unexpected error
UNEXPECTED_ERROR: inc(), // 33
UNEXPECTED_ERROR: inc(), // 32
// not compatible legacy vue-i18n constructor
NOT_COMPATIBLE_LEGACY_VUE_I18N: inc(), // 34
// need to define `i18n` option in `allowComposition: true` and `useScope: 'local' at `useI18n``
MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION: inc(), // 35
NOT_COMPATIBLE_LEGACY_VUE_I18N: inc(), // 33
// Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly
NOT_AVAILABLE_COMPOSITION_IN_LEGACY: inc(), // 36
NOT_AVAILABLE_COMPOSITION_IN_LEGACY: inc(), // 34
// for enhancement
__EXTEND_POINT__: inc() // 3
__EXTEND_POINT__: inc() // 35
} as const

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

0 comments on commit ab77bfe

Please sign in to comment.