chore: failed attempt for binding+events order #11229
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is attempt 1 to fix #11138. The idea is that actions, bindings and event directives are added to the "spread attributes" function. That function then first sets all attributes, collects event attributes, then runs actions/bindings/event handlers, and then runs event attributes, to guarantee that event attributes run last.
The sad thing is that it doesn't work. The problem is that bindings or actions could have effects inside them, and those effects would then be tied to the render effect surrounding the "spread attributes" function, and not to the block effect above it, leading to wrong rerun/destroy timings.
I'm pushing this up anyway to document why we can't go in that direction, or maybe someone else tells me there's still a way forward with that approach. In the meantime I'll search for a different approach.
Before submitting the PR, please make sure you do the following
feat:
,fix:
,chore:
, ordocs:
.Tests and linting
pnpm test
and lint the project withpnpm lint