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

refac(runtime-core): Make the execution process smoother. #11965

Closed
wants to merge 2 commits into from

Conversation

zhangenming
Copy link
Contributor

No description provided.

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 101 kB (-8 B) 37.9 kB (-3 B) 34.1 kB (-21 B)
vue.global.prod.js 159 kB (-8 B) 57.9 kB (-1 B) 51.4 kB (+1 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 48.8 kB 18.8 kB 17.2 kB
createApp 55.4 kB 21.3 kB 19.4 kB
createSSRApp 59.4 kB 23 kB 21 kB
defineCustomElement 60.2 kB 22.9 kB 20.9 kB
overall 69.1 kB 26.4 kB 24 kB

Copy link

pkg-pr-new bot commented Sep 18, 2024

Open in Stackblitz

@vue/compiler-core

pnpm add https://pkg.pr.new/@vue/compiler-core@11965

@vue/compiler-dom

pnpm add https://pkg.pr.new/@vue/compiler-dom@11965

@vue/compiler-sfc

pnpm add https://pkg.pr.new/@vue/compiler-sfc@11965

@vue/reactivity

pnpm add https://pkg.pr.new/@vue/reactivity@11965

@vue/compiler-ssr

pnpm add https://pkg.pr.new/@vue/compiler-ssr@11965

@vue/runtime-dom

pnpm add https://pkg.pr.new/@vue/runtime-dom@11965

@vue/runtime-core

pnpm add https://pkg.pr.new/@vue/runtime-core@11965

@vue/shared

pnpm add https://pkg.pr.new/@vue/shared@11965

@vue/server-renderer

pnpm add https://pkg.pr.new/@vue/server-renderer@11965

@vue/compat

pnpm add https://pkg.pr.new/@vue/compat@11965

vue

pnpm add https://pkg.pr.new/vue@11965

commit: bf7faaf

}
}, opts)
forEach(el => {
if (elementIsVisibleInViewport(el)) {
hydrate()
ob.disconnect()
return false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return false here has a special purpose
see #11639 (comment)

@edison1105
Copy link
Member

edison1105 commented Sep 18, 2024

Thanks for the PR. But, this PR is unnecessary.

@edison1105 edison1105 closed this Sep 18, 2024
@zhangenming
Copy link
Contributor Author

sorry, but are you sure?
I don't understand
the false inside forEach, I don't think it's gonna do anything
@edison1105 :)

@zhangenming zhangenming changed the title fix(runtime-core): Make the execution process smoother. refac(runtime-core): Make the execution process smoother. Sep 19, 2024
@edison1105
Copy link
Member

@zhangenming
this forEach is forEachElement , please notice line 117

if (next.nodeType === DOMNodeTypes.ELEMENT) {
const result = cb(next as Element)
if (result === false) {
break
}

@zhangenming
Copy link
Contributor Author

oh...thanks... Mistaking forEach for Array.prototype.forEach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants