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(runtime-dom): height and width of all elements should be set as attribute #9763

Closed
wants to merge 1 commit into from

Conversation

zh-lx
Copy link
Contributor

@zh-lx zh-lx commented Dec 7, 2023

close #9762

Height and width of all elements should be set as attribute.

When set width and height for a custom element with width and height as prop, the width and height should be set as attribute.

And for elements without width and height as prop such as div, it won't affect the real height and width of them, but should be displayed as an attribute on the dom in html. Just as the following image:

image

Copy link

github-actions bot commented Dec 7, 2023

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 86.7 kB (-70 B) 33 kB (-38 B) 29.7 kB (-42 B)
vue.global.prod.js 133 kB (-70 B) 49.8 kB (-37 B) 44.6 kB (-33 B)

Usages

Name Size Gzip Brotli
createApp 48.2 kB (-70 B) 18.9 kB (-39 B) 17.3 kB (-44 B)
createSSRApp 51.4 kB (-70 B) 20.2 kB (-39 B) 18.4 kB (-36 B)
defineCustomElement 50.5 kB (-70 B) 19.7 kB (-41 B) 18 kB (-39 B)
overall 61.5 kB (-70 B) 23.8 kB (-38 B) 21.7 kB (+3 B)

@yyx990803
Copy link
Member

yyx990803 commented Dec 7, 2023

Thanks for the PR, but the root cause of this is that the previous logic was doing an early return and skipping the key in el check at the end. See 5b00286

@yyx990803 yyx990803 closed this Dec 7, 2023
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.

Width and height attrs problem
2 participants