-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
fix(playground) app shouldn’t crash while user is typing #9316
base: master
Are you sure you want to change the base?
Conversation
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.
Have you tested if this still works after minification? Ie running ‘yarn build-staging’ rather than ‘yarn start’ in website ?
}, | ||
|
||
postProcessConvertedJson: json => { | ||
// Filter out invalid props. Typically, props will be invalid while the user is typing. |
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.
There are several ways to address this.
Perhaps we could make deck more resilient and not fail on one bad component...
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.
True. I figured it was for a bit of perf gains, and to keep things simpler. It could be argued that only something like this json
module would need validation since here the end user is hooking into props directly whereas most apps have some abstraction in-between.
On the flip side, validation can be this simple.
Is it the check for |
Background
The playground currently crashes as the user is typing. For example, an empty object, like
layers: [ { } ]
, will be parsed as a plain object and passed to deck, which, of course will throw an error.Change List