google / google/playground-elements
Refresh feels too aggressive
- Dominant language
- TypeScript
- Stars
- 648
- Forks
- 61
- PR merge metrics
- No merged PRs in 30d
Description
There's still something not great about the refresh timing.
Since https://github.com/google/playground-elements/pull/142 we now compile/reload very responsively -- basically on every keystroke.
This makes it ultra responsive in many cases, but also means the preview is often blank because it's *constantly* reloading. And many of those states are invalid, because you're midway through writing out some new code, so the console is spammed with errors, and the preview often can't actually display anything.
I wonder if we should bump the debounce window back up a bit. It's currently faster than I can type. It feels like the preview should only update when I finish writing out my thought.
We should probably also not trigger a reload if there are syntax errors in TypeScript. A downside of this is that we have to wait for the compile to finish before we start loading -- whereas right now we are fully streaming (the `index.html` starts loading even before the compile is done). Maybe this streaming behavior is not actually much of a win. Or if it is, maybe we could actually have *two* iframes. That way we could start loading the next version immediately, and swap it in once we know there are no syntax errors (warning: this may be more complexity than it is worth).
Contributor guide
Assessment
This issue has not been assessed yet.