-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Assets #868 #874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Assets #868 #874
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
e21cf1c
ef66d8f
2ed8493
:bug: keywords for 2 and 3 are different
9747e33
7dfaeff
e1a5c0a
807d0a8
:wrench: ignore all bundles in git
e18b1a7
3519489
00808cf
a775771
3cb4c6f
b0e95b3
:wrench: update ci
c226725
43a45eb
9e5d6fb
Revert "update the MANIFEST for bundles"
b2c003a
update MANIFEST
bbcd0e8
3dc0c31
92842de
223835a
e8c017e
17e6641
:alembic: tune
2ea7cd4
ebf51c9
747c112
47ee2b0
6399c80
Update test_render.py
byronz d273bdb
fc4ea3d
97fd85b
Merge remote-tracking branch 'origin/assets-#868' into assets-#868
bce16dc
6388cb5
61f801d
Update dash/development/build_renderer.py
byronz 638be3f
:ok_hand: comments
b373d0d
d983610
Merge remote-tracking branch 'origin/assets-#868' into assets-#868
8e8db02
0ddd5eb
more improvements
78aff76
a63730c
c974139
1a7b0c7
f0e922d
:pencil: update guide and change renderer tool
76121c2
:memo: update changelog
309209e
:horse:
9508469
b24f8cf
a9aa4d1
cc2b638
Update CONTRIBUTING.md
byronz 7658fa1
Update CONTRIBUTING.md
byronz 7f59fe6
Update CONTRIBUTING.md
byronz 1b05fe0
Update CONTRIBUTING.md
byronz 0c5df92
Update CONTRIBUTING.md
byronz 6bf596f
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,16 +8,41 @@ Glad that you decided to make your contribution in Dash, to set up your developm | |
# in your working directory | ||
$ git clone https://github.com/plotly/dash | ||
$ cd dash | ||
# create a virtualenv | ||
$ python3 -m venv venv | ||
# activate the virtualenv (on windows venv\scripts\activate) | ||
$ . venv/bin/activate | ||
# Install the dev dependencies | ||
$ pip install -r .circleci/requirements/dev-requirements.txt | ||
$ python3 -m venv .venv/dev | ||
# activate the virtualenv (on windows .venv\dev\scripts\activate) | ||
$ . .venv/dev/bin/activate | ||
# install dash and dependencies | ||
$ pip install -e .[testing,ci] # 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 run build | ||
# install dash-renderer for development | ||
$ pip install -e . | ||
# you should see both dash and dash-renderer are pointed to local source repos | ||
$ pip list | grep dash | ||
``` | ||
|
||
### Dash-Renderer Beginner Guide | ||
|
||
`Dash Renderer` began as a separate repository. It was merged into the main `Dash` repository as part of the 1.0 release. It is the common frontend for all Dash backends (**R** and **Python**), and manages React Component layout and backend event handling. | ||
|
||
If you want to contribute or simply dig deeper into Dash, we encourage you to play and taste it. This is the most efficient way to learn and understand everything under the hood. | ||
|
||
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: | ||
|
||
1. `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. | ||
2. `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` defined in `package.json` you might need to do some handy tasks like linting, syntax format with prettier, etc. | ||
3. `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. | ||
4. `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. | ||
|
||
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. | ||
|
||
## Git | ||
|
||
Use the [GitHub flow][] when proposing contributions to this repository (i.e. create a feature branch and submit a PR against the default branch). | ||
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). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW I think I generally prefer links inline like this, but it did work the way it was, with the link defined at the end of the doc. |
||
|
||
### Organize your commits | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
include dash_renderer/dash_renderer.dev.js | ||
include dash_renderer/dash_renderer.dev.js.map | ||
include dash_renderer/dash_renderer.min.js | ||
include dash_renderer/dash_renderer.min.js.map | ||
include dash_renderer/react-dom@*.min.js | ||
include dash_renderer/react@*.min.js | ||
include dash_renderer/prop-types@*.js | ||
include package.json | ||
include digest.json | ||
include dash_renderer/*.js | ||
include dash_renderer/*.map |
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.