Skip to content

Commit 4019369

Browse files
committed
chore(build): use /*@__PURE__*/ annotation consistently
1 parent 4eee630 commit 4019369

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+173
-173
lines changed

packages/compiler-core/__tests__/transforms/__snapshots__/cacheStatic.spec.ts.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ exports[`compiler: cacheStatic transform > prefixIdentifiers > hoist class with
191191
const { createElementVNode: _createElementVNode } = _Vue
192192
193193
const _hoisted_1 = {
194-
class: /*#__PURE__*/_normalizeClass({ foo: true })
194+
class: /*@__PURE__*/_normalizeClass({ foo: true })
195195
}
196196
197197
return function render(_ctx, _cache) {

packages/compiler-core/src/codegen.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ interface MappingItem {
9999
name: string | null
100100
}
101101

102-
const PURE_ANNOTATION = `/*#__PURE__*/`
102+
const PURE_ANNOTATION = `/*@__PURE__*/`
103103

104104
const aliasHelper = (s: symbol) => `${helperNameMap[s]}: _${helperNameMap[s]}`
105105

packages/compiler-core/src/transforms/transformExpression.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { parseExpression } from '@babel/parser'
4444
import { IS_REF, UNREF } from '../runtimeHelpers'
4545
import { BindingTypes } from '../options'
4646

47-
const isLiteralWhitelisted = /*#__PURE__*/ makeMap('true,false,null,this')
47+
const isLiteralWhitelisted = /*@__PURE__*/ makeMap('true,false,null,this')
4848

4949
export const transformExpression: NodeTransform = (node, context) => {
5050
if (node.type === NodeTypes.INTERPOLATION) {

packages/compiler-dom/src/transforms/stringifyStatic.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ const isStringifiableAttr = (name: string, ns: Namespaces) => {
188188
)
189189
}
190190

191-
const isNonStringifiable = /*#__PURE__*/ makeMap(
191+
const isNonStringifiable = /*@__PURE__*/ makeMap(
192192
`caption,thead,tr,th,tbody,td,tfoot,colgroup,col`,
193193
)
194194

packages/compiler-dom/src/transforms/vOn.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import {
1717
import { V_ON_WITH_KEYS, V_ON_WITH_MODIFIERS } from '../runtimeHelpers'
1818
import { capitalize, makeMap } from '@vue/shared'
1919

20-
const isEventOptionModifier = /*#__PURE__*/ makeMap(`passive,once,capture`)
21-
const isNonKeyModifier = /*#__PURE__*/ makeMap(
20+
const isEventOptionModifier = /*@__PURE__*/ makeMap(`passive,once,capture`)
21+
const isNonKeyModifier = /*@__PURE__*/ makeMap(
2222
// event propagation management
2323
`stop,prevent,self,` +
2424
// system modifiers + exact
@@ -27,8 +27,8 @@ const isNonKeyModifier = /*#__PURE__*/ makeMap(
2727
`middle`,
2828
)
2929
// left & right could be mouse or key modifiers based on event type
30-
const maybeKeyModifier = /*#__PURE__*/ makeMap('left,right')
31-
const isKeyboardEvent = /*#__PURE__*/ makeMap(
30+
const maybeKeyModifier = /*@__PURE__*/ makeMap('left,right')
31+
const isKeyboardEvent = /*@__PURE__*/ makeMap(
3232
`onkeyup,onkeydown,onkeypress`,
3333
true,
3434
)

packages/compiler-sfc/__tests__/__snapshots__/compileScript.spec.ts.snap

+19-19
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports[`SFC analyze <script> bindings > auto name inference > do not overwrite
2020
name: 'Baz'
2121
})
2222
23-
export default /*#__PURE__*/Object.assign(__default__, {
23+
export default /*@__PURE__*/Object.assign(__default__, {
2424
setup(__props, { expose: __expose }) {
2525
__expose();
2626
const a = 1
@@ -36,7 +36,7 @@ exports[`SFC analyze <script> bindings > auto name inference > do not overwrite
3636
name: 'Baz'
3737
}
3838
39-
export default /*#__PURE__*/Object.assign(__default__, {
39+
export default /*@__PURE__*/Object.assign(__default__, {
4040
setup(__props, { expose: __expose }) {
4141
__expose();
4242
const a = 1
@@ -53,7 +53,7 @@ exports[`SFC compile <script setup> > <script> and <script setup> co-usage > exp
5353
}
5454
const __default__ = fn();
5555
56-
export default /*#__PURE__*/Object.assign(__default__, {
56+
export default /*@__PURE__*/Object.assign(__default__, {
5757
setup(__props, { expose: __expose }) {
5858
__expose();
5959
@@ -91,7 +91,7 @@ exports[`SFC compile <script setup> > <script> and <script setup> co-usage > scr
9191
9292
const __default__ = {}
9393
94-
export default /*#__PURE__*/Object.assign(__default__, {
94+
export default /*@__PURE__*/Object.assign(__default__, {
9595
setup(__props, { expose: __expose }) {
9696
__expose();
9797
@@ -110,7 +110,7 @@ exports[`SFC compile <script setup> > <script> and <script setup> co-usage > scr
110110
const __default__ = {}
111111
112112
113-
export default /*#__PURE__*/Object.assign(__default__, {
113+
export default /*@__PURE__*/Object.assign(__default__, {
114114
setup(__props, { expose: __expose }) {
115115
__expose();
116116
@@ -131,7 +131,7 @@ import { x } from './x'
131131
}
132132
133133
134-
export default /*#__PURE__*/_defineComponent({
134+
export default /*@__PURE__*/_defineComponent({
135135
...__default__,
136136
setup(__props, { expose: __expose }) {
137137
__expose();
@@ -154,7 +154,7 @@ exports[`SFC compile <script setup> > <script> and <script setup> co-usage > scr
154154
const __default__ = def
155155
156156
157-
export default /*#__PURE__*/Object.assign(__default__, {
157+
export default /*@__PURE__*/Object.assign(__default__, {
158158
setup(__props, { expose: __expose }) {
159159
__expose();
160160
@@ -174,7 +174,7 @@ exports[`SFC compile <script setup> > <script> and <script setup> co-usage > spa
174174
some:'option'
175175
}
176176
177-
export default /*#__PURE__*/Object.assign(__default__, {
177+
export default /*@__PURE__*/Object.assign(__default__, {
178178
setup(__props, { expose: __expose }) {
179179
__expose();
180180
@@ -194,7 +194,7 @@ exports[`SFC compile <script setup> > <script> and <script setup> co-usage > spa
194194
some:'option'
195195
}
196196
197-
export default /*#__PURE__*/Object.assign(__default__, {
197+
export default /*@__PURE__*/Object.assign(__default__, {
198198
setup(__props, { expose: __expose }) {
199199
__expose();
200200
@@ -1142,7 +1142,7 @@ exports[`SFC compile <script setup> > with TypeScript > const Enum 1`] = `
11421142
"import { defineComponent as _defineComponent } from 'vue'
11431143
const enum Foo { A = 123 }
11441144
1145-
export default /*#__PURE__*/_defineComponent({
1145+
export default /*@__PURE__*/_defineComponent({
11461146
setup(__props, { expose: __expose }) {
11471147
__expose();
11481148
@@ -1158,7 +1158,7 @@ exports[`SFC compile <script setup> > with TypeScript > hoist type declarations
11581158
export interface Foo {}
11591159
type Bar = {}
11601160
1161-
export default /*#__PURE__*/_defineComponent({
1161+
export default /*@__PURE__*/_defineComponent({
11621162
setup(__props, { expose: __expose }) {
11631163
__expose();
11641164
@@ -1174,7 +1174,7 @@ exports[`SFC compile <script setup> > with TypeScript > import type 1`] = `
11741174
import type { Foo } from './main.ts'
11751175
import { type Bar, Baz } from './main.ts'
11761176
1177-
export default /*#__PURE__*/_defineComponent({
1177+
export default /*@__PURE__*/_defineComponent({
11781178
setup(__props, { expose: __expose }) {
11791179
__expose();
11801180
@@ -1189,7 +1189,7 @@ exports[`SFC compile <script setup> > with TypeScript > runtime Enum 1`] = `
11891189
"import { defineComponent as _defineComponent } from 'vue'
11901190
enum Foo { A = 123 }
11911191
1192-
export default /*#__PURE__*/_defineComponent({
1192+
export default /*@__PURE__*/_defineComponent({
11931193
setup(__props, { expose: __expose }) {
11941194
__expose();
11951195
@@ -1207,7 +1207,7 @@ exports[`SFC compile <script setup> > with TypeScript > runtime Enum in normal s
12071207
const enum C { C = "C" }
12081208
enum B { B = "B" }
12091209
1210-
export default /*#__PURE__*/_defineComponent({
1210+
export default /*@__PURE__*/_defineComponent({
12111211
setup(__props, { expose: __expose }) {
12121212
__expose();
12131213
@@ -1223,7 +1223,7 @@ exports[`SFC compile <script setup> > with TypeScript > with generic attribute 1
12231223
"import { defineComponent as _defineComponent } from 'vue'
12241224
type Bar = {}
12251225
1226-
export default /*#__PURE__*/_defineComponent({
1226+
export default /*@__PURE__*/_defineComponent({
12271227
setup(__props, { expose: __expose }) {
12281228
__expose();
12291229
@@ -1252,7 +1252,7 @@ exports[`SFC genDefaultAs > <script setup> only w/ ts 1`] = `
12521252
"import { defineComponent as _defineComponent } from 'vue'
12531253
const a = 1
12541254
1255-
const _sfc_ = /*#__PURE__*/_defineComponent({
1255+
const _sfc_ = /*@__PURE__*/_defineComponent({
12561256
setup(__props, { expose: __expose }) {
12571257
__expose();
12581258
@@ -1267,7 +1267,7 @@ exports[`SFC genDefaultAs > <script> + <script setup> 1`] = `
12671267
"
12681268
const __default__ = {}
12691269
1270-
const _sfc_ = /*#__PURE__*/Object.assign(__default__, {
1270+
const _sfc_ = /*@__PURE__*/Object.assign(__default__, {
12711271
setup(__props, { expose: __expose }) {
12721272
__expose();
12731273
@@ -1283,7 +1283,7 @@ exports[`SFC genDefaultAs > <script> + <script setup> 2`] = `
12831283
"
12841284
const __default__ = {}
12851285
1286-
const _sfc_ = /*#__PURE__*/Object.assign(__default__, {
1286+
const _sfc_ = /*@__PURE__*/Object.assign(__default__, {
12871287
setup(__props, { expose: __expose }) {
12881288
__expose();
12891289
@@ -1300,7 +1300,7 @@ exports[`SFC genDefaultAs > <script> + <script setup> w/ ts 1`] = `
13001300
13011301
const __default__ = {}
13021302
1303-
const _sfc_ = /*#__PURE__*/_defineComponent({
1303+
const _sfc_ = /*@__PURE__*/_defineComponent({
13041304
...__default__,
13051305
setup(__props, { expose: __expose }) {
13061306
__expose();

packages/compiler-sfc/__tests__/compileScript.spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ describe('SFC genDefaultAs', () => {
13571357
)
13581358
expect(content).not.toMatch('export default')
13591359
expect(content).toMatch(
1360-
`const _sfc_ = /*#__PURE__*/Object.assign(__default__`,
1360+
`const _sfc_ = /*@__PURE__*/Object.assign(__default__`,
13611361
)
13621362
assertCode(content)
13631363
})
@@ -1376,7 +1376,7 @@ describe('SFC genDefaultAs', () => {
13761376
)
13771377
expect(content).not.toMatch('export default')
13781378
expect(content).toMatch(
1379-
`const _sfc_ = /*#__PURE__*/Object.assign(__default__`,
1379+
`const _sfc_ = /*@__PURE__*/Object.assign(__default__`,
13801380
)
13811381
assertCode(content)
13821382
})
@@ -1405,7 +1405,7 @@ describe('SFC genDefaultAs', () => {
14051405
},
14061406
)
14071407
expect(content).not.toMatch('export default')
1408-
expect(content).toMatch(`const _sfc_ = /*#__PURE__*/_defineComponent(`)
1408+
expect(content).toMatch(`const _sfc_ = /*@__PURE__*/_defineComponent(`)
14091409
assertCode(content)
14101410
})
14111411

@@ -1423,7 +1423,7 @@ describe('SFC genDefaultAs', () => {
14231423
)
14241424
expect(content).not.toMatch('export default')
14251425
expect(content).toMatch(
1426-
`const _sfc_ = /*#__PURE__*/_defineComponent({\n ...__default__`,
1426+
`const _sfc_ = /*@__PURE__*/_defineComponent({\n ...__default__`,
14271427
)
14281428
assertCode(content)
14291429
})

0 commit comments

Comments
 (0)