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

fix(custom-element): properly resolve props for sync component defs #12855

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

edison1105
Copy link
Member

close #12854

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (-58 B) 38.1 kB (-14 B) 34.3 kB (+19 B)
vue.global.prod.js 158 kB (-58 B) 58 kB (-11 B) 51.6 kB (-75 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.5 kB 18.2 kB 16.7 kB
createApp 54.6 kB 21.3 kB 19.4 kB
createSSRApp 58.8 kB 23 kB 21 kB
defineCustomElement 59.3 kB (-58 B) 22.9 kB (-16 B) 20.8 kB (-21 B)
overall 68.6 kB 26.4 kB 24 kB

Copy link

pkg-pr-new bot commented Feb 11, 2025

Open in Stackblitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@12855

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@12855

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@12855

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@12855

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@12855

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@12855

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@12855

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@12855

@vue/shared

npm i https://pkg.pr.new/@vue/shared@12855

vue

npm i https://pkg.pr.new/vue@12855

@vue/compat

npm i https://pkg.pr.new/@vue/compat@12855

commit: bf5cca9


if (!(this._def as ComponentOptions).__asyncLoader) {
// for sync component defs we can immediately resolve props
this._resolveProps(this._def)
Copy link
Member Author

Choose a reason for hiding this comment

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

the following code will overwrite the props value

for (let i = 0; i < this.attributes.length; i++) {
this._setAttr(this.attributes[i].name)
}

so it should be resolved in the connectedCallback

@edison1105 edison1105 added ready to merge The PR is ready to be merged. 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. scope: custom elements labels Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. ready to merge The PR is ready to be merged. scope: custom elements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong value type in initial render bacause of attribute reflection from vue custom element
1 participant