Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Commit cbf94f0

Browse files
committed
Not a JLab extension + lazy load react-toastify
1 parent cffbf5d commit cbf94f0

File tree

6 files changed

+314
-1212
lines changed

6 files changed

+314
-1212
lines changed

README.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# jupyterlab_toastify
22

3-
Integrate 'react-toastify' nicely in JupyterLab.
3+
Integrate [`react-toastify`](https://github.com/fkhadra/react-toastify) nicely in JupyterLab.
44

55
![example](jupyterlab_notifications.gif)
66

@@ -19,7 +19,7 @@ INotification.info("Info");
1919
INotification.success("Success");
2020

2121
// Background task with progression animation
22-
let id = INotification.inProgress("Task in progress!");
22+
let id = await INotification.inProgress("Task in progress!");
2323
// -> Update text
2424
INotification.update({
2525
toastId: id,
@@ -54,26 +54,40 @@ INotification.dismiss(id);
5454
INotification.dismiss();
5555

5656
// Default call using `toast` function
57-
// See https://github.com/fkhadra/react-toastify#usage
57+
// See https://github.com/fkhadra/react-toastify
5858
INotification.notify("Default");
5959
```
6060

6161
To close a notification, click on the close button.
6262

6363
## Prerequisites
6464

65-
- [JupyterLab](https://github.com/jupyterlab/jupyterlab/) 1.0
66-
- [react](https://reactjs.org/) 0.16
67-
- [react-toastify](https://github.com/fkhadra/react-toastify) 4.4
65+
- [react](https://reactjs.org/) ^16.0
66+
- [react-toastify](https://github.com/fkhadra/react-toastify) ^6.0
6867

6968
## Installation
7069

71-
```bash
72-
jupyter labextension install jupyterlab_toastify
73-
```
70+
This is a pure NPM package since v4. You don't need to install a JupyterLab extension.
71+
72+
The toast container will be added to the DOM automatically by `react-toastify`.
73+
74+
> All functions are asynchronous as `react-toastify` is lazy loaded if required.
7475
7576
## Changelog
7677

78+
### v4.0.0
79+
80+
- Features
81+
- `react-toastify` v5 introduces the ability to add the toast container automatically.
82+
This extension uses that ability to remove the need of having a dedicated JupyterLab extension
83+
to be installed by users.
84+
- Lazy load `react-toastify` => all functions are asynchronous
85+
- Bump to `react-toastify` v6
86+
87+
### v3.0.0
88+
89+
Port to JupyterLab v2
90+
7791
### v2.3.1
7892

7993
- BUG `INotification.warning` does not accept options.

package.json

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyterlab_toastify",
3-
"version": "3.0.0",
3+
"version": "4.0.0",
44
"description": "Integrate 'react-toastify' nicely in JupyterLab.",
55
"keywords": [
66
"jupyter",
@@ -26,40 +26,29 @@
2626
},
2727
"scripts": {
2828
"build": "tsc",
29-
"clean": "rimraf lib && rimraf tsconfig.tsbuildinfo",
29+
"clean": "rimraf lib tsconfig.tsbuildinfo",
3030
"watch": "tsc -w",
3131
"precommit": "pretty-quick --staged",
3232
"prepare": "jlpm run clean && jlpm run build"
3333
},
3434
"dependencies": {
35-
"@jupyterlab/application": "^2.0.0",
36-
"react-toastify": "^4.4.3"
35+
"react-toastify": "^6.0.5"
3736
},
3837
"peerDependencies": {
3938
"react": "^16.0.0",
40-
"react-dom": "^16.0.0"
39+
"react-dom": "^16.6.0"
4140
},
4241
"devDependencies": {
43-
"@types/react-dom": "^16.9.0",
44-
"@types/react-toastify": "^4.0.2",
42+
"@types/react": "^16.9.0",
4543
"husky": "^0.14.3",
4644
"prettier": "1.14.2",
4745
"pretty-quick": "^1.6.0",
48-
"react": "^16.0.0",
49-
"react-dom": "^16.0.0",
46+
"react": "~16.9.0",
47+
"react-dom": "~16.9.0",
5048
"rimraf": "~2.6.1",
5149
"typescript": "~3.7.0"
5250
},
53-
"sideEffects": [
54-
"style/*.css"
55-
],
56-
"jupyterlab": {
57-
"extension": true
58-
},
5951
"publishConfig": {
6052
"access": "public"
61-
},
62-
"resolutions": {
63-
"@types/react": "~16.8.0"
6453
}
6554
}

0 commit comments

Comments
 (0)