Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: add __NO_SIDE_EFFECTS__ comments #9053

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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