Skip to content

Commit cdbf2be

Browse files
author
Marc-André Rivet
committed
Merge remote-tracking branch 'origin/dev'
2 parents b89c85b + 8f2e58e commit cdbf2be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+20162
-23850
lines changed

.circleci/config.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- checkout
1616
- run: echo $PYVERSION > ver.txt
1717
- restore_cache:
18-
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
18+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
1919
- attach_workspace:
2020
at: ~/dash
2121
- store_artifacts:
@@ -34,15 +34,15 @@ jobs:
3434
- checkout
3535
- run: echo $PYVERSION > ver.txt
3636
- restore_cache:
37-
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
37+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
3838
- run:
3939
name: ️️🏗️ pip dev requirements
4040
command: |
4141
sudo pip install --upgrade virtualenv
4242
python -m venv venv || virtualenv venv && . venv/bin/activate
4343
pip install -e . -r requires-install.txt -r requires-dev.txt -r requires-testing.txt --quiet
4444
- save_cache:
45-
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
45+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
4646
paths:
4747
- "venv"
4848
- run:
@@ -55,10 +55,14 @@ jobs:
5555
pylint tests/unit tests/integration/devtools tests/integration/renderer tests/integration/dash_assets -d all -e C0410,C0411,C0412,C0413,W0109
5656
cd dash-renderer && npm install --ignore-scripts && npm run lint:test && npm run format:test
5757
- run:
58-
name: 🔎 Unit Tests
58+
name: 🐍 Python Unit Tests
5959
command: |
6060
. venv/bin/activate
6161
PYTHONPATH=~/dash/tests/assets pytest tests/unit
62+
- run:
63+
name: ☕ JS Unit Tests
64+
command: |
65+
cd dash-renderer && npm run test:js
6266
6367
"lint-unit-36":
6468
<<: *lint-unit
@@ -86,31 +90,33 @@ jobs:
8690
- checkout
8791
- run: echo $PYVERSION > ver.txt
8892
- restore_cache:
89-
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
93+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
9094
- run:
9195
name: ️️🏗️ pip dev requirements
9296
command: |
9397
sudo pip install --upgrade virtualenv
9498
python -m venv venv || virtualenv venv && . venv/bin/activate
99+
sed -i '/dash-/d' requires-install.txt
95100
pip install -e . -r requires-install.txt -r requires-dev.txt -r requires-testing.txt --quiet
96101
- save_cache:
97-
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
102+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
98103
paths:
99104
- "venv"
100105
- run:
101106
name: ️️🏗️ build core
102107
command: |
103108
. venv/bin/activate && pip install --upgrade -e . --quiet && mkdir packages
109+
cd dash-renderer && renderer build && pip uninstall -y dash-renderer && pip install -e . && python setup.py sdist && mv dist/* ../packages/ && cd ..
104110
python setup.py sdist && mv dist/* packages/
105-
cd dash-renderer && renderer build && python setup.py sdist && mv dist/* ../packages/ && cd ..
106111
git clone --depth 1 https://github.com/plotly/dash-core-components.git
107112
cd dash-core-components && npm install --ignore-scripts && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd ..
108113
git clone --depth 1 https://github.com/plotly/dash-renderer-test-components
109114
cd dash-renderer-test-components && npm install --ignore-scripts && npm run build:all && python setup.py sdist && mv dist/* ../packages/ && cd ..
115+
ls -la packages
110116
- persist_to_workspace:
111117
root: ~/dash
112118
paths:
113-
- packages
119+
- packages/*.tar.gz
114120

115121
"build-core-36":
116122
<<: *build-core
@@ -137,15 +143,15 @@ jobs:
137143
- checkout
138144
- run: echo $PYVERSION > ver.txt
139145
- restore_cache:
140-
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
146+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
141147
- run:
142148
name: ️️🏗️ pip dev requirements
143149
command: |
144150
sudo pip install --upgrade virtualenv
145151
python -m venv venv || virtualenv venv && . venv/bin/activate
146152
pip install -e . -r requires-install.txt -r requires-dev.txt -r requires-testing.txt --quiet
147153
- save_cache:
148-
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
154+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
149155
paths:
150156
- "venv"
151157
- run:
@@ -156,10 +162,11 @@ jobs:
156162
cd dash-table && npm install --ignore-scripts && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd ..
157163
git clone --depth 1 https://github.com/plotly/dash-html-components.git
158164
cd dash-html-components && npm install --ignore-scripts && npm run build && python setup.py sdist && mv dist/* ../packages/ && cd ..
165+
ls -la packages
159166
- persist_to_workspace:
160167
root: ~/dash
161168
paths:
162-
- packages
169+
- packages/*.tar.gz
163170

164171
"build-misc-36":
165172
<<: *build-misc
@@ -187,7 +194,7 @@ jobs:
187194
- checkout
188195
- run: echo $PYVERSION > ver.txt
189196
- restore_cache:
190-
key: dep-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
197+
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requires-dev.txt" }}-{{ checksum "requires-install.txt" }}-{{ checksum "requires-testing.txt" }}
191198
- attach_workspace:
192199
at: ~/dash
193200
- run:
@@ -262,4 +269,4 @@ workflows:
262269
- "test-27":
263270
requires:
264271
- build-core-27
265-
- build-misc-27
272+
- build-misc-27

.github/CODEOWNERS

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
# These owners will be the default owners for everything in
22
# the repo. Unless a later match takes precedence
3-
* @alexcjohnson @byronz @Marc-Andre-Rivet
4-
5-
tests/* @byronz
6-
7-
*.js @Marc-Andre-Rivet @alexcjohnson
8-
9-
_r_* @rpkyle
10-
11-
*.md @alexcjohnson
12-
13-
*.py @alexcjohnson @byronz
14-
15-
3+
* @alexcjohnson @byronz @Marc-Andre-Rivet
164

5+
_r_* @alexcjohnson @byronz @Marc-Andre-Rivet @rpkyle

CONTRIBUTING.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,30 @@ As of Dash 1.2, the renderer bundle and its peer dependencies can be packed and
3838
3. `renderer bundles` parses the locked version JSON, copies all the peer dependencies into dash_renderer folder, bundles the renderer assets, and generates an `__init__.py` to map all the resources. There are also a list of helpful `scripts` property defined in `package.json` you might need to do some handy tasks like linting, syntax format with prettier, etc.
3939
4. `renderer digest` computes the content hash of each asset in `dash_renderer` folder, prints out the result in logs, and dumps into a JSON file `digest.json`. Use this when you have a doubt about the current assets in `dash_renderer`, and compare it with previous result in one shot by this command.
4040
5. `renderer build` runs 1, 2, 3, 4 in sequence as a complete build process from scratch.
41-
6. `renderer watch` runs the webpack in watch mode, so any source code change triggers a rebuild. Use this if you are actively updating renderer code and you want to test your changes immediately.
41+
6. `renderer build local` runs the same order as in 5 and also generates source maps for debugging purposes. You also need to install dash-renderer with editable mode: `pip install -e .`.
4242

4343
When a change in renderer code doesn't reflect in your browser as expected, this could be: confused bundle generation, caching issue in a browser, python package not in `editable` mode, etc. The new tool reduces the risk of bundle assets by adding the digest to help compare asset changes.
4444

45+
## Python 2 And 3 Compatibility
46+
47+
Writing Python 2/3 compatible code might be a challenging task for contributors used to working on one particular version, especially new learners who start directly with Python 3.
48+
49+
From the #892, we started to adopt `python-future` instead of `six` as our tool to better achieve the goal where we can mainly write Python 3 code and make it back-compatible in Python 2.7 (last Python 2 version Dash supports before it gets deprecated).
50+
51+
Please refer to [this list of idioms](https://python-future.org/compatible_idioms.html "https://python-future.org/compatible_idioms.html") for more details on working with `python-future`.
52+
4553
## Git
4654

4755
Use the [GitHub flow](https://guides.github.com/introduction/flow/) when proposing contributions to this repository (i.e. create a feature branch and submit a PR against the default branch).
4856

4957
### Organize your commits
5058

51-
For pull request with notable file changes or a big feature developmennt, we highly recommend to organize the commits in a logical manner, so it
59+
For pull request with notable file changes or a big feature development, we highly recommend to organize the commits in a logical manner, so it
5260

5361
- makes a code review experience much more pleasant
5462
- facilitates a possible cherry picking with granular commits
5563

56-
*an intutive [example](https://github.com/plotly/dash-core-components/pull/548) is worth a thousand words.*
64+
*an intuitive [example](https://github.com/plotly/dash-core-components/pull/548) is worth a thousand words.*
5765

5866
#### Git Desktop
5967

@@ -106,15 +114,14 @@ Note: *You might find out that we have more integration tests than unit tests in
106114

107115
We introduced the `dash.testing` feature in [Dash 1.0](https://community.plot.ly/t/announcing-dash-testing/24868). It makes writing a Dash integration test much easier. Please read the [tutorial](http://dash.plot.ly/testing) and add relevant integration tests with any new features or bug fixes.
108116

109-
110117
## Financial Contributions
111118

112119
Dash, and many of Plotly's open source products, have been funded through direct sponsorship by companies. [Get in touch] about funding feature additions, consulting, or custom app development.
113120

114121
[Dash Core Components]: https://dash.plot.ly/dash-core-components
115122
[Dash HTML Components]: https://github.com/plotly/dash-html-components
116123
[write your own components]: https://dash.plot.ly/plugins
117-
[Dash Component Biolerplate]: https://github.com/plotly/dash-component-boilerplate
124+
[Dash Component Boilerplate]: https://github.com/plotly/dash-component-boilerplate
118125
[issues]: https://github.com/plotly/dash-core-components/issues
119126
[GitHub flow]: https://guides.github.com/introduction/flow/
120127
[semantic versioning]: https://semver.org/

dash-renderer/.babelrc

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
{
2-
"presets": ["es2015", "react", "stage-2"],
3-
"env": {
4-
"development": {
5-
"presets": ["es2015", "react", "stage-2"],
6-
"plugins": [
7-
["transform-es2015-modules-commonjs-simple", {
8-
"noMangle": true
9-
}]
10-
]
11-
}
12-
}
2+
"presets": [["@babel/preset-env", {
3+
"useBuiltIns": "usage",
4+
"corejs": 3
5+
}], "@babel/preset-react"]
136
}

dash-renderer/.eslintrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@
110110
"no-sequences": ["error"],
111111
"no-shadow": ["off"],
112112
"no-throw-literal": ["error"],
113-
"no-undefined": ["error"],
114113
"no-unused-expressions": ["error"],
115114
"no-use-before-define": ["error", "nofunc"],
116115
"no-useless-call": ["error"],
@@ -147,4 +146,4 @@
147146
"no-underscore-dangle": ["off"],
148147
"no-useless-escape": ["off"]
149148
}
150-
}
149+
}

dash-renderer/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [1.1.0] - 2019-09-17
6+
### Added
7+
- [#903](https://github.com/plotly/dash/pull/903) enables props edited by the user to persist across recreating the component or reloading the page. Components need to define three new props: `persistence`, `persisted_props`, and `persistence_type` as described in the lead comment of `src/persistence.js`. App developers then enable this behavior by, in the simplest case, setting `persistence: true` on the component. First use case is table, see [dash-table#566](https://github.com/plotly/dash-table/pull/566)
8+
9+
### Fixed
10+
- Reduced about 55% of the dash-renderer packages size on **PyPI** by removing the source maps. To do more advanced debugging, the source maps needs to be generated from source code with `npm run build:local` and pip install in editable mode, i.e. `pip install -e .` [#910](https://github.com/plotly/dash/pull/910)
11+
512
## [1.0.1] - 2019-08-27
613
- Clean all the binary assets in dash-renderer repo, add tool to build all the required bundles from fresh source code to avoid confusion of the assets and improve the release process. [#874](https://github.com/plotly/dash/pull/874)
714

dash-renderer/dash_renderer/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22

33
__file__
4-
__version__ = "1.0.1"
4+
__version__ = "1.1.0"
55

66
_js_dist_dependencies = [
77
{
@@ -38,15 +38,13 @@
3838
{
3939
"relative_package_path": "{}.min.js".format(__name__),
4040
"dev_package_path": "{}.dev.js".format(__name__),
41-
"external_url": "https://unpkg.com/dash-renderer@1.0.1"
41+
"external_url": "https://unpkg.com/dash-renderer@1.1.0"
4242
"/dash_renderer/dash_renderer.min.js",
4343
"namespace": "dash_renderer",
4444
},
4545
{
4646
"relative_package_path": "{}.min.js.map".format(__name__),
4747
"dev_package_path": "{}.dev.js.map".format(__name__),
48-
"external_url": "https://unpkg.com/[email protected]"
49-
"/dash_renderer/dash_renderer.min.js.map",
5048
"namespace": "dash_renderer",
5149
"dynamic": True,
5250
},

0 commit comments

Comments
 (0)