Skip to content

Commit d052483

Browse files
authored
Merge pull request #137 from silx-kit/up-h5web
Upgrade H5Web/h5grove and refresh CONTRIBUTING
2 parents d926bac + ba06c45 commit d052483

File tree

5 files changed

+1180
-10012
lines changed

5 files changed

+1180
-10012
lines changed

CONTRIBUTING.md

Lines changed: 28 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,53 @@
22

33
## Install
44

5-
Note: You will need NodeJS to build the extension package.
5+
```bash
6+
# Prepare environment with pip, conda, micromamba ...
7+
conda install -c conda-forge nodejs=20 jupyterlab==4 jupyter-packaging jupyterlab-h5web
68

7-
The `jlpm` command is JupyterLab's pinned version of
8-
[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
9-
`yarn` or `npm` in lieu of `jlpm` below.
9+
# Install front-end dependencies (`jlpm` is JupyterLab's pinned version of yarn)
10+
jlpm install
1011

11-
```bash
12-
# Clone the repo to your local environment
1312
# Install package in development mode
1413
pip install -e .
14+
1515
# Link your development version of the extension with JupyterLab
1616
jupyter labextension develop . --overwrite
17-
# Server extension must be manually installed in develop mode
17+
18+
# Server extension must be manually enabled in develop mode
1819
jupyter server extension enable jupyterlab_h5web
19-
# Rebuild extension Typescript source after making changes
20-
jlpm run build
2120
```
2221

23-
You can watch the source directory and run JupyterLab at the same time in
24-
different terminals to watch for changes in the extension's source and
25-
automatically rebuild the extension.
22+
## Develop
2623

2724
```bash
28-
# Watch the source directory in one terminal, automatically rebuilding when needed
29-
jlpm run watch
30-
# Run JupyterLab in another terminal
25+
# Start JupyterLab
3126
jupyter lab
27+
28+
# In a separate terminal, watch and rebuild the front-end automatically
29+
jlpm run watch
30+
31+
# Alternatively, rebuild when needed
32+
jlpm run build
3233
```
3334

34-
With the watch command running, every saved change will immediately be built
35-
locally and available in your running JupyterLab. Refresh JupyterLab to load the
36-
change in your browser (you may need to wait several seconds for the extension
37-
to be rebuilt).
35+
Whenever the front-end rebuilds, make sure to **refresh** JupyterLab in your
36+
browser to see the changes.
3837

39-
By default, the `jlpm run build` command generates the source maps for this
40-
extension to make it easier to debug using the browser dev tools. To also
41-
generate source maps for the JupyterLab core extensions, you can run the
42-
following command:
38+
By default, `jlpm run build` builds the front-end in development mode and
39+
generates source maps for easier debugging with the browser dev tools. To also
40+
generate source maps for the JupyterLab core extensions, run:
4341

4442
```bash
4543
jupyter lab build --minimize=False
4644
```
4745

48-
> **Note**: Building the extension in developement mode prevents from testing
49-
> R3F visualisations
50-
> ([they freeze the browser](https://github.com/silx-kit/jupyterlab-h5web/issues/67)).
51-
> To test the visualisations, the extension must be built in production mode by
52-
> running `jlpm build:prod`. Unfortunately, this means that the `watch` command
53-
> cannot be used (`jlpm build:prod` must be run at each change).
46+
> Unfortunately, building the front-end in development mode
47+
> [breaks](https://github.com/silx-kit/jupyterlab-h5web/issues/67) H5Web's
48+
> R3F-based visualisations (_Heatmap_, _Line_, etc.) The current workaround is
49+
> to built in production mode with `jlpm run build:prod`.
5450
55-
## Development uninstall
51+
## Uninstall
5652

5753
```bash
5854
# Server extension must be manually disabled in develop mode
@@ -66,12 +62,12 @@ In development mode, you will also need to remove the symlink created by
6662
located. Then you can remove the symlink named `jupyterlab-h5web` within that
6763
folder.
6864

69-
## Formatting
65+
## Format
7066

7167
This extension uses `prettier` to format `*.ts` files and `black` to format
7268
`*.py` files.
7369

74-
## Release process
70+
## Release
7571

7672
The release process is adapted from
7773
[the one from h5web](https://github.com/silx-kit/h5web/blob/main/CONTRIBUTING.md#release-process).

0 commit comments

Comments
 (0)