plotly / dash-renderer

OBSOLETE has been merged into dash
https://github.com/plotly/dash
MIT License
97 stars 32 forks source link

another round of dev tools edits #155

Closed chriddyp closed 5 years ago

chriddyp commented 5 years ago

Improving the prop type error messages.

Previously image


Now image


image


image

chriddyp commented 5 years ago

The second set of commits simplifies the error boundaries. See 9010044 for details. In the previous version, we:

  1. wrapped the output component with an overlay. This could cause flow issues as the overlay wrapper was a div with display: block which doesn't necessarily match the wrapped component. For example, the output component could be a span (display: inline) in-line with other spans.
  2. Disabled the input components

This commit simplifies the logic: now we just display the previous state of the component (if available) without an overlay and without disabling the inputs.

This is similar to how the backend errors affect the frontend.

error-types

chriddyp commented 5 years ago

Now that we have nice error messages, the stack traces aren't as useful for the end user. I feel like they may even indicate to the user that the issue wasn't their fault but was something much more complicated. image

byronz commented 5 years ago

@chriddyp python3.x test errors are different than 2.7

======================================================================
ERROR: test_devtools_validation_errors (tests.test_render.Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/circleci/repo/tests/test_render.py", line 2647, in test_devtools_validation_errors
    self.wait_for_element_by_css_selector('.test-devtools-error-toggle').click()
  File "/home/circleci/repo/tests/test_render.py", line 60, in wait_for_element_by_css_selector
    'Could not find element with selector "{}"'.format(selector)
  File "/home/circleci/repo/venv/lib/python3.7/site-packages/selenium/webdriver/support/wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: Could not find element with selector ".test-devtools-error-toggle"
chriddyp commented 5 years ago

alright - those tests have been fixed and several more have been added

byronz commented 5 years ago

💃 avant dodo