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: compound expression for v-on #60

Merged
merged 27 commits into from
Jan 8, 2024
Merged

Conversation

LittleSound
Copy link
Member

close: #57

Copy link

github-actions bot commented Dec 12, 2023

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 90.2 kB 34.3 kB 30.9 kB
runtime-vapor.global.prod.js 24.1 kB (+91 B) 9.16 kB (+26 B) 8.44 kB (+1 B)
vue-vapor.global.prod.js 60 kB (+1.04 kB) 20.7 kB (+463 B) 18.7 kB (+437 B)
vue.global.prod.js 147 kB 53.5 kB 47.8 kB

Usages

Name Size Gzip Brotli
createApp 50.7 kB 19.8 kB 18 kB
createSSRApp 54 kB 21.1 kB 19.2 kB
defineCustomElement 52.9 kB 20.5 kB 18.7 kB
vapor 24.1 kB (+89 B) 9.2 kB (+24 B) 8.47 kB (+34 B)
overall 64.1 kB 24.7 kB 22.5 kB

@LittleSound LittleSound marked this pull request as ready for review December 12, 2023 15:38
packages/compiler-vapor/src/generate.ts Outdated Show resolved Hide resolved
packages/compiler-vapor/src/generate.ts Outdated Show resolved Hide resolved
packages/compiler-vapor/src/generate.ts Outdated Show resolved Hide resolved
@LittleSound LittleSound marked this pull request as ready for review January 7, 2024 05:50
Comment on lines +1 to 13
import { getCurrentEffect, onEffectCleanup } from '@vue/reactivity'

export function on(
el: HTMLElement,
event: string,
handler: () => any,
options?: AddEventListenerOptions,
) {
el.addEventListener(event, handler, options)
if (getCurrentEffect()) {
onEffectCleanup(() => el.removeEventListener(event, handler, options))
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

The runtime of v-on has been changed to be driven by getCurrentEffect and onEffectCleanup.

@sxzz sxzz merged commit 26fee41 into main Jan 8, 2024
5 checks passed
@sxzz sxzz deleted the feat/vOn-compound-expression branch January 8, 2024 06:07
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.

[Directives] Compound expression for v-on
2 participants