-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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: ensure event precedence when spreading event attributes #9433
Conversation
🦋 Changeset detectedLatest commit: 42ce088 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should fix this differently and add them to the spread array instead like we do when there's a mix of normal and spread attributes. While doing that we could then investigate how to Code-Golf event delegation inside the spread method.
@dummdidumm Yeah, that's a good call. Would avoid the property lookup which is much nicer. Feel free to take over this PR. I think the bigger issue found is that snippets don't properly hydrate today because we don't serialize anchors in SSR (they look to be completely missing), plus I don't know why snippets are always blocks – they should only be if the snippet is dynamic, just like components work. |
…read also fixes an edge case bug with event hoistability
<button on:click={increment}>
clicks: {count}
</button>
<button on:click={increment} on:click={increment}>
clicks: {count}
</button> Then the first one would incorrectly determine that
|
…preserve backwards compatibility of ordering
Turns out we aren't correctly handling spreading of attributes when there's a delegated event. This was a bit more involved than I'd like as we had to ensure delegated events occurred before the spread, but it makes sense.