Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@edison1105
Copy link
Member

@edison1105 edison1105 commented Sep 14, 2023

close #9200
close #9308
close #7256

note:
Both slot fallback and slot nodes are stable fragments but can not take the fast path.

solution:

  • always unmount the old vnode and mount the new one.

@github-actions
Copy link

github-actions bot commented Sep 14, 2023

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 90.7 kB (+66 B) 34.5 kB (+25 B) 31.1 kB
vue.global.prod.js 148 kB (+66 B) 53.8 kB (+21 B) 48 kB (-38 B)

Usages

Name Size Gzip Brotli
createApp 50.8 kB (+54 B) 19.9 kB (+21 B) 18.1 kB (+22 B)
createSSRApp 54.2 kB (+54 B) 21.2 kB (+20 B) 19.3 kB (+17 B)
defineCustomElement 53.1 kB (+54 B) 20.6 kB (+20 B) 18.8 kB (+28 B)
overall 64.5 kB (+54 B) 24.9 kB (+24 B) 22.5 kB (-31 B)

@edison1105 edison1105 changed the title fix(runtime-core): avoid tracking slot fallback node as block fix(runtime-core): force full diff slot and fallback nodes Sep 29, 2023
test: add test case

chore: improve code

chore: update test

chore: update test
@edison1105
Copy link
Member Author

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Apr 16, 2024

πŸ“ Ran ecosystem CI: Open

suite result latest scheduled
language-tools βœ… success βœ… success
nuxt βœ… success βœ… success
pinia βœ… success ❌ failure
quasar βœ… success βœ… success
radix-vue βœ… success βœ… success
router βœ… success βœ… success
test-utils βœ… success βœ… success
vant βœ… success βœ… success
vite-plugin-vue βœ… success βœ… success
vitepress βœ… success βœ… success
vue-i18n βœ… success βœ… success
vue-macros βœ… success βœ… success
vuetify ❌ failure βœ… success
vueuse βœ… success βœ… success
vue-simple-compiler βœ… success βœ… success

Copy link
Contributor

@skirtles-code skirtles-code left a comment

Choose a reason for hiding this comment

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

I'm wondering whether we should completely avoid slot content being paired against fallback content in the diff? I don't think users expect elements/components to be reused in this way and it seems bug prone.

Consider this example:

A similar example using a stateful child component:

@edison1105 edison1105 changed the title fix(runtime-core): force full diff slot and fallback nodes fix(runtime-core): properly diff slot node and fallback node Jun 10, 2024
Comment on lines 41 to 48
const vnode = createVNode(
'slot',
props,
fallback && fallback(),
fallback ? PatchFlags.BAIL : undefined,
)
vnode.isSlotFallback = !!fallback
return vnode
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this part of the change. For custom elements, wouldn't switching between the slot content and the fallback be handled natively by the browser, rather than by the renderer? The presence of a fallback doesn't necessarily mean that it is being shown in the component, we render it inside the native <slot> either way and let the browser do the rest.

If this is needed then there should probably be a test for it. It seems that the current tests pass even without this change.

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

@edison1105
Copy link
Member Author

/ecosystem-ci run

@vue-bot
Copy link
Contributor

vue-bot commented Jun 22, 2024

πŸ“ Ran ecosystem CI: Open

suite result latest scheduled
language-tools βœ… success ❌ failure
nuxt βœ… success βœ… success
pinia βœ… success βœ… success
primevue βœ… success βœ… success
quasar βœ… success βœ… success
radix-vue βœ… success βœ… success
router βœ… success βœ… success
test-utils βœ… success βœ… success
vant ❌ failure βœ… success
vite-plugin-vue βœ… success βœ… success
vitepress βœ… success βœ… success
vue-i18n βœ… success βœ… success
vue-macros βœ… success βœ… success
vuetify βœ… success βœ… success
vueuse βœ… success βœ… success
vue-simple-compiler βœ… success βœ… success

@jh-leong jh-leong mentioned this pull request Jul 4, 2024
@yyx990803 yyx990803 closed this in d76dd9c Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Rejected

6 participants