-
Notifications
You must be signed in to change notification settings - Fork 51
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
Svelte: Fix reactivity loops & crashes #487
Svelte: Fix reactivity loops & crashes #487
Conversation
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.
Thanks for the contribution! Let a few minor comments
packages/svelte/src/containers/xy-container/xy-container.svelte
Outdated
Show resolved
Hide resolved
@@ -38,6 +38,8 @@ | |||
let ref: HTMLDivElement | |||
|
|||
$: chart?.setData(data, true) | |||
// eslint-disable-next-line no-self-assign | |||
$: config.components = config.components |
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.
Do you know if there are there any drawbacks of doing this, e.g. extra re-renders when nothing changes or something like that?
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'm not sure it actually fixes what it was originally supposed to. My original issue was that the chart wasn't rerendering when child component data changes but this doesn't actually fix that. I'm not sure if it's intended that when a child components data is set the whole graph rerenders.
If it is it'll need a different fix and I can look into it lmk :)
CLA Assistant Lite bot ✅ All required contributors have signed the F5 CLA for this PR. Thank you! |
I have hereby read the F5 CLA and agree to its terms |
Just released 1.5.0-svelte.0. I tested it with a simple Svelte 5 project, seems to be working for me. |
@pingu-codes This PR looks good. Do you mind cleaning up the commit history (part of my fault as well)? You can either squash it or overwrite the history and do a force push to the branch. |
93606df
to
5f6fc99
Compare
Yep, just squashed the commits! |
Do you think I should remove the changes to the package-lock.json on website too as it seems to include a lot of changes not really related to the fix? |
I would rebase onto the latest |
Yea, I would rebase from |
5f6fc99
to
dc188c7
Compare
…reset animation frame variable properly
dc188c7
to
5f9db98
Compare
Did you handle the changes with your push @lee00678 sorry I've been really busy the last few days. I'm pretty bad at github tbh (mainly use graphite at my work) so I don't want to break anything if you've made the changes you need 😅 |
I got it! No worries. We are good on this PR. Thanks for the contribution. I went ahead and fixed it because we want to release 1.5 on Monday. |
This PR implements the changes discussed in #484 which fixes bugs that occur from Svelte 5's new reactivity system.