Skip to content

Commit 331acf5

Browse files
authored
fix(unplugin-vue-i18n): drop useClassComponent option (#368)
1 parent cbbf632 commit 331acf5

File tree

6 files changed

+5
-70
lines changed

6 files changed

+5
-70
lines changed

packages/unplugin-vue-i18n/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,10 @@ If do you will use this option, you need to enable `jitCompilation` option.
547547

548548
This option that to use i18n custom blocks in `vue-class-component`.
549549

550+
> [!IMPORTANT]
551+
'useClassComponent' option is deprecated in v5.
552+
This option will be supported with vue-i18n until v9 latest version.
553+
550554
### `onlyLocales`
551555

552556
- **Type:** `string | string[]`

packages/unplugin-vue-i18n/src/index.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
8080
? options.defaultSFCLang
8181
: 'json'
8282
const globalSFCScope = !!options.globalSFCScope
83-
const useClassComponent = !!options.useClassComponent
8483

8584
const runtimeOnly = isBoolean(options.runtimeOnly)
8685
? options.runtimeOnly
@@ -312,7 +311,6 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
312311
{
313312
inSourceMap,
314313
isGlobal: globalSFCScope,
315-
useClassComponent,
316314
allowDynamic,
317315
strictMessage,
318316
escapeHtml,
@@ -451,8 +449,7 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
451449
{
452450
forceStringify,
453451
strictMessage,
454-
escapeHtml,
455-
useClassComponent
452+
escapeHtml
456453
}
457454
)
458455
// TODO: support virtual import identifier
@@ -499,7 +496,6 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
499496
{
500497
inSourceMap,
501498
isGlobal: globalSFCScope,
502-
useClassComponent,
503499
allowDynamic,
504500
strictMessage,
505501
escapeHtml,
@@ -553,7 +549,6 @@ export const unplugin = createUnplugin<PluginOptions>((options = {}, meta) => {
553549
{
554550
inSourceMap,
555551
isGlobal: globalSFCScope,
556-
useClassComponent,
557552
jit: true,
558553
strictMessage,
559554
escapeHtml,
@@ -644,15 +639,13 @@ async function generateBundleResources(
644639
onlyLocales = [],
645640
strictMessage = true,
646641
escapeHtml = false,
647-
useClassComponent = false,
648642
jit = true
649643
}: {
650644
forceStringify?: boolean
651645
isGlobal?: boolean
652646
onlyLocales?: string[]
653647
strictMessage?: boolean
654648
escapeHtml?: boolean
655-
useClassComponent?: boolean
656649
jit?: boolean
657650
}
658651
) {
@@ -666,7 +659,6 @@ async function generateBundleResources(
666659
const generate = /json5?/.test(ext) ? generateJSON : generateYAML
667660
const parseOptions = getOptions(res, isProduction, {}, false, {
668661
isGlobal,
669-
useClassComponent,
670662
jit,
671663
onlyLocales,
672664
strictMessage,
@@ -762,7 +754,6 @@ function getOptions(
762754
forceStringify = false,
763755
isGlobal = false,
764756
onlyLocales = [],
765-
useClassComponent = false,
766757
allowDynamic = false,
767758
strictMessage = true,
768759
escapeHtml = false,
@@ -772,7 +763,6 @@ function getOptions(
772763
forceStringify?: boolean
773764
isGlobal?: boolean
774765
onlyLocales?: string[]
775-
useClassComponent?: boolean
776766
allowDynamic?: boolean
777767
strictMessage?: boolean
778768
escapeHtml?: boolean
@@ -786,7 +776,6 @@ function getOptions(
786776
sourceMap,
787777
inSourceMap,
788778
forceStringify,
789-
useClassComponent,
790779
allowDynamic,
791780
strictMessage,
792781
escapeHtml,

packages/unplugin-vue-i18n/src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export interface PluginOptions {
1111
forceStringify?: boolean
1212
defaultSFCLang?: SFCLangFormat
1313
globalSFCScope?: boolean
14-
useClassComponent?: boolean
1514
useVueI18nImportName?: boolean
1615
strictMessage?: boolean
1716
escapeHtml?: boolean

packages/unplugin-vue-i18n/test/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ export async function bundleAndRun(
155155
? options.globalSFCScope
156156
: undefined
157157
options.sourcemap = isBoolean(options.sourcemap) || false
158-
options.useClassComponent = isBoolean(options.useClassComponent) || false
159158
options.bridge = isBoolean(options.bridge) || false
160159
options.legacy = isBoolean(options.legacy) || false
161160
options.vueVersion = isString(options.vueVersion)

packages/unplugin-vue-i18n/test/vite/class-component.test.ts

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

packages/unplugin-vue-i18n/test/webpack/class-component.test.ts

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

0 commit comments

Comments
 (0)