vuejs / core-vapor

Vue Vapor is a variant of Vue that offers rendering without the Virtual DOM.
https://vapor-repl.netlify.app
MIT License
1.81k stars 86 forks source link

feat: implement v-once #195

Closed Jevon617 closed 4 months ago

Jevon617 commented 4 months ago

In the process of trying to implement v-once with v-for, v-if, and components, I found that using only variables to handle v-once

for createFor, createIf, andcreateComponent resulted in highly coupled code. Therefore, in this pull request, I attempted to

use the createOnce function in runtime to handle v-once uniformly. However, I'm not sure if this approach is feasible. If it is,

please provide me with some feedback, thanks.

Demo

netlify[bot] commented 4 months ago

Deploy Preview for vapor-repl ready!

Name Link
Latest commit c4ad1553acd18088e4693b02bca015cf5eb53b7d
Latest deploy log https://app.netlify.com/sites/vapor-repl/deploys/6630bca2b40732000801533b
Deploy Preview https://deploy-preview-195--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.

netlify[bot] commented 4 months ago

Deploy Preview for vapor-template-explorer ready!

Name Link
Latest commit c4ad1553acd18088e4693b02bca015cf5eb53b7d
Latest deploy log https://app.netlify.com/sites/vapor-template-explorer/deploys/6630bca26f36a40008272cfc
Deploy Preview https://deploy-preview-195--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.

github-actions[bot] commented 4 months ago

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 80.1 kB 28.2 kB 24.7 kB
compiler-vapor.global.prod.js 52.7 kB (+364 B) 18 kB (+75 B) 16.3 kB (+34 B)
runtime-dom.global.prod.js 94.8 kB 35.7 kB 32.2 kB
runtime-vapor.global.prod.js 45.3 kB (+288 B) 16.9 kB (+77 B) 15.5 kB (+76 B)
vue-vapor.global.prod.js 95.4 kB (+635 B) 33.4 kB (+150 B) 30.2 kB (+170 B)
vue.global.prod.js 152 kB 55 kB 49.2 kB

Usages

Name Size Gzip Brotli
createApp 54.8 kB 21.1 kB 19.2 kB
createSSRApp 58.2 kB 22.4 kB 20.4 kB
defineCustomElement 57.1 kB 21.8 kB 19.9 kB
vapor 45.4 kB (+286 B) 16.9 kB (+84 B) 15.5 kB (+69 B)
overall 68.6 kB 26.1 kB 23.6 kB
Jevon617 commented 4 months ago

Okay, thanks.