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

feat: v-skip #12767

Draft
wants to merge 31 commits into
base: minor
Choose a base branch
from
Draft

feat: v-skip #12767

wants to merge 31 commits into from

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Jan 22, 2025

RFC vuejs/rfcs#714

Implementation

  • The v-skip directive is compiled into a conditional expression
  • When the condition is true
    • If the container is a native element, render its children directly
    • If the container is a component, render its default slot
  • When the condition is false, the original DOM structure is preserved/maintained

Usage Restrictions

  • Cannot be used on <template> or <slot> tags
  • Components must have a default slot without slot props
  • Cannot be used together with v-for

Copy link

github-actions bot commented Jan 22, 2025

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 101 kB (+150 B) 38.3 kB (+64 B) 34.5 kB (+68 B)
vue.global.prod.js 161 kB (+1.87 kB) 58.7 kB (+586 B) 52.2 kB (+492 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 47 kB 18.4 kB 16.8 kB
createApp 55.4 kB 21.5 kB 19.6 kB
createSSRApp 59.6 kB 23.2 kB 21.1 kB
defineCustomElement 60.2 kB 23.1 kB 21 kB
overall 69.5 kB 26.6 kB 24.2 kB

Copy link

pkg-pr-new bot commented Jan 22, 2025

Open in Stackblitz

@vue/compiler-core

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

@vue/compiler-dom

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

@vue/compiler-sfc

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

@vue/compiler-ssr

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

@vue/reactivity

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

@vue/runtime-core

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

@vue/runtime-dom

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

@vue/server-renderer

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

@vue/shared

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

vue

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

@vue/compat

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

commit: 80b32bf

@edison1105 edison1105 marked this pull request as ready for review January 24, 2025 01:21
@edison1105 edison1105 changed the base branch from main to minor January 24, 2025 01:21
@edison1105 edison1105 changed the base branch from minor to main January 24, 2025 01:23
@edison1105 edison1105 changed the base branch from main to minor January 24, 2025 01:23
@edison1105 edison1105 marked this pull request as draft January 24, 2025 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant