Skip to content

Commit 6608c78

Browse files
committed
chore: remove prefixIdentifiers
1 parent 0ab2690 commit 6608c78

File tree

6 files changed

+11
-23
lines changed

6 files changed

+11
-23
lines changed

packages/compiler/src/compile.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export function compile(
3131
options: CompilerOptions = {},
3232
): VaporCodegenResult {
3333
const resolvedOptions = extend({}, options, {
34-
prefixIdentifiers: false,
3534
expressionPlugins: options.expressionPlugins || ['jsx'],
3635
})
3736
if (!resolvedOptions.source && isString(source)) {

packages/compiler/src/generate.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
INDENT_END,
1010
INDENT_START,
1111
NEWLINE,
12-
type CodeFragment,
1312
} from './generators/utils'
1413
import type { BlockIRNode, RootIRNode } from './ir'
1514
import type {
@@ -18,17 +17,10 @@ import type {
1817
SimpleExpressionNode,
1918
} from '@vue/compiler-dom'
2019

21-
type CustomGenOperation = (
22-
opers: any,
23-
context: CodegenContext,
24-
) => CodeFragment[] | void
25-
2620
export type CodegenOptions = Omit<
2721
BaseCodegenOptions,
28-
'optimizeImports' | 'inline' | 'bindingMetadata'
29-
> & {
30-
customGenOperation?: CustomGenOperation | null
31-
}
22+
'optimizeImports' | 'inline' | 'bindingMetadata' | 'prefixIdentifiers'
23+
>
3224

3325
export class CodegenContext {
3426
options: Required<CodegenOptions>
@@ -83,7 +75,6 @@ export class CodegenContext {
8375
) {
8476
const defaultOptions: Required<CodegenOptions> = {
8577
mode: 'module',
86-
prefixIdentifiers: true,
8778
sourceMap: false,
8879
filename: `template.vue.html`,
8980
scopeId: null,
@@ -94,7 +85,6 @@ export class CodegenContext {
9485
isTS: false,
9586
inSSR: false,
9687
expressionPlugins: [],
97-
customGenOperation: null,
9888
}
9989
this.options = extend(defaultOptions, options)
10090
this.block = ir.block

packages/compiler/src/transform.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export type StructuralDirectiveTransform = (
5757
export type TransformOptions = HackOptions<BaseTransformOptions>
5858
const defaultOptions = {
5959
filename: '',
60-
prefixIdentifiers: false,
6160
hoistStatic: false,
6261
hmr: false,
6362
cacheHandlers: false,
@@ -88,7 +87,11 @@ export class TransformContext<
8887
options: Required<
8988
Omit<
9089
TransformOptions,
91-
'filename' | 'inline' | 'bindingMetadata' | keyof CompilerCompatOptions
90+
| 'filename'
91+
| 'inline'
92+
| 'bindingMetadata'
93+
| 'prefixIdentifiers'
94+
| keyof CompilerCompatOptions
9295
>
9396
>
9497

packages/compiler/test/transforms/__snapshots__/vOn.spec.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ exports[`v-on > should not wrap keys guard if no key modifier is present 1`] = `
7272
"
7373
`;
7474

75-
exports[`v-on > should support multiple modifiers and event options w/ prefixIdentifiers: true 1`] = `
75+
exports[`v-on > should support multiple modifiers and event options 1`] = `
7676
"
7777
const n0 = t0()
7878
_on(n0, "click", _withModifiers(e => test(e), ["stop","prevent"]), {

packages/compiler/test/transforms/_utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ export function makeCompile(options: CompilerOptions = {}) {
2929
}
3030
const ir = transform(ast, {
3131
expressionPlugins: ['typescript', 'jsx'],
32-
prefixIdentifiers: false,
3332
...options,
3433
...overrideOptions,
3534
}) as any
3635
const { code, helpers, preamble } = generate(ir, {
37-
prefixIdentifiers: false,
3836
...options,
3937
...overrideOptions,
4038
})

packages/compiler/test/transforms/vOn.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ describe('v-on', () => {
108108
expect(onError).not.toHaveBeenCalled()
109109
})
110110

111-
test('should support multiple modifiers and event options w/ prefixIdentifiers: true', () => {
111+
test('should support multiple modifiers and event options', () => {
112112
const { code, ir, helpers } = compileWithVOn(
113113
`<div onClick_stop_prevent_capture_once={test}/>`,
114114
)
@@ -140,7 +140,7 @@ describe('v-on', () => {
140140
)
141141
})
142142

143-
test('should support multiple events and modifiers options w/ prefixIdentifiers: true', () => {
143+
test('should support multiple events and modifiers options', () => {
144144
const { code, ir } = compileWithVOn(
145145
`<div onClick_stop={test} onKeyup_enter={test} />`,
146146
)
@@ -241,9 +241,7 @@ describe('v-on', () => {
241241
})
242242

243243
test('should wrap keys guard for static key event w/ left/right modifiers', () => {
244-
const { code, ir } = compileWithVOn(`<div onKeyup_left={test}/>`, {
245-
prefixIdentifiers: true,
246-
})
244+
const { code, ir } = compileWithVOn(`<div onKeyup_left={test}/>`)
247245

248246
expect(ir.block.operation).toMatchObject([
249247
{

0 commit comments

Comments
 (0)