Skip to content

Commit

Permalink
perf: add __NO_SIDE_EFFECTS__ comments (#9053)
Browse files Browse the repository at this point in the history
Co-authored-by: Haoqun Jiang <haoqunjiang@gmail.com>
  • Loading branch information
chenfan0 and haoqunjiang committed Mar 13, 2024
1 parent a148b87 commit d46df6b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/runtime-core/src/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ export const devtoolsComponentRemoved = (
}
}

/*! #__NO_SIDE_EFFECTS__ */
function createDevtoolsComponentHook(hook: DevtoolsHooks) {
return (component: ComponentInternalInstance) => {
emit(
Expand Down
2 changes: 1 addition & 1 deletion packages/server-renderer/src/helpers/ssrRenderAttrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '@vue/shared'

// leading comma for empty string ""
const shouldIgnoreProp = makeMap(
const shouldIgnoreProp = /*#__PURE__*/ makeMap(
`,key,ref,innerHTML,textContent,ref_key,ref_for`,
)

Expand Down
2 changes: 2 additions & 0 deletions packages/shared/src/makeMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* \/\*#\_\_PURE\_\_\*\/
* So that rollup can tree-shake them if necessary.
*/

/*! #__NO_SIDE_EFFECTS__ */
export function makeMap(
str: string,
expectsLowerCase?: boolean,
Expand Down

0 comments on commit d46df6b

Please sign in to comment.