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(compiler-core): fix for :key shorthand patchflag #10939

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Doctor-wu
Copy link
Contributor

close #10882

Copy link

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 90.7 kB 34.5 kB 31.1 kB
vue.global.prod.js 148 kB (+6 B) 53.7 kB (+2 B) 48.1 kB (+46 B)

Usages

Name Size Gzip Brotli
createApp 50.8 kB 19.9 kB 18.1 kB
createSSRApp 54.1 kB 21.2 kB 19.3 kB
defineCustomElement 53.1 kB 20.6 kB 18.8 kB
overall 64.5 kB 24.9 kB 22.6 kB

@quiteeasy
Copy link
Contributor

In this PR, we lose the actual reference to the .exp property from the :key resolved in transformElement.ts within the returned function. As a result, the keyProperty injected as a prop in the vFor.ts exit function no longer references the actual expression of keyProp.

This change introduces bugs when we set :key on a <template> element, as the :key is not correctly attached to its children, same for other elements, they have a wrong .exp reference.

To address this issue, I have opened a PR that properly resolves the :key shorthand. Please review the PR and share your thoughts. Thank you.

Copy link
Contributor

@quiteeasy quiteeasy left a comment

Choose a reason for hiding this comment

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

check #10942

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.

:key shorthand incorrectly compiles to UNKEYED_FRAGMENT
2 participants