🌱 Just released Svelte Render Scan - a visual debugging tool that helps you track component re-renders in your app. Useful for debugging reactivity and performance issues in your Svelte apps! https://khromov.github.io/svelte-render-scan/
Post
Really awesome! I made it work in @storybook.js.org: 1. create simple wrapper - import Svelte Render Scan - pass-through the Story as children 2. add wrapper as a global decorator to Storybook's preview.js PS: @reinhold.is @xeho91.dev I followed examples from this issue github.com/storybookjs/...
1 repost5 likes
That's so dope! 🤩 Bringing debugging experience to next level. If @reinhold.is agrees, you could create a PR with adding this recipe to README
I'd be more than happy to! I also extended my use case a bit, so that the wrapper grabs a param (debug) from the URL and passes it as a props. While the Storybook router purges the param from the url, the state is preserved! Neat! bsky.app/profile/fubi...
thanks! I think the Icon is actually super-helpful for Storybook in particular (since it's an SPA). I just extended my example so that svelte-render-scan is only displayed when &debug query param exists. And initial state is set to off (here I had to provide a fallback false - let me check 1.0.4)
Oh that's cool! Sounds like a perfect use case for an addon 😉 Would be cooler if it was a Tool in the toolbar instead of a query param. storybook.js.org/docs/essenti...
@fubits.dev If you integrate this into the toolbar then you should be able to use the `<RenderScanObserver />` component directly. Just render/don't render it depending on on/off state.
@fubits.dev you wanna collaborate on a toolbar-based addon for this? 🤝🙂
@reinhold.is this 👆 was my decorators-for-Svelte example that I mentioned at the summit. I couldn’t find documentation for decorators in CSF but I think there were some examples in an issue or so, and that’s how I figured it out.