Skip to content

Commit 0d33e97

Browse files
committed
Merge branch 'dev' into api-retrying
2 parents a880c07 + 32324b4 commit 0d33e97

File tree

243 files changed

+115
-69207
lines changed

Some content is hidden

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

243 files changed

+115
-69207
lines changed

.circleci/config.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ jobs:
4444
python -m venv venv && . venv/bin/activate
4545
set -eo pipefail
4646
pip install -e .[testing,dev] --progress-bar off && pip list | grep dash
47-
cd dash/dash-renderer && renderer build && cd ../../
48-
dash-update-components "all"
47+
npm i
48+
npm run build
4949
python setup.py sdist
5050
mkdir dash-package && cp dist/*.tar.gz dash-package/dash-package.tar.gz
5151
ls -la dash-package
52-
no_output_timeout: 20m
52+
no_output_timeout: 30m
5353
- persist_to_workspace:
5454
root: ~/dash
5555
paths:
@@ -86,10 +86,9 @@ jobs:
8686
command: |
8787
. venv/bin/activate
8888
set -eo pipefail
89-
cd dash/dash-renderer && renderer build && cd ../../
90-
dash-update-components "all"
9189
pip install -e . --progress-bar off && pip list | grep dash
9290
npm install --production && npm run initialize
91+
npm run build
9392
npm run lint
9493
- run:
9594
name: 🐍 Python Unit Tests & ☕ JS Unit Tests

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ coverage.xml
4343
.Python
4444
build/
4545
dash/deps/
46-
dash/html/
47-
dash/dcc/
48-
dash/dash_table/
46+
dash/html/*
47+
!dash/html/.gitkeep
48+
dash/dcc/*
49+
!dash/dcc/.gitkeep
50+
dash/dash_table/*
51+
!dash/dash_table/.gitkeep
4952
develop-eggs/
5053
dist/
5154
downloads/

.pylintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ disable=fixme,
6868
superfluous-parens,
6969
bad-continuation,
7070
line-too-long,
71-
bad-option-value
71+
bad-option-value,
72+
unspecified-encoding
7273

7374

7475
# Enable the message, report, category or checker with the given id(s). You can

.pylintrc39

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@ disable=invalid-name,
159159
line-too-long,
160160
super-with-arguments,
161161
raise-missing-from,
162-
bad-option-value
162+
bad-option-value,
163+
unspecified-encoding
163164

164165
# Enable the message, report, category or checker with the given id(s). You can
165166
# either give multiple identifier separated by comma (,) or put this option

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,23 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1414
### Changed
1515
- [#1679](https://github.com/plotly/dash/pull/1679) Restructure `dash`, `dash-core-components`, `dash-html-components`, and `dash-table` into a singular monorepo and move component packages into `dash`. This change makes the component modules available for import within the `dash` namespace, and simplifies the import pattern for a Dash app. From a development standpoint, all future changes to component modules will be made within the `components` directory, and relevant packages updated with the `dash-update-components` CLI command.
1616
- [#1707](https://github.com/plotly/dash/pull/1707) Change the default value of the `compress` argument to the `dash.Dash` constructor to `False`. This change reduces CPU usage, and was made in recognition of the fact that many deployment platforms (e.g. Dash Enterprise) already apply their own compression. If deploying to an environment that does not already provide compression, the Dash 1 behavior may be restored by adding `compress=True` to the `dash.Dash` constructor.
17+
- [#1734](https://github.com/plotly/dash/pull/1734) Added `npm run build` script to simplify build process involving `dash-renderer` and subcomponent libraries within `dash`.
18+
19+
20+
## Dash Core Components
21+
### Added
22+
23+
- [#1729](https://github.com/plotly/dash/pull/1729) Include F#, C#, and MATLAB in markdown code highlighting, for the upcoming .NET and MATLAB flavors of dash.
24+
25+
## Dash Table
26+
### Added
27+
28+
- [#1729](https://github.com/plotly/dash/pull/1729) Include F#, C#, and MATLAB in markdown code highlighting, for the upcoming .NET and MATLAB flavors of dash.
29+
30+
## Dash HTML Components
31+
### Removed
32+
33+
- [#1734](https://github.com/plotly/dash/pull/1734) Removed the following obsolete `html` elements - `<command>`, `<element>`, `<isindex>`, `<listing>`, `<multicol>`, `<nextid>`. These are obsolete and had been previously removed from the reference table.
1734

1835
## [1.21.0] - 2021-07-09
1936

CONTRIBUTING.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,15 @@ $ python3 -m venv .venv/dev
1515
$ source .venv/dev/bin/activate
1616
# install dash and dependencies
1717
$ pip install -e .[testing,dev] # in some shells you need \ to escape []
18-
$ cd dash-renderer
19-
# build renderer bundles, this will build all bundles from source code
20-
# the only true source of npm version is defined in package.json
2118
$ npm install
22-
$ npm run build # or `renderer build`
23-
# install dash-renderer for development
24-
$ pip install -e .
19+
# this script will build the dash-core-components, dash-html-components, dash-table,
20+
# and renderer bundles; this will build all bundles from source code in their
21+
# respective directories. The only true source of npm version is defined
22+
# in package.json for each package.
23+
$ npm run build # runs `renderer build` and `npm build` in dcc, html, table
2524
# build and install components used in tests
26-
$ cd .. # should be back in dash/ root directory
27-
$ npm install
2825
$ npm run setup-tests.py # or npm run setup-tests.R
29-
# you should see both dash and dash-renderer are pointed to local source repos
26+
# you should see dash points to a local source repo
3027
$ pip list | grep dash
3128
```
3229

@@ -38,20 +35,20 @@ If you want to contribute or simply dig deeper into Dash, we encourage you to pl
3835

3936
For contributors with a primarily **Python** or **R** background, this section might help you understand more details about developing and debugging in JavaScript world.
4037

41-
As of Dash 1.2, the renderer bundle and its peer dependencies can be packed and generated from the source code. The `dash-renderer\package.json` file is the one version of the truth for dash renderer version and npm dependencies. A build tool `renderer`, which is a tiny Python script installed by Dash as a command-line tool, has a few commands:
38+
As of Dash 1.2, the renderer bundle and its peer dependencies can be packed and generated from the source code. The `dash-renderer\package.json` file is the one version of the truth for dash renderer version and npm dependencies. A build tool `renderer`, which is a tiny Python script installed by Dash as a command-line tool, has a few commands which can be run from within the `dash/dash-renderer` directory:
4239

4340
1. `renderer clean` deletes all the previously generated assets by this same tool.
4441
2. `renderer npm` installs all the npm modules using this `package.json` files. Note that the `package-lock.json` file is the computed reference product for the versions defined with tilde(~) or caret(^) syntax in npm.
4542
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.
4643
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.
4744
5. `renderer build` runs 1, 2, 3, 4 in sequence as a complete build process from scratch.
48-
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 .`.
45+
6. `renderer build local` runs the same order as in 5 and also generates source maps for debugging purposes.
4946

5047
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.
5148

5249
### Development of `dash-core-components`, `dash-html-components`, and `dash_table`
5350

54-
Specific details on making updates and contributions to `dcc`, `html`, and `dash_table` can be found within their respective sub-directories in the `components` directory. Once changes have been made in the specific directories, the `dash-update-components` command line tool can be used to update the build artifacts and dependencies of the respective packages within Dash. For example, if a change has been made to `dash-core-components`, use `dash-update-components "dash-core-components"` to move the build artifacts to Dash. By default, this is set to update `all` packages.
51+
Specific details on making changes and contributing to `dcc`, `html`, and `dash_table` can be found within their respective sub-directories in the `components` directory. Once changes have been made in the specific directories, the `dash-update-components` command line tool can be used to update the build artifacts and dependencies of the respective packages within Dash. For example, if a change has been made to `dash-core-components`, use `dash-update-components "dash-core-components"` to move the build artifacts to Dash. By default, this is set to update `all` packages.
5552

5653
## Python 2 And 3 Compatibility
5754

components/dash-core-components/dash_core_components_base/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from __future__ import print_function as _
2-
31
import json
42
import os as _os
53
import sys as _sys

components/dash-core-components/dash_core_components_base/express.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
import io
22
import ntpath
33
import base64
4-
from functools import partial
5-
6-
# Py2 StringIO.StringIO handles unicode but io.StringIO doesn't
7-
try:
8-
from StringIO import StringIO as _StringIO
9-
10-
py2 = True
11-
except ImportError:
12-
_StringIO = io.StringIO
13-
py2 = False
144

155
# region Utils for Download component
166

@@ -56,7 +46,7 @@ def send_string(src, filename, type=None, **kwargs):
5646
:param type: type of the file (optional, passed to Blob in the javascript layer)
5747
:return: dict of data frame content (NOT base64 encoded) and meta data used by the Download component
5848
"""
59-
content = src if isinstance(src, str) else _io_to_str(_StringIO(), src, **kwargs)
49+
content = src if isinstance(src, str) else _io_to_str(io.StringIO(), src, **kwargs)
6050
return dict(content=content, filename=filename, type=type, base64=False)
6151

6252

@@ -110,7 +100,7 @@ def send_data_frame(writer, filename, type=None, **kwargs):
110100
"to_parquet": send_bytes,
111101
"to_msgpack": send_bytes,
112102
"to_stata": send_bytes,
113-
"to_pickle": partial(send_bytes, compression=None) if py2 else send_bytes,
103+
"to_pickle": send_bytes,
114104
}
115105

116106
# endregion

components/dash-core-components/src/third-party/highlight.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ import highlightjs from 'highlight.js/lib/core';
22
import 'highlight.js/styles/github.css';
33

44
import bash from 'highlight.js/lib/languages/bash';
5+
import csharp from 'highlight.js/lib/languages/csharp';
56
import css from 'highlight.js/lib/languages/css';
7+
import fsharp from 'highlight.js/lib/languages/fsharp';
68
import http from 'highlight.js/lib/languages/http';
79
import javascript from 'highlight.js/lib/languages/javascript';
810
import json from 'highlight.js/lib/languages/json';
911
import julia from 'highlight.js/lib/languages/julia';
1012
import markdown from 'highlight.js/lib/languages/markdown';
13+
import matlab from 'highlight.js/lib/languages/matlab';
1114
import plaintext from 'highlight.js/lib/languages/plaintext';
1215
import python from 'highlight.js/lib/languages/python';
1316
import r from 'highlight.js/lib/languages/r';
@@ -18,12 +21,15 @@ import xml from 'highlight.js/lib/languages/xml';
1821
import yaml from 'highlight.js/lib/languages/yaml';
1922

2023
highlightjs.registerLanguage('bash', bash);
24+
highlightjs.registerLanguage('csharp', csharp);
2125
highlightjs.registerLanguage('css', css);
26+
highlightjs.registerLanguage('fsharp', fsharp);
2227
highlightjs.registerLanguage('http', http);
2328
highlightjs.registerLanguage('javascript', javascript);
2429
highlightjs.registerLanguage('json', json);
2530
highlightjs.registerLanguage('julia', julia);
2631
highlightjs.registerLanguage('markdown', markdown);
32+
highlightjs.registerLanguage('matlab', matlab);
2733
highlightjs.registerLanguage('plaintext', plaintext);
2834
highlightjs.registerLanguage('python', python);
2935
highlightjs.registerLanguage('r', r);

components/dash-html-components/dash_html_components_base/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Vanilla HTML components for Dash"""
22

3-
from __future__ import print_function as _
43
from ._imports_ import * # noqa: E402, F401, F403
54
from ._imports_ import __all__ # noqa: E402
65

0 commit comments

Comments
 (0)