Skip to content
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

feat: convert validation errors to console logs #4558

Merged
merged 6 commits into from
Mar 4, 2021

Conversation

adidahiya
Copy link
Contributor

@adidahiya adidahiya commented Mar 3, 2021

Checklist

  • Includes tests

Changes proposed in this pull request:

Replace most of the throw Error() statements in prop validation lifecycle with console.error() logs. Since the validation doesn't run in production, this change will allow developers test their components in a way that more closely matches what their users will see in a production build (they will be able to keep testing their component with invalid props rather than the page crashing).

Errors which remain unchanged (components would throw errors anyway if not for this early validation):

  • <Hotkeys> children validation
  • <MultiSlider> step size & children validation
  • <Toaster> maxToasts validation
  • <DateRangeInput> value validation
  • <Table> validation

See #3407 (comment)

@blueprint-bot
Copy link

fix core tests

Previews: documentation | landing | table

@blueprint-bot
Copy link

restore DRI error

Previews: documentation | landing | table

@blueprint-bot
Copy link

revert table validation changes

Previews: documentation | landing | table

@adidahiya adidahiya marked this pull request as ready for review March 4, 2021 00:54
@adidahiya adidahiya merged commit dcf9e5b into develop Mar 4, 2021
@adidahiya adidahiya deleted the ad/validation-errors branch March 4, 2021 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants