Open huntabyte opened 1 month ago
Cloning the repo locally i can't seem to reproduce...what are the reproduction steps?
This one is probably a duplicate of 13423
So, I was able to reproduce it, but I'm not sure if it's the same reproduction as in this issue.
Here's a REPL
This happens when state is stored in a separate file from where it was declared/instantiated. I hope REPL will make it clear enough.
I wonder if it's actually a 'legit' svelte coding pattern...
Thanks for the REPL repro @someone2080 ! That's exactly when it appears to be happening when it shouldn't.
Hey team, are there any plans to allow users to shut some of these warnings up?
I understand they only run during DEV
, but they can still be quite annoying when they don't impact the functionality. I know we can ignore the compiler warnings via the svelte.config.js
, but I don't see a way to ignore these runtime logs.
So, I was able to reproduce it, but I'm not sure if it's the same reproduction as in this issue.
Here's a REPL
This happens when state is stored in a separate file from where it was declared/instantiated. I hope REPL will make it clear enough.
I wonder if it's actually a 'legit' svelte coding pattern...
Isn't one of the intended benefits of Svelte 5 runes that you can store state in any non-svelte component and use it elsewhere? If this isn't the intended behavior, what would be the correct way to distribute components that take state as props and modify them?
@coryvirok Yes, you are right. I'm using this method, too. Runes in this mode are very powerful; they remind me of SwiftUI state management. The issue here is that this also opened a rabbit hole.
I'm not a JS expert, but this warning was meant to prevent us from doing crazy things like in this REPL, we can do this thanks to the fact that JS objects are passed by reference.
Now, Svelte team has to find a way to track down where and how this Rune was declared and issue a valid warning, which to me looks like a huge lift.
I wonder if it's possible to remove this restriction altogether and use $bindable only for simple types if necessary (kinda crazy idea though).
Describe the bug
I'm getting the following message, telling me to consider
bind:
between the two components. However, I am, in fact, binding between the two.Reproduction
https://svelte.dev/playground/c27c1016f1f2423489568d9fb2271921?version=5.2.5
Logs
System Info
Severity
annoyance