Skip to content

Commit d5240d5

Browse files
authored
ENH: Support for JupyterLab 2 (#301)
* JupyterLab 2 compatebility - Update the python package coupling to the JupyterLab extension to be less strict, allowing for a coupling to `^1.1.2` instead of exactly `^1.1.1`. This is very relevant if we make a small bump to the extension but don't want to make a new release of qgrid, or if qgrid would be installed by conda and it's availability was delayed so the newer npm package was available but the python package was outdated and coupled to the old versions specifically. - Move various loaders that are only used by webpack to build the json files from being dependencies to being devDependencies. - Bump versions of various dependencies to avoid security issues found in packages by npm. * Use labextension link instead of install for local dev A good rule of thumb according to this @vidartf. ref: https://discourse.jupyter.org/t/about-jupyter-labextension-link-v-s-install/2201/2?u=consideratio
1 parent c57356d commit d5240d5

File tree

6 files changed

+28
-24
lines changed

6 files changed

+28
-24
lines changed

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ to do this.
216216

217217
#. If desired, install the labextension::
218218

219-
jupyter labextension install js/
219+
jupyter labextension link js/
220220

221221
#. Run the notebook as you normally would with the following command::
222222

js/package.json

+16-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "qgrid2",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "An Interactive Grid for Sorting and Filtering DataFrames in Jupyter Notebook",
55
"author": "Quantopian Inc.",
66
"main": "src/index.js",
@@ -16,27 +16,28 @@
1616
],
1717
"scripts": {
1818
"clean": "rimraf dist/",
19-
"prepublish": "webpack",
19+
"prepare": "webpack",
2020
"test": "echo \"Error: no test specified\" && exit 1"
2121
},
2222
"devDependencies": {
23-
"jshint": "^2.9.5",
24-
"rimraf": "^2.6.1",
25-
"webpack": "^3.5.5"
23+
"css-loader": "^3.4.2",
24+
"expose-loader": "^0.7.5",
25+
"file-loader": "^6.0.0",
26+
"jshint": "^2.11.0",
27+
"json-loader": "^0.5.7",
28+
"rimraf": "^3.0.2",
29+
"style-loader": "^1.1.3",
30+
"webpack": "^4.42.0",
31+
"webpack-cli": "^3.3.11"
2632
},
2733
"dependencies": {
28-
"@jupyter-widgets/base": "^1.1 || ^2",
29-
"@jupyter-widgets/controls": "^1.0.0 || ^1.5.1",
30-
"css-loader": "^0.28.7",
31-
"expose-loader": "^0.7.3",
32-
"file-loader": "^0.11.2",
34+
"@jupyter-widgets/base": "^1.1 || ^2 || ^3",
35+
"@jupyter-widgets/controls": "^1 || ^2",
3336
"jquery": "^3.2.1",
34-
"jquery-ui-dist": "1.12.1",
35-
"json-loader": "^0.5.4",
36-
"moment": "^2.18.1",
37+
"jquery-ui-dist": "^1.12.1",
38+
"moment": "^2.24.0",
3739
"slickgrid-qgrid": "0.0.5",
38-
"style-loader": "^0.18.2",
39-
"underscore": "^1.8.3"
40+
"underscore": "^1.9.2"
4041
},
4142
"jshintConfig": {
4243
"esversion": 6

js/src/qgrid.widget.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class QgridModel extends widgets.DOMWidgetModel {
3636
_view_name : 'QgridView',
3737
_model_module : 'qgrid',
3838
_view_module : 'qgrid',
39-
_model_module_version : '^1.1.1',
40-
_view_module_version : '^1.1.1',
39+
_model_module_version : '^1.1.2',
40+
_view_module_version : '^1.1.2',
4141
_df_json: '',
4242
_columns: {}
4343
});

js/webpack.config.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ module.exports = [
4242
path: path.resolve(__dirname, '..', 'qgrid', 'static'),
4343
libraryTarget: 'amd'
4444
},
45-
plugins: plugins
45+
plugins: plugins,
46+
mode: 'production'
4647
},
4748
{// Bundle for the notebook containing the custom widget views and models
4849
//
@@ -61,7 +62,8 @@ module.exports = [
6162
rules: rules
6263
},
6364
externals: ['@jupyter-widgets/base', '@jupyter-widgets/controls', 'base/js/dialog'],
64-
plugins: plugins
65+
plugins: plugins,
66+
mode: 'production'
6567
},
6668
{// Embeddable qgrid bundle
6769
//
@@ -89,6 +91,7 @@ module.exports = [
8991
rules: rules
9092
},
9193
externals: ['@jupyter-widgets/base', '@jupyter-widgets/controls'],
92-
plugins: plugins
94+
plugins: plugins,
95+
mode: 'production'
9396
}
9497
];

qgrid/_version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version_info = (1, 3, 0, "final")
1+
version_info = (1, 3, 1, "final")
22

33
_specifier_ = {"alpha": "a", "beta": "b", "candidate": "rc", "final": ""}
44

qgrid/grid.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ class can be constructed directly but that's not recommended because
566566
_model_name = Unicode('QgridModel').tag(sync=True)
567567
_view_module = Unicode('qgrid').tag(sync=True)
568568
_model_module = Unicode('qgrid').tag(sync=True)
569-
_view_module_version = Unicode('1.1.1').tag(sync=True)
570-
_model_module_version = Unicode('1.1.1').tag(sync=True)
569+
_view_module_version = Unicode('^1.1.3').tag(sync=True)
570+
_model_module_version = Unicode('^1.1.3').tag(sync=True)
571571

572572
_df = Instance(pd.DataFrame)
573573
_df_json = Unicode('', sync=True)

0 commit comments

Comments
 (0)