-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Deprecate {@debug }
...?
#14112
Comments
they're just different, maybe they can be combined into one with options (which would probably be ugly), or reside on one instance e.g. |
You can use $inspect({data}).with((type,...parts)=>{
console.log(...parts);
debugger; //if you want
})
I don't quite understand what you mean by this,
Perhaps, or maybe it could be a part of |
Good point but the ergonomics of this as far as the
Oh, never saw this since I've always had dev tools open and it would just pause. But, yeah, without debug open, it's reactive, although the effect implementation is different. Good point.
Maybe, just a rune called The other differences, from what I recall seeing in the issues is
TBH, while ultimately something will need to give, I think that having both stores and signals around is a much bigger confusion. |
To be honest, I think too many runes would lead to confusion and unnecessary complexity. This is why there's
After testing, I have found it to be deeply reactive, just like
|
Yeah, true, it would be in line with what has been done. It's just I also like
Interesting... maybe something has changed. Currently, just for posterity, there seems to be a compilation limitation for
Yeah, effects run in microtasks but there is definitely some difference, as in the playground example that I mentioned above, const stringified_text_1 = $.derived(() => $.inspect(() => [user.person.something.much.deeper], (type, ...rest) => {
console.log(...$.log_if_contains_state("log", type, ...rest));
}) ?? ""); vs $.template_effect(() => {
console.log({ user: $.snapshot(user) });
debugger;
}); |
This would be nice, but also problematic since Svelte 5 has already released; it wouldn't be very beneficial to introduce a breaking change two weeks after releasing a new version. Not to mention that
To be honest, this seems like a limitation of
I see what you mean, |
yeah, agreed. I thought maybe it's easier to introduce something new without changing what's been released and then deprecate. but, at this point, one way of doing things, whatever that ends up being would be great.
Yep, thought I'd point out all of the differences to hopefully help clarify the current behavior and make a good decision.
Looks like it. I took your example and just replaced |
Describe the problem
Svelte 5 introduced the
$inspect
rune, which has very similar functionality to the debug tag. This makes me question the necessity of the{@debug }
tag.Describe the proposed solution
I feel like the debug tag probably isn't needed, but the only thing that
{@debug }
has that$inspect
doesn't is the ability to log on every state change. I think the best way to replace this would be to just make calling$inspect
without any arguments have the same behavior.The only issue I see with doing this is that Svelte 5 has already released and this could upset some people.
Importance
nice to have
The text was updated successfully, but these errors were encountered: