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: support usage of v-once with v-if #200

Merged
merged 4 commits into from
May 12, 2024

Conversation

lulu0119
Copy link
Contributor

@lulu0119 lulu0119 commented May 6, 2024

Implemented basic v-once support for v-if/else via a once flag, please review and advise if any scenarios are unaddressed.

Copy link

netlify bot commented May 6, 2024

Deploy Preview for vapor-repl ready!

Name Link
🔨 Latest commit 69a8908
🔍 Latest deploy log https://app.netlify.com/sites/vapor-repl/deploys/6640972cfb6c760008689828
😎 Deploy Preview https://deploy-preview-200--vapor-repl.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented May 6, 2024

Deploy Preview for vapor-template-explorer ready!

Name Link
🔨 Latest commit 69a8908
🔍 Latest deploy log https://app.netlify.com/sites/vapor-template-explorer/deploys/6640972c959908000831e243
😎 Deploy Preview https://deploy-preview-200--vapor-template-explorer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

packages/runtime-vapor/src/apiCreateIf.ts Outdated Show resolved Hide resolved
packages/compiler-vapor/src/generators/if.ts Outdated Show resolved Hide resolved
Copy link

github-actions bot commented May 6, 2024

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 80 kB 28.1 kB 24.7 kB
compiler-vapor.global.prod.js 55.5 kB (+60 B) 18.9 kB (+12 B) 17.1 kB (+37 B)
runtime-dom.global.prod.js 96.6 kB 36.5 kB 32.9 kB
runtime-vapor.global.prod.js 45.2 kB (+23 B) 16.9 kB (+32 B) 15.5 kB (+28 B)
vue-vapor.global.prod.js 97.9 kB (+83 B) 34.3 kB (+53 B) 30.9 kB (-2 B)
vue.global.prod.js 154 kB 55.8 kB 49.8 kB

Usages

Name Size Gzip Brotli
createApp 57 kB 21.9 kB 20 kB
createSSRApp 60.4 kB 23.3 kB 21.2 kB
defineCustomElement 59.3 kB 22.7 kB 20.7 kB
vapor 45.6 kB (+23 B) 16.9 kB (+25 B) 15.5 kB (+24 B)
overall 70.7 kB 26.9 kB 24.4 kB

@lulu0119
Copy link
Contributor Author

lulu0119 commented May 6, 2024

Thank you, sxzz, for helping me with the modifications.

@sxzz sxzz force-pushed the feat/v-once-with-v-if/else branch from fc638b8 to 69a8908 Compare May 12, 2024 10:17
@@ -36,7 +36,8 @@ export function genIf(
vaporHelper('createIf'),
conditionExpr,
positiveArg,
negativeArg,
negativeArg || (once ? 'null' : false),
Copy link
Member

Choose a reason for hiding this comment

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

Should add a placeholder if once is true but no negative branch.

@sxzz sxzz merged commit b3cb392 into vuejs:main May 12, 2024
8 checks passed
@sxzz sxzz changed the title feat: v-once support for v-if/else via a once flag feat: support usage of v-once with v-if May 12, 2024
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.

None yet

3 participants