-
Notifications
You must be signed in to change notification settings - Fork 49
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 5 Infinite Effect / Reactive Loop #484
Comments
@pingu-codes Thanks for figuring out the problem; we really appreciate it! We'll try it out soon and release a new version. |
@pingu-codes Thanks for the suggestion. I just released |
Hey @lee00678, it looks like it's largely the same problem for all of them, I suspect it's the same for all the components with separate if (config[`${e.__type__}Axis`] === c)
return;
}
// ...
if (config.crosshair === c) {
return;
} |
After some testing... this kills the reactivity of the graph when the data changes. |
Ok, took a longer look this morning. I believe the fixes I suggested are correct. The reason the graphs no longer rerender when the data changes is the |
@pingu-codes Thanks for the update! I will give it a try today and keep you informed. |
@pingu-codes @rokotyan Just released 1.5.0-beta.3 with suggested fix. I've pushed the changes to my branch as well. qian/svelte-bug-fix. Did some quick testing, seems everything is working! Please feel free to test and let me know if there is anything I missed. @pingu-codes once again, thanks for your contribution. If you want to submit a PR for all the above suggested changes so we can credit you, feel free to do so! |
Is it ok if I grab your branch and copy over the commits so that I get the versioning and styling correct without worrying about it :) |
Yea, definitely. |
I've opened up the PR #487 👍 |
Using svelte 5 with unovis causes an infinite reactive loop if more than 1 x/y component is rendered. The cause of this is the
component
action set within the xy container context:Due to svelte 5's deeper reactivity the update function is called when data is added to one of the child line components, as a result of this the config.components pushes a duplicate component to
config.components
and an infinite loop begins and pushes duplicates to config.components.A fix for this is simply preventing the update function from writing duplicates to
config.components
The text was updated successfully, but these errors were encountered: