Skip to content

Commit

Permalink
Merge pull request #1744 from plotly/master-2.0.0
Browse files Browse the repository at this point in the history
Merge changes from dev branch into master-2.0.0
  • Loading branch information
HammadTheOne authored Sep 4, 2021
2 parents 360b983 + b161068 commit 2975e00
Show file tree
Hide file tree
Showing 800 changed files with 352,004 additions and 1,532 deletions.
583 changes: 475 additions & 108 deletions .circleci/config.yml

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
ignore = C901, E203, E266, E501, E731, W503
select = B,C,E,F,W,T4
per-file-ignores =
tests/*: E722, F811
tests/*: E722, F811
dash/html/I.py: E742
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,8 @@ VERSION.txt
# main-branch artifacts to explicitly include
!dash/dash-renderer/build
!dash/deps

# Exceptions
!components/dash-core-components/tests/integration/upload/upload-assets/upft001.csv
!components/dash-table/tests/assets/*.csv
!components/dash-table/tests/selenium/assets/*.csv
9 changes: 8 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ ignore=CVS
# regex matches against base names, not paths.
ignore-patterns=

# Add files or directories matching the regex patterns to the ignore-list.
# The regex matches against paths.
ignore-paths=^dash/dcc/.*$,
^dash/html/.*$,
^dash/dash_table/.*$

# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
Expand Down Expand Up @@ -62,7 +68,8 @@ disable=fixme,
superfluous-parens,
bad-continuation,
line-too-long,
bad-option-value
bad-option-value,
unspecified-encoding


# Enable the message, report, category or checker with the given id(s). You can
Expand Down
9 changes: 8 additions & 1 deletion .pylintrc39
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ ignore=CVS
# regex matches against base names, not paths.
ignore-patterns=

# Add files or directories matching the regex patterns to the ignore-list.
# The regex matches against paths.
ignore-paths=^dash/dcc/.*$,
^dash/html/.*$,
^dash/dash_table/.*$

# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
Expand Down Expand Up @@ -153,7 +159,8 @@ disable=invalid-name,
line-too-long,
super-with-arguments,
raise-missing-from,
bad-option-value
bad-option-value,
unspecified-encoding

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,48 @@
All notable changes to `dash` will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [2.0.0] - 2021-08-03

## Dash and Dash Renderer

### Added
- [#1702](https://github.com/plotly/dash/pull/1702) Added a new `@app.long_callback` decorator to support callback functions that take a long time to run. See the PR and documentation for more information.
- [#1514](https://github.com/plotly/dash/pull/1514) Perform json encoding using the active plotly JSON engine. This will default to the faster orjson encoder if the `orjson` package is installed.
- [#1736](https://github.com/plotly/dash/pull/1736) Add support for `request_refresh_jwt` hook and retry requests that used expired JWT tokens.

### Changed
- [#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.
- [#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.
- [#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`.


## Dash Core Components
### Added

- [#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.

- [#1735](https://github.com/plotly/dash/pull/1735) Upgrade Plotly.js to v2.4.2. This includes:
- [Feature release 2.3.0](https://github.com/plotly/plotly.js/releases/tag/v2.3.0):
- More number formatting options due to `d3-format` upgrade.
- Many new `geo` projections.
- Improved rendering and performance of `scattergl`, `splom` and `parcoords` traces.
- [Feature release 2.4.0](https://github.com/plotly/plotly.js/releases/tag/v2.4.0):
- `legend.groupclick`
- `bbox` of hover items in event data, to support custom dash-driven hover effects
- Patch releases [2.3.1](https://github.com/plotly/plotly.js/releases/tag/v2.3.1), [2.4.1](https://github.com/plotly/plotly.js/releases/tag/v2.4.1), and [2.4.2](https://github.com/plotly/plotly.js/releases/tag/v2.4.2) containing various bug fixes.

- [#1735](https://github.com/plotly/dash/pull/1735) New `dcc.Tooltip` component. This is particularly useful for rich hover information on `dcc.Graph` charts, using the `bbox` information included in the event data in plotly.js v2.4.0

## Dash Table
### Added

- [#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.

## Dash HTML Components
### Removed

- [#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.

## [1.21.0] - 2021-07-09

## Dash and Dash Renderer
Expand Down
25 changes: 13 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,15 @@ $ python3 -m venv .venv/dev
$ source .venv/dev/bin/activate
# install dash and dependencies
$ pip install -e .[testing,dev] # in some shells you need \ to escape []
$ cd dash-renderer
# build renderer bundles, this will build all bundles from source code
# the only true source of npm version is defined in package.json
$ npm install
$ npm run build # or `renderer build`
# install dash-renderer for development
$ pip install -e .
# this script will build the dash-core-components, dash-html-components, dash-table,
# and renderer bundles; this will build all bundles from source code in their
# respective directories. The only true source of npm version is defined
# in package.json for each package.
$ npm run build # runs `renderer build` and `npm build` in dcc, html, table
# build and install components used in tests
$ cd .. # should be back in dash/ root directory
$ npm install
$ npm run setup-tests.py # or npm run setup-tests.R
# you should see both dash and dash-renderer are pointed to local source repos
# you should see dash points to a local source repo
$ pip list | grep dash
```

Expand All @@ -38,17 +35,21 @@ If you want to contribute or simply dig deeper into Dash, we encourage you to pl

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

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:
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:

1. `renderer clean` deletes all the previously generated assets by this same tool.
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.
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.
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.
5. `renderer build` runs 1, 2, 3, 4 in sequence as a complete build process from scratch.
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 .`.
6. `renderer build local` runs the same order as in 5 and also generates source maps for debugging purposes.

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.

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

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.

## Python 2 And 3 Compatibility

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.
Expand Down Expand Up @@ -77,7 +78,7 @@ Git command veterans might argue that a simple terminal and a cherry switch keyb

### Emoji

Plotlyers love to use emoji as an effective communication medium for
Plotlyers love to use emoji as an effective communication medium for:

**Commit Messages**

Expand Down
Loading

0 comments on commit 2975e00

Please sign in to comment.