Skip to content

Commit 438027c

Browse files
authored
perf: mark defineComponent as side-effects-free (#8512)
1 parent 97b6fae commit 438027c

File tree

5 files changed

+46
-50
lines changed

5 files changed

+46
-50
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
"prettier": "^2.7.1",
8888
"pug": "^3.0.1",
8989
"puppeteer": "~19.6.0",
90-
"rollup": "^3.20.2",
90+
"rollup": "^3.26.0",
9191
"rollup-plugin-dts": "^5.3.0",
9292
"rollup-plugin-esbuild": "^5.0.0",
9393
"rollup-plugin-polyfill-node": "^0.12.0",

packages/runtime-core/src/apiAsyncComponent.ts

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export interface AsyncComponentOptions<T = any> {
4040
export const isAsyncWrapper = (i: ComponentInternalInstance | VNode): boolean =>
4141
!!(i.type as ComponentOptions).__asyncLoader
4242

43+
/*! #__NO_SIDE_EFFECTS__ */
4344
export function defineAsyncComponent<
4445
T extends Component = { new (): ComponentPublicInstance }
4546
>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T {

packages/runtime-core/src/apiDefineComponent.ts

+1
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ export function defineComponent<
274274
>
275275

276276
// implementation, close to no-op
277+
/*! #__NO_SIDE_EFFECTS__ */
277278
export function defineComponent(
278279
options: unknown,
279280
extraOptions?: ComponentOptions

packages/runtime-dom/src/apiCustomElement.ts

+2
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export function defineCustomElement(options: {
140140
new (...args: any[]): ComponentPublicInstance
141141
}): VueElementConstructor
142142

143+
/*! #__NO_SIDE_EFFECTS__ */
143144
export function defineCustomElement(
144145
options: any,
145146
hydrate?: RootHydrateFunction
@@ -155,6 +156,7 @@ export function defineCustomElement(
155156
return VueCustomElement
156157
}
157158

159+
/*! #__NO_SIDE_EFFECTS__ */
158160
export const defineSSRCustomElement = ((options: any) => {
159161
// @ts-ignore
160162
return defineCustomElement(options, hydrate)

pnpm-lock.yaml

+41-49
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)