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

fix some lifecycle hooks apis #216

Open
ubugeeei opened this issue May 19, 2024 · 2 comments · May be fixed by #258
Open

fix some lifecycle hooks apis #216

ubugeeei opened this issue May 19, 2024 · 2 comments · May be fixed by #258
Assignees
Labels
bug Something isn't working runtime test wontfix This will not be worked on

Comments

@ubugeeei
Copy link
Member

relates #215

There seem to be some points where the behavior differs from the original.
I added FIXME comments in packages/runtime-vapor/tests/apiLifecycle.spec.ts.

@ubugeeei ubugeeei added bug Something isn't working wontfix This will not be worked on runtime test labels May 19, 2024
@ubugeeei ubugeeei changed the title fix some lifecycle hooks api's fix some lifecycle hooks apis May 19, 2024
@LittleSound
Copy link
Member

LittleSound commented May 21, 2024

This issue looks like it's related to PR #123 ?

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

@LittleSound
Copy link
Member

If an update to a value is passed layer by layer from outside to inside, it will eventually only trigger the update hook of the component that actually uses the value. Such a design is obviously more efficient.

packages/runtime-vapor/tests/apiLifecycle.spec.ts | +319 to +327

// FIXME: not called
expect(calls).toEqual([
  // 'root beforeUpdate',
  // 'mid beforeUpdate',
  'child beforeUpdate',
  'child updated',
  // 'mid updated',
  // 'root updated',
])

But this design differs from core. How should we balance between the two?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working runtime test wontfix This will not be worked on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants