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

perf(runtime-vapor): optimize setDOMProp on static tag + key #294

Merged
merged 10 commits into from
Dec 1, 2024

Conversation

edison1105
Copy link
Member

@edison1105 edison1105 commented Nov 29, 2024

compile changes:

  • If the attribute is innerHTML, use setHtml directly.
  • If the attribute is textContent, use setText directly.
  • If the attribute is value and the element is not progress or custom-element, use setValue directly.

runtime changes:

  • Simplify the internal logic of setDOMProp.
  • Add the setValue method.

Copy link

netlify bot commented Nov 29, 2024

Deploy Preview for vapor-repl ready!

Name Link
🔨 Latest commit 6d5bc43
🔍 Latest deploy log https://app.netlify.com/sites/vapor-repl/deploys/674bd869cf5464000876e6b4
😎 Deploy Preview https://deploy-preview-294--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 Nov 29, 2024

Deploy Preview for vapor-template-explorer ready!

Name Link
🔨 Latest commit 6d5bc43
🔍 Latest deploy log https://app.netlify.com/sites/vapor-template-explorer/deploys/674bd8691323ac0008977e7c
😎 Deploy Preview https://deploy-preview-294--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.

@edison1105 edison1105 changed the title perf(runtime-vapor): optimize setDOMProp on static tag + key WIP: perf(runtime-vapor): optimize setDOMProp on static tag + key Nov 29, 2024
@edison1105 edison1105 marked this pull request as draft November 29, 2024 08:42
Copy link

github-actions bot commented Nov 29, 2024

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 81 kB 28.4 kB 25.1 kB
runtime-dom.global.prod.js 100 kB 38 kB 34.2 kB
runtime-vapor.global.prod.js 47.8 kB (+156 B) 18.1 kB (+58 B) 16.6 kB (+48 B)
vue-vapor.global.prod.js 47.8 kB (+156 B) 18.1 kB (+59 B) 16.6 kB (+47 B)
vue.global.prod.js 158 kB 57.8 kB 51.4 kB

Usages

Name Size Gzip Brotli
createApp (CAPI only) 47.4 kB 18.4 kB 16.8 kB
createApp 55.5 kB 21.4 kB 19.5 kB
createVaporApp 27.7 kB (+815 B) 10.6 kB (+311 B) 9.74 kB (+280 B)
createSSRApp 59.5 kB 23.1 kB 21 kB
defineCustomElement 60.3 kB 23 kB 20.9 kB
overall 69.3 kB 26.5 kB 24.1 kB

@edison1105 edison1105 changed the title WIP: perf(runtime-vapor): optimize setDOMProp on static tag + key perf(runtime-vapor): optimize setDOMProp on static tag + key Nov 29, 2024
Copy link

pkg-pr-new bot commented Nov 29, 2024

Open in Stackblitzplayground

@vue/compiler-core

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/compiler-core@294

@vue/compiler-ssr

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/compiler-ssr@294

@vue/compiler-dom

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/compiler-dom@294

@vue/compiler-sfc

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/compiler-sfc@294

@vue/compiler-vapor

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/compiler-vapor@294

@vue/reactivity

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/reactivity@294

@vue/runtime-core

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/runtime-core@294

@vue/runtime-dom

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/runtime-dom@294

@vue/runtime-shared

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/runtime-shared@294

@vue/runtime-vapor

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/runtime-vapor@294

@vue/server-renderer

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/server-renderer@294

@vue/shared

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/shared@294

vue

npm i https://pkg.pr.new/vuejs/vue-vapor/vue@294

@vue/compat

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/compat@294

@vue/vapor

npm i https://pkg.pr.new/vuejs/vue-vapor/@vue/vapor@294

commit: 6d5bc43

if (value === oldVal) return

if (key === 'innerHTML' || key === 'textContent') {
// TODO special checks
Copy link
Member Author

@edison1105 edison1105 Nov 29, 2024

Choose a reason for hiding this comment

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

this special check is no longer necessary

@Doctor-wu Doctor-wu mentioned this pull request Nov 30, 2024
19 tasks
@edison1105 edison1105 marked this pull request as ready for review November 30, 2024 12:41
@LittleSound LittleSound merged commit 0196e1a into vuejs:main Dec 1, 2024
10 checks passed
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.

3 participants