Skip to content

Commit 8ca9f68

Browse files
committed
perf: add __NO_SIDE_EFFECTS__ comment
1 parent 2ffe3d5 commit 8ca9f68

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

packages/reactivity/src/collectionHandlers.ts

+1
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ const [
331331
shallowReadonlyInstrumentations
332332
] = /* #__PURE__*/ createInstrumentations()
333333

334+
/*! #__NO_SIDE_EFFECTS__ */
334335
function createInstrumentationGetter(isReadonly: boolean, shallow: boolean) {
335336
const instrumentations = shallow
336337
? isReadonly

packages/runtime-core/src/devtools.ts

+1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export const devtoolsComponentRemoved = (
123123
}
124124
}
125125

126+
/*! #__NO_SIDE_EFFECTS__ */
126127
function createDevtoolsComponentHook(hook: DevtoolsHooks) {
127128
return (component: ComponentInternalInstance) => {
128129
emit(

packages/server-renderer/src/helpers/ssrRenderAttrs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '@vue/shared'
1313

1414
// leading comma for empty string ""
15-
const shouldIgnoreProp = makeMap(
15+
const shouldIgnoreProp = /*#__PURE__*/ makeMap(
1616
`,key,ref,innerHTML,textContent,ref_key,ref_for`
1717
)
1818

packages/shared/src/general.ts

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const isOn = (key: string) => onRE.test(key)
1717

1818
export const isModelListener = (key: string) => key.startsWith('onUpdate:')
1919

20+
/*! #__NO_SIDE_EFFECTS__ */
2021
export const extend = Object.assign
2122

2223
export const remove = <T>(arr: T[], el: T) => {

packages/shared/src/makeMap.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* \/\*#\_\_PURE\_\_\*\/
66
* So that rollup can tree-shake them if necessary.
77
*/
8+
9+
/*! #__NO_SIDE_EFFECTS__ */
810
export function makeMap(
911
str: string,
1012
expectsLowerCase?: boolean

0 commit comments

Comments
 (0)