-
Notifications
You must be signed in to change notification settings - Fork 743
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
Replaces the side debug bar with a live object view #781
Replaces the side debug bar with a live object view #781
Conversation
…popey456963/boardgame.io into feature/json-tree-in-debug-menu
The latest commit replaces the Before this is merged, one of these should be removed from the package.json file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @popey456963. And I think I’ve figured it out 🤞
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @popey456963 — I’ve merged in that change to use require
instead of import
when including the JSON Tree component, which has fixed the failing tests. Here are a few small changes to tidy this up and get it ready to merge. Cheers!
`svelte-json-tree-auto` causes errors in tests (see #781). I think this might have something to do with the fact that the tree has circular dependencies, which perhaps the Jest transformer can’t handle. As it’s a third-party library, we can probably do without it during tests, and this change replaces it with an empty Svelte component for tests.
* fix(debug): Import JSON tree Svelte component to fix runtime error Relying on the compiled JavaScript of the JSON Tree component caused runtime errors. The best explanation I’ve read is here: <sveltejs/svelte#3671 (comment)> * test(debug): Mock `svelte-json-tree-auto` in tests `svelte-json-tree-auto` causes errors in tests (see #781). I think this might have something to do with the fact that the tree has circular dependencies, which perhaps the Jest transformer can’t handle. As it’s a third-party library, we can probably do without it during tests, and this change replaces it with an empty Svelte component for tests. * test(debug): Add interactivity test for Debug panel
Fixes #775
This pull request replaces with the
JSON.stringify()
state and ctx sections with a liveJSONTree
view, which allows you to minimise / maximise attributes. This should help cases where the state is very large.We use a custom package that is two lines different from the default to:
Otherwise
ctx
andstate
start minimised even if they only contain a few elements which is infuriating. A ticket has been raised on the original project to ask if they can provide a solution in-package.