You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+33-3Lines changed: 33 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,8 +13,13 @@ This guide shows how to compile and test this project. Anyone who want to contri
13
13
* Review our [code of conduct :memo:](./CODE_OF_CONDUCT.md) before contributing to this project.
14
14
15
15
* The metadata of the project is defined in `pyproject.toml` and `package.json`. Modifying `package.json` will not automatically update `pyproject.toml`. Therefore, users need to ensure changes for both files if any part of the metadata needs to be changed.
16
+
* The React source files are in the `src/lib/` folder. These codes are formatted by [`pretteir`:hammer:][tool-prettier].
16
17
17
-
* The Python codes are in the package `dash_file_cache/` folder. These codes are formatted by [`black`:hammer:][tool-black]. Note that the automatically generated files (may be introduced in the future) will not be formatted.
18
+
* The Python codes are in the package `dash_file_cache/` folder. These codes are formatted by [`black`:hammer:][tool-black].
19
+
20
+
* The Python Compoenent codes are in the sub-package `dash_file_cache/components/` folder. Note that the automatically generated files like `_imports_.py` and `Downloader.py` will not be formatted.
21
+
22
+
* Currently, we do not provide the React demo application. Therefore, please do not use `yarn start`.
18
23
19
24
* The Dash demo apps are stored in `examples/`. These demos show the usages this package in different cases.
20
25
@@ -24,7 +29,11 @@ This guide shows how to compile and test this project. Anyone who want to contri
24
29
25
30
* The tool configurations for `pytest`, `black`, and `pyright` are defined in `pyproject.toml`. However, the configurations for `flake8`, `pylint`, and `prettier` are still kept in their corresponding configurations files.
26
31
27
-
* Remember to use [`black`:hammer:][tool-black] to format any modified Python codes. [Review your code :memo:](./review_checklist.md) before sending the pull request.
32
+
* If any custom styles are defined but not imported as a part of the react codes, please add these custom CSS files into the distribution folder (`dash_json_grid`).
33
+
* Make sure that they are referenced in `MANIFEST.in` so that they get properly included when you're ready to publish your component.
34
+
* Make sure the stylesheets are added to the `_css_dist` dict in `dash_json_grid/__init__.py` so dash will serve them automatically when the component suite is requested.
35
+
36
+
* Remember to use [`black`:hammer:][tool-black] and [`pretteir`:hammer:][tool-prettier] to format any modified Python and React codes, respectively. [Review your code :memo:](./review_checklist.md) before sending the pull request.
28
37
29
38
### 2. Work with Docker
30
39
@@ -119,6 +128,13 @@ At the **bottom left** corner, you should be able to see the name of the current
119
128
120
129
Now you will be able to start the development. You can do the following things to test the codes.
121
130
131
+
* Build the component
132
+
133
+
```sh
134
+
yarn install
135
+
yarn build
136
+
```
137
+
122
138
* Run the `pytest`:
123
139
124
140
``` sh
@@ -188,7 +204,7 @@ The following steps will help you configure the environment with `conda`:
Copy file name to clipboardExpand all lines: review_checklist.md
+16-1Lines changed: 16 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,12 +18,27 @@
18
18
* Scan your code for expensive operations (large computations, DOM queries, React re-renders). Have you done your possible to limit their impact? If not, it is going to slow your app down.
19
19
* Can you think of cases where your current code will break? How are you handling errors? Should the user see them as notifications? Should your app try to auto-correct them for them?
20
20
21
+
## Component API
22
+
23
+
- Have you tested your component on the Python side by creating an app in `usage.py` ?
24
+
25
+
Do all of your component's props work when set from the back-end?
26
+
27
+
Should all of them be settable from the back-end or are some only relevant to user interactions in the front-end?
28
+
29
+
- Have you provided some basic documentation about your component? The Dash community uses [react docstrings](https://github.com/plotly/dash-docs/blob/master/tutorial/plugins.py#L45) to provide basic information about dash components. Take a look at this [Checklist component example](https://github.com/plotly/dash-core-components/blob/master/src/components/Checklist.react.js) and others from the dash-core-components repository.
30
+
31
+
At a minimum, you should describe what your component does, and describe its props and the features they enable.
32
+
33
+
Be careful to use the correct formatting for your docstrings for them to be properly recognized.
34
+
21
35
## Tests
22
36
23
37
- The Dash team uses integration tests extensively, and we highly encourage you to write tests for the main functionality of your component. In the `tests` folder of the boilerplate, you can see a sample integration test. By launching it, you will run a sample Dash app in a browser. You can run the test with:
24
38
```
25
-
python -m pytest
39
+
python -m tests.test_render
26
40
```
41
+
[Browse the Dash component code on GitHub for more examples of testing.](https://github.com/plotly/dash-core-components)
0 commit comments