Skip to content

Commit e25f5c6

Browse files
Remove build artifacts and update build process (#1734)
* Removing build artifacts from dev branch * Updating build scripts * Fixing renderer build * Fixing CI config and update script * fixing build script order * Removing relative imports * Revert relative imports * Fixing import * Removing obsolete html components * Upping timeout * Update contributing.md * Adding Format and FormatTemplate to dash_table imports * Linting * Apply suggestions from code review * Triggering tests * Triggering tests again Co-authored-by: Alex Johnson <[email protected]> Co-authored-by: alexcjohnson <[email protected]>
1 parent 66c7847 commit e25f5c6

File tree

222 files changed

+56
-69113
lines changed

Some content is hidden

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

222 files changed

+56
-69113
lines changed

Diff for: .circleci/config.yml

+4-5
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

Diff for: .gitignore

+6-3
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/

Diff for: CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
1313
### Changed
1414
- [#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.
1515
- [#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.
16+
- [#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`.
17+
1618

1719
## Dash Core Components
1820
### Added
@@ -24,6 +26,11 @@ This project adheres to [Semantic Versioning](https://semver.org/).
2426

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

29+
## Dash HTML Components
30+
### Removed
31+
32+
- [#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.
33+
2734
## [1.21.0] - 2021-07-09
2835

2936
## Dash and Dash Renderer

Diff for: CONTRIBUTING.md

+9-12
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

Diff for: components/dash-html-components/scripts/data/elements.txt

-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ cite
2323
code
2424
col
2525
colgroup
26-
command
2726
content
2827
data
2928
datalist
@@ -35,7 +34,6 @@ dialog
3534
div
3635
dl
3736
dt
38-
element
3937
em
4038
embed
4139
fieldset
@@ -59,23 +57,19 @@ i
5957
iframe
6058
img
6159
ins
62-
isindex
6360
kbd
6461
keygen
6562
label
6663
legend
6764
li
6865
link
69-
listing
7066
main
7167
map
7268
mark
7369
marquee
7470
meta
7571
meter
76-
multicol
7772
nav
78-
nextid
7973
nobr
8074
noscript
8175
object

Diff for: components/dash-html-components/scripts/extract-elements.js

+1-10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const request = require('request');
66

77
const refUrl = 'https://developer.mozilla.org/en-US/docs/Web/HTML/Element';
88
const dataPath = './data/elements.txt';
9-
const expectedElCount = 131;
9+
const expectedElCount = 125;
1010

1111
/**
1212
* From the MDN HTML elements reference, extract a list of elements.
@@ -25,13 +25,8 @@ function extractElements($) {
2525
'portal'
2626
];
2727
// `<section>` is for some reason missing from the reference tables.
28-
// `<command>`, `<element>`, `<isindex>`, `<listing>`, `<multicol>`, `<nextid>`
29-
// are obsolete and have been removed from the reference table, but we had
30-
// them in the past so we should wait for a major to remove
3128
const addElements = [
3229
'base',
33-
'command',
34-
'element',
3530
'section',
3631
'h1',
3732
'h2',
@@ -40,10 +35,6 @@ function extractElements($) {
4035
'h5',
4136
'h6',
4237
'iframe',
43-
'isindex',
44-
'listing',
45-
'multicol',
46-
'nextid'
4738
];
4839

4940
return $('td:first-child')

Diff for: components/dash-table/dash_table_base/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
from ._imports_ import * # noqa: E402, F401, F403
1717
from ._imports_ import __all__ # noqa: E402
18+
from . import Format # noqa: F401, E402
19+
from . import FormatTemplate # noqa: F401, E402
1820

1921
_basepath = _os.path.dirname(__file__)
2022
_filepath = _os.path.abspath(_os.path.join(_basepath, "package-info.json"))

Diff for: dash/dash_table/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)