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: directive lifecycle hooks in v-for, v-if and component #123

Merged
merged 2 commits into from
May 26, 2024

Conversation

LittleSound
Copy link
Member

@LittleSound LittleSound commented Feb 8, 2024

Expected Behavior of Directive Lifecycle within v-for

Create Item

new item: created -> beforeMount -> mounted
other everyone: beforeUpdate -> updated
all events: beforeUpdate -> created -> beforeMount -> updated -> mounted

Remove Item

removed item: beforeUnmount -> unmounted
other everyone: beforeUpdate -> updated
all events: beforeUpdate -> beforeUnmount -> updated -> unmounted

Move Item

everyone: beforeUpdate -> updated

I've created new BlockEffectScope and createChildFragmentDirectives APIs that I hope will help make it easier to implement Lifecycle Hooks in Vapor. such as the lifecycle in slots or in components

Copy link

netlify bot commented Feb 8, 2024

Deploy Preview for vapor-repl ready!

Name Link
🔨 Latest commit 03c320d
🔍 Latest deploy log https://app.netlify.com/sites/vapor-repl/deploys/66538372208a8a000805dd9e
😎 Deploy Preview https://deploy-preview-123--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 Feb 8, 2024

Deploy Preview for vapor-template-explorer ready!

Name Link
🔨 Latest commit 03c320d
🔍 Latest deploy log https://app.netlify.com/sites/vapor-template-explorer/deploys/66538371321a79000868e79d
😎 Deploy Preview https://deploy-preview-123--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.

Copy link

github-actions bot commented Feb 8, 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 57 kB 19.4 kB 17.5 kB
runtime-dom.global.prod.js 94.9 kB (+1 B) 35.8 kB (+1 B) 32.3 kB (+11 B)
runtime-vapor.global.prod.js 47.4 kB (+1.77 kB) 17.7 kB (+613 B) 16.2 kB (+538 B)
vue-vapor.global.prod.js 101 kB (+1.77 kB) 35.6 kB (+617 B) 32 kB (+528 B)
vue.global.prod.js 152 kB (+1 B) 55.1 kB (+4 B) 49.2 kB (+15 B)

Usages

Name Size Gzip Brotli
createApp 55.3 kB (+4 B) 21.2 kB (+2 B) 19.4 kB (+1 B)
createSSRApp 58.6 kB (+4 B) 22.5 kB (+5 B) 20.5 kB (+7 B)
defineCustomElement 57.6 kB (+4 B) 21.9 kB 20 kB (-3 B)
vapor 47.8 kB (+1.78 kB) 17.8 kB (+609 B) 16.2 kB (+528 B)
overall 69.1 kB (+4 B) 26.2 kB (+1 B) 23.8 kB (+41 B)

@sxzz sxzz force-pushed the main branch 8 times, most recently from 8605d92 to 8a2a2ac Compare February 10, 2024 04:53
@LittleSound LittleSound changed the title feat: directive lifecycle hooks in v-for feat: directive lifecycle hooks in v-for/v-if Feb 25, 2024
@LittleSound
Copy link
Member Author

I created a Demo in Playground to test this feature

@LittleSound LittleSound marked this pull request as ready for review February 25, 2024 13:47
@sxzz sxzz force-pushed the feat/directive-hooks-with-v-for branch 2 times, most recently from 965f31b to cfca161 Compare March 1, 2024 10:34
@LittleSound LittleSound force-pushed the feat/directive-hooks-with-v-for branch 3 times, most recently from 76fbceb to 26ad63b Compare March 3, 2024 02:21
@LittleSound
Copy link
Member Author

Optimized the performance.

@LittleSound LittleSound force-pushed the feat/directive-hooks-with-v-for branch from 38c9d9f to f75e834 Compare April 9, 2024 16:20
@LittleSound LittleSound force-pushed the feat/directive-hooks-with-v-for branch 3 times, most recently from 2fa93ac to 63a2cd8 Compare April 23, 2024 11:11
@LittleSound LittleSound force-pushed the feat/directive-hooks-with-v-for branch from 63a2cd8 to 874dd8a Compare April 27, 2024 05:05
@LittleSound LittleSound force-pushed the feat/directive-hooks-with-v-for branch from 0a707c4 to 6de3a81 Compare May 21, 2024 04:04
@sxzz
Copy link
Member

sxzz commented May 26, 2024

Great job! Thank you for your contribution!

@sxzz sxzz merged commit b5ecb72 into main May 26, 2024
11 checks passed
@sxzz sxzz changed the title feat: directive lifecycle hooks in v-for/v-if feat: directive lifecycle hooks in v-for, v-if and component May 26, 2024
@sxzz sxzz deleted the feat/directive-hooks-with-v-for branch May 26, 2024 18:47
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.

2 participants