Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Update toolchain #939

Merged
merged 65 commits into from
Jul 8, 2021
Merged

Update toolchain #939

merged 65 commits into from
Jul 8, 2021

Conversation

Marc-Andre-Rivet
Copy link
Contributor

@Marc-Andre-Rivet Marc-Andre-Rivet commented Mar 24, 2021

Depends on plotly/dash#1563
Fixes partially https://github.com/plotly/dash-core/issues/203

Related to plotly/dash-table#878

  • Update CircleCI images to newest available + bump py37 images to py39
  • Rewrites legacy tests with the dash_dcc fixture (except for test_dash_import which is just a pure unit test)
  • Add dash_dcc.get_logs() assert to tests that don't have one (uncovered 5 tests that were broken or at least badly configured by adding that check)
  • Proposes to 🔪 the Jest tests (the carrying cost for these has been high on every non-trivial toolchain update and the benefit they bring isn't clear.. I will review the tests content and see if some should be rewritten as integration tests.. more to come)
  • General toolchain updates
  • Post merge need to remove ci/circleci: test-legacy-xx, ci/circleci: test-37, and ci/circleci: lint-unit-37 checks

TODO (ACJ 2021-07-07): five percy snapshots still have problems:

  • styled input - width: 100%, border-color: hotpink -> missing styles?
  • mkdw002 - markdowns display -> missing images, title_crumb shows up as link text
  • mkdw001 - image display -> no image (should there only be one as in baseline? or two?)
  • slsl005- dcc.RangeSlider tooltip position -> bad tooltip positions
  • dtpr005 - disabled days -> first chosen day changed color

find . -name "dash_*.gz" | xargs pip install -I --progress-bar off --no-cache-dir
pip install --no-cache-dir --progress-bar off main.tar.gz[dev,testing]
pip list | grep dash | xargs pip show && cd ..
echo $(python -V 2>&1) | grep 3. && python -m unittest tests/test_dash_import.py
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,5 +1,5 @@
[flake8]
ignore = C901, E203, E266, E501, E731, W503
ignore = C901, E203, E231, E266, E501, E731, W503
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black/flake8 disagreement about spaces after trailing comma. Black wins over Flake8, same as in the dash-table.

include dash_core_components/async-*.js
include dash_core_components/async-*.js.map
include dash_core_components/*.js
include dash_core_components/*.js.map
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is consistent with what is being done in other repos and how these deps are published in the npm package.

@@ -76,18 +76,18 @@
_js_dist.extend(
[
{
"relative_package_path": "{}.min.js".format(__name__),
"relative_package_path": "{}.js".format(__name__),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There hasn't been a dev vs. prod build of this package since we've moved prop-types from the component packages to the dash-renderer.

"file-saver": "^2.0.2",
"highlight.js": "^10.3.1",
"moment": "^2.20.1",
"base64-js": "^1.5.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update everything to latest except for react-dates and react-dropzone major bumps that cause props and visual changes. Bumping those should be part of a future general Dash 2.x discussion

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dunno if we have appetite for this in Dash 2, but we should at least discuss.

},
"devDependencies": {
"@babel/cli": "^7.4.0",
"@babel/core": "^7.4.0",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are redundant with recent versions of babel

"component-playground": "^3.0.0",
"copyfiles": "^2.0.0",
"css-loader": "^1.0.1",
"enzyme": "^3.7.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enzyme and Jest 🔪

@@ -2,12 +2,11 @@

import pytest
import dash
from dash.testing import wait
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to use the common wait function instead of the dcc home-brewed one

"prettier": "^2.3.2",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-jsx-parser": "1.21.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pinned - upgrading react-jsx-parser to 1.28 breaks dcc.Markdown with html allowed.

@@ -159,7 +159,7 @@ def test_slsl005_slider_tooltip(dash_dcc):
style=dict(height=100),
),
],
style=dict(maxHeight=300, overflowX="scroll"),
style=dict(maxHeight=300, overflowX="scroll", width=400),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slider tooltips don't render correctly on Percy. They do pretty well when the width is locked like this, though there's still a bit of an offset. But when the width is set by the page they're way off: Most of the slider, and its handles, are positioned in percentages but the tooltips are positioned in pixels. Ironic, because the tooltips and handles could have used the same positioning logic: left: <some %>; transform: translateX(-50%). But when Percy picks this up it rerenders the page with a different width and pixels and % no longer have the same relationship at all.

I suspect there's a real bug here, perhaps if your slider is subject to CSS scaling or if you change its width through a style prop after rendering; but I haven't tested it. Sliders do update correctly when their width updates as the window is resized though, which is the most important use case.

@alexcjohnson alexcjohnson requested review from eff-kay and removed request for rpkyle July 8, 2021 01:18
@@ -42,6 +42,8 @@ def test_cdpr001_date_clearable_true_works(dash_dcc):
(single_date,) = dash_dcc.get_date_range("dps")
assert not single_date, "date should be cleared"

assert dash_dcc.get_logs() == []
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

helpful message on assertion failure.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pattern we use at the end of most tests - it just means "there are no errors in the JS console"

We could probably make it clearer to read though by building this directly into the fixture, like:

dash_duo.assert_clean_console()

(dash_dcc is a dash_duo clone with some dcc-specific additions. I say clone because it behaves like a subclass but isn't really... the subclassing happens one layer down.)

@eff-kay
Copy link

eff-kay commented Jul 8, 2021

LGTM

@alexcjohnson alexcjohnson merged commit 5c20c14 into dev Jul 8, 2021
@alexcjohnson alexcjohnson deleted the update-toolchain-20210322 branch July 8, 2021 21:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants