Skip to content
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

Assets #868 #874

Merged
merged 55 commits into from
Aug 21, 2019
Merged

Assets #868 #874

merged 55 commits into from
Aug 21, 2019

Conversation

byronz
Copy link
Contributor

@byronz byronz commented Aug 17, 2019

this PR targets to clean the legacy dash-renderer assets present in git source repo. it closes #868
a new entry-point CLI tool is introduced as renderer, it has two jobs: npm and bundles.

renderer

@byronz byronz marked this pull request as ready for review August 17, 2019 08:21
byronz and others added 4 commits August 20, 2019 16:39
Co-Authored-By: alexcjohnson <johnson.alex.c@gmail.com>
Co-Authored-By: alexcjohnson <johnson.alex.c@gmail.com>
Co-Authored-By: alexcjohnson <johnson.alex.c@gmail.com>
Co-Authored-By: alexcjohnson <johnson.alex.c@gmail.com>
CONTRIBUTING.md Outdated

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

After Dash 1.2, The renderer bundle and its peer dependencies can be packed and generated from the source code. The only version of the truth is defined in `dash-renderer\package.json` file. A build tool `renderer`, which is a tiny Python script defined as a Dash entry point, has few commands like:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
After Dash 1.2, The renderer bundle and its peer dependencies can be packed and generated from the source code. The only version of the truth is defined in `dash-renderer\package.json` file. A build tool `renderer`, which is a tiny Python script defined as a Dash entry point, has few commands like:
As of Dash 1.2, The renderer bundle and its peer dependencies can be packed and generated from the source code. Dependency files are no longer included in this repository, they are downloaded when needed based on the versions listed in `dash-renderer/package.json`. A build tool `renderer`, which is a tiny Python script installed by Dash as a command-line tool, has a few commands:

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

After Dash 1.2, The renderer bundle and its peer dependencies can be packed and generated from the source code. The only version of the truth is defined in `dash-renderer\package.json` file. A build tool `renderer`, which is a tiny Python script defined as a Dash entry point, has few commands like:
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**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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**
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**. This is called by `npm run build`, or you can also call it directly if you add or update a dependency module.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's slightly safer for people not family with js to call with renderer as it will handle the location with os.chdir().

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - I just wanted to give people some idea when to use each of these commands. So perhaps:

Call this if you add or update a dependency module. npm run build calls this and renderer bundle, but you can only call it from the dash-renderer directory.

?

CONTRIBUTING.md Outdated

After Dash 1.2, The renderer bundle and its peer dependencies can be packed and generated from the source code. The only version of the truth is defined in `dash-renderer\package.json` file. A build tool `renderer`, which is a tiny Python script defined as a Dash entry point, has few commands like:
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
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. This is called by `npm run build`, or you can call it directly if the renderer code has changed.

Co-Authored-By: alexcjohnson <johnson.alex.c@gmail.com>
CONTRIBUTING.md Outdated
After Dash 1.2, The renderer bundle and its peer dependencies can be packed and generated from the source code. The only version of the truth is defined in `dash-renderer\package.json` file. A build tool `renderer`, which is a tiny Python script defined as a Dash entry point, has few commands like:
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
3. `renderer digest {renderer version}` 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`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should we say about when to use this? Just that we use it internally to test that the build has not changed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, something the assets bundle check
I extracted this out as a single job, so we can reuse it when we want to do some simple compare from the hash

## 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).
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💃

@byronz byronz merged commit 371261d into dev Aug 21, 2019
@byronz byronz deleted the assets-#868 branch August 21, 2019 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Make all js dependencies as assets
3 participants