From d3d7933fdc96fdb164a253430a66e1942fa4cea6 Mon Sep 17 00:00:00 2001 From: Ashwin Prakash Nalwade <53330017+ashwinpn@users.noreply.github.com> Date: Mon, 24 Feb 2020 23:06:31 -0500 Subject: [PATCH 1/6] Added words to make the sentence valid. *....the prop values will not be stored with components * without an ID --- dash-renderer/src/persistence.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dash-renderer/src/persistence.js b/dash-renderer/src/persistence.js index 39bd011854..3dee8cafae 100644 --- a/dash-renderer/src/persistence.js +++ b/dash-renderer/src/persistence.js @@ -3,8 +3,9 @@ * * When users input new prop values, they can be stored and reapplied later, * when the component is recreated (changing `Tab` for example) or when the - * page is reloaded (depending on `persistence_type`) Storage is tied to - * component ID and will not on with components without an ID. + * page is reloaded (depending on `persistence_type`). Storage is tied to + * component ID, and the prop values will not be stored with components + * without an ID. * * Renderer handles the mechanics, but components must define a few props: * From 31362e231c4e6676fd39132b42eb3f17db30f1f8 Mon Sep 17 00:00:00 2001 From: Shammamah Hossain Date: Wed, 26 Feb 2020 12:35:26 -0500 Subject: [PATCH 2/6] Add Windows CircleCI job. --- .circleci/config.yml | 44 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f1d5e193cb..59fb901eb3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,4 +1,6 @@ -version: 2 +version: 2.1 +orbs: + win: circleci/windows@2.4.0 jobs: percy-finalize: docker: @@ -183,6 +185,45 @@ jobs: environment: PYVERSION: python27 + build-windows-37: &build-windows + working_directory: ~/dash + executor: + name: win/default + shell: bash.exe + environment: + PYVERSION: python37 + steps: + - checkout + - run: echo $PYVERSION > ver.txt + - restore_cache: + key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }} + - run: + name: ️️🏗️ pip dev requirements + command: | + pip install --upgrade virtualenv + virtualenv venv + source venv/Scripts/activate + sed -i '/dash-/d' requires-install.txt + pip install -e . --no-cache-dir -r requires-install.txt -r requires-dev.txt -r requires-testing.txt --progress-bar off + - save_cache: + key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }} + paths: + - venv + - run: + name: ️️🏗️ build core + command: | + source venv/Scripts/activate && pip install --no-cache-dir --upgrade -e . --progress-bar off && mkdir packages + cd dash-renderer && renderer build && python setup.py sdist && mv dist/* ../packages/ && cd .. + git clone --depth 1 --branch update-webpackconfig https://github.com/plotly/dash-core-components.git + cd dash-core-components && npm ci && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd .. + git clone --depth 1 https://github.com/plotly/dash-renderer-test-components + cd dash-renderer-test-components && npm ci && npm run build:all && python setup.py sdist && mv dist/* ../packages/ && cd .. + ls -la packages + - persist_to_workspace: + root: ~/dash + paths: + - packages/*.tar.gz + test-37: &test working_directory: ~/dash docker: @@ -246,6 +287,7 @@ workflows: jobs: - lint-unit-37 - build-core-37 + - build-windows-37 - build-misc-37 - test-37: requires: From 8507f654de2754962913cc215049983af9325ad2 Mon Sep 17 00:00:00 2001 From: Chris Parmer Date: Thu, 27 Feb 2020 10:16:42 -0500 Subject: [PATCH 3/6] :wrench: allow gzip to be set via env (#1133) * :wrench: allow gzip to be set via env * :pencil: update changelog --- CHANGELOG.md | 4 ++++ dash/_configs.py | 3 ++- dash/dash.py | 6 ++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6028f4751c..82386318d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to `dash` will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [Unreleased] +### Added +- [#1133](github.com/plotly/dash/pull/1133) Allow the `compress` config variable to be set with an environment variable with DASH_COMPRESS=FALSE + ## [1.9.0] - 2020-02-04 ### Fixed - [#1080](https://github.com/plotly/dash/pull/1080) Handle case where dash fails to load when used inside an iframe with a sandbox attribute that only has allow-scripts diff --git a/dash/_configs.py b/dash/_configs.py index c93fca5eba..0c4fae55b4 100644 --- a/dash/_configs.py +++ b/dash/_configs.py @@ -29,12 +29,13 @@ def load_dash_env_vars(): 'DASH_HOT_RELOAD_MAX_RETRY', 'DASH_SILENCE_ROUTES_LOGGING', 'DASH_PRUNE_ERRORS', + 'DASH_COMPRESS' ) } ) -DASH_ENV_VARS = load_dash_env_vars() +DASH_ENV_VARS = load_dash_env_vars() # used in tests def get_combined_config(name, val, default=None): diff --git a/dash/dash.py b/dash/dash.py index 679ed0ee9a..4a702aab6d 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -221,7 +221,7 @@ def __init__( requests_pathname_prefix=None, routes_pathname_prefix=None, serve_locally=True, - compress=True, + compress=None, meta_tags=None, index_string=_default_index, external_scripts=None, @@ -276,7 +276,9 @@ def __init__( routes_pathname_prefix=routes_prefix, requests_pathname_prefix=requests_prefix, serve_locally=serve_locally, - compress=compress, + compress=get_combined_config( + "compress", compress, True + ), meta_tags=meta_tags or [], external_scripts=external_scripts or [], external_stylesheets=external_stylesheets or [], From 3c8c96bf58ea8db6d055e2d2fd732d6f282628ad Mon Sep 17 00:00:00 2001 From: Shammamah Hossain Date: Thu, 27 Feb 2020 11:48:44 -0500 Subject: [PATCH 4/6] Remove branch name. --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 59fb901eb3..2fa41ef72f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -214,7 +214,7 @@ jobs: command: | source venv/Scripts/activate && pip install --no-cache-dir --upgrade -e . --progress-bar off && mkdir packages cd dash-renderer && renderer build && python setup.py sdist && mv dist/* ../packages/ && cd .. - git clone --depth 1 --branch update-webpackconfig https://github.com/plotly/dash-core-components.git + git clone --depth 1 https://github.com/plotly/dash-core-components.git cd dash-core-components && npm ci && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd .. git clone --depth 1 https://github.com/plotly/dash-renderer-test-components cd dash-renderer-test-components && npm ci && npm run build:all && python setup.py sdist && mv dist/* ../packages/ && cd .. From e1c9512081f41063c4e0197e26cb88897437c910 Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Thu, 27 Feb 2020 14:23:19 -0500 Subject: [PATCH 5/6] Update dash-renderer/src/persistence.js --- dash-renderer/src/persistence.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dash-renderer/src/persistence.js b/dash-renderer/src/persistence.js index 3dee8cafae..5d8059214f 100644 --- a/dash-renderer/src/persistence.js +++ b/dash-renderer/src/persistence.js @@ -4,7 +4,7 @@ * When users input new prop values, they can be stored and reapplied later, * when the component is recreated (changing `Tab` for example) or when the * page is reloaded (depending on `persistence_type`). Storage is tied to - * component ID, and the prop values will not be stored with components + * component ID, and the prop values will not be stored with components * without an ID. * * Renderer handles the mechanics, but components must define a few props: From 8f6bff39f721f285fa5e35dc72122165e300531f Mon Sep 17 00:00:00 2001 From: alexcjohnson Date: Thu, 27 Feb 2020 14:35:59 -0500 Subject: [PATCH 6/6] ~ to - in async script test --- tests/integration/test_scripts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/test_scripts.py b/tests/integration/test_scripts.py index 3900ea6979..9a9e6f2d91 100644 --- a/tests/integration/test_scripts.py +++ b/tests/integration/test_scripts.py @@ -36,7 +36,7 @@ def findSyncPlotlyJs(scripts): def findAsyncPlotlyJs(scripts): for script in scripts: - if "dash_core_components/async~plotlyjs" in script.get_attribute( + if "dash_core_components/async-plotlyjs" in script.get_attribute( 'src' ): return script