ruff/playground/src
Charlie Marsh a1da9da0ef
Avoid JSON parse error on playground load (#6519)
## Summary

On page load, the playground very briefly flickers a JSON parse error.
Due to our use of `useDeferredValue`, we attempt to parse the empty JSON
string settings, since after `const initialized = ruffVersion != null;`
returns true, we get one render with the stale deferred value.

This PR refactors the state, such that we start by storing `null` for
the `Source`, and use the `Source` itself to determine initialization
status.

## Test Plan

Set a breakpoint in the `catch` path in `Editor`; verified that it no
longer triggers on load (but did on `main`).
2023-08-12 04:11:44 +00:00
..
Editor Avoid JSON parse error on playground load (#6519) 2023-08-12 04:11:44 +00:00
constants.ts Fix lint issues 2022-12-29 23:12:28 -05:00
index.css Tweak background on theme button (#6290) 2023-08-03 01:00:37 +00:00
main.tsx playground: Add AST/Tokens/Formatter panels (#5859) 2023-07-19 14:46:08 +00:00
third-party.d.ts Use trailingComma: 'all' (#1457) 2022-12-29 19:36:51 -05:00
vite-env.d.ts Web playground with WASM (#1279) 2022-12-26 12:09:17 -05:00