Skip to content

Commit

Permalink
fix(unplugin-vue-i18n): drop useClassComponent option (#368)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon authored May 16, 2024
1 parent cbbf632 commit 331acf5
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 70 deletions.
4 changes: 4 additions & 0 deletions packages/unplugin-vue-i18n/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,10 @@ If do you will use this option, you need to enable `jitCompilation` option.
This option that to use i18n custom blocks in `vue-class-component`.
> [!IMPORTANT]
'useClassComponent' option is deprecated in v5.
This option will be supported with vue-i18n until v9 latest version.
### `onlyLocales`
- **Type:** `string | string[]`
Expand Down
13 changes: 1 addition & 12 deletions packages/unplugin-vue-i18n/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
? options.defaultSFCLang
: 'json'
const globalSFCScope = !!options.globalSFCScope
const useClassComponent = !!options.useClassComponent

const runtimeOnly = isBoolean(options.runtimeOnly)
? options.runtimeOnly
Expand Down Expand Up @@ -312,7 +311,6 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
{
inSourceMap,
isGlobal: globalSFCScope,
useClassComponent,
allowDynamic,
strictMessage,
escapeHtml,
Expand Down Expand Up @@ -451,8 +449,7 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
{
forceStringify,
strictMessage,
escapeHtml,
useClassComponent
escapeHtml
}
)
// TODO: support virtual import identifier
Expand Down Expand Up @@ -499,7 +496,6 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
{
inSourceMap,
isGlobal: globalSFCScope,
useClassComponent,
allowDynamic,
strictMessage,
escapeHtml,
Expand Down Expand Up @@ -553,7 +549,6 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
{
inSourceMap,
isGlobal: globalSFCScope,
useClassComponent,
jit: true,
strictMessage,
escapeHtml,
Expand Down Expand Up @@ -644,15 +639,13 @@ async function generateBundleResources(
onlyLocales = [],
strictMessage = true,
escapeHtml = false,
useClassComponent = false,
jit = true
}: {
forceStringify?: boolean
isGlobal?: boolean
onlyLocales?: string[]
strictMessage?: boolean
escapeHtml?: boolean
useClassComponent?: boolean
jit?: boolean
}
) {
Expand All @@ -666,7 +659,6 @@ async function generateBundleResources(
const generate = /json5?/.test(ext) ? generateJSON : generateYAML
const parseOptions = getOptions(res, isProduction, {}, false, {
isGlobal,
useClassComponent,
jit,
onlyLocales,
strictMessage,
Expand Down Expand Up @@ -762,7 +754,6 @@ function getOptions(
forceStringify = false,
isGlobal = false,
onlyLocales = [],
useClassComponent = false,
allowDynamic = false,
strictMessage = true,
escapeHtml = false,
Expand All @@ -772,7 +763,6 @@ function getOptions(
forceStringify?: boolean
isGlobal?: boolean
onlyLocales?: string[]
useClassComponent?: boolean
allowDynamic?: boolean
strictMessage?: boolean
escapeHtml?: boolean
Expand All @@ -786,7 +776,6 @@ function getOptions(
sourceMap,
inSourceMap,
forceStringify,
useClassComponent,
allowDynamic,
strictMessage,
escapeHtml,
Expand Down
1 change: 0 additions & 1 deletion packages/unplugin-vue-i18n/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export interface PluginOptions {
forceStringify?: boolean
defaultSFCLang?: SFCLangFormat
globalSFCScope?: boolean
useClassComponent?: boolean
useVueI18nImportName?: boolean
strictMessage?: boolean
escapeHtml?: boolean
Expand Down
1 change: 0 additions & 1 deletion packages/unplugin-vue-i18n/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export async function bundleAndRun(
? options.globalSFCScope
: undefined
options.sourcemap = isBoolean(options.sourcemap) || false
options.useClassComponent = isBoolean(options.useClassComponent) || false
options.bridge = isBoolean(options.bridge) || false
options.legacy = isBoolean(options.legacy) || false
options.vueVersion = isString(options.vueVersion)
Expand Down
28 changes: 0 additions & 28 deletions packages/unplugin-vue-i18n/test/vite/class-component.test.ts

This file was deleted.

28 changes: 0 additions & 28 deletions packages/unplugin-vue-i18n/test/webpack/class-component.test.ts

This file was deleted.

0 comments on commit 331acf5

Please sign in to comment.