-
-
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
feat: add $inspect.trace rune #14290
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: c3428fc 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 |
|
WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP
preview: https://svelte-dev-git-preview-svelte-14290-svelte.vercel.app/ this is an automated message |
Perhaps instead of having it compile to this: $.user_effect(()=>{
return $.trace(()=>stuff, "name")
}); It could instead use a
And then the code could instead compile to: $.trace_effect(()=>stuff, "name"); I'm not sure how this will change in terms of performance (which shouldn't matter too much since its only running in dev mode), but it should result in less and simpler code. |
This PR has compiled to that output for a while now. Worth checking it out again sometime :)
It wouldn't make anything simpler with the new design. |
Co-authored-by: Rich Harris <[email protected]>
Co-authored-by: Rich Harris <[email protected]>
Co-authored-by: Rich Harris <[email protected]>
Co-authored-by: Rich Harris <[email protected]>
@Rich-Harris Feel free to apply your local changes to this PR if that's easier. |
Closes #14265. This adds the
$inspect.trace
rune to Svelte which logs the reactive graph of the current reactive context. It must be placed in a block statement and requires a string passed as an argument which is the trace name.