Skip to content

Commit e4a3130

Browse files
feat: jupyter lab 3.0 federated bundle support
1 parent 5857d54 commit e4a3130

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

js/package.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,22 @@
2626
"build:all": "npm run build:labextension",
2727
"build:bundles": "webpack -d && node ./scripts/post-build.js --debug",
2828
"build:bundles-prod": "webpack -p && node ./scripts/post-build.js",
29-
"build:labextension": "rimraf lab-dist && mkdirp lab-dist && cd lab-dist && npm pack ..",
29+
"build:labextension": "rimraf lab-dist && mkdirp lab-dist && cd lab-dist && npm pack .. && cd .. && jupyter labextension build .",
3030
"clean": "rimraf dist && rimraf ../pythreejs/static && rimraf lab-dist && node ./scripts/clean-generated-files.js",
3131
"prepack": "npm run build:bundles-prod",
3232
"prepare": "npm run autogen",
3333
"update:deps": "update-dependency --minimal --regex \"^(?!@jupyter-widgets|three)\"",
3434
"watch": "webpack -d -w"
3535
},
3636
"dependencies": {
37-
"@jupyter-widgets/base": "^1.2.5 || ^2.0.0 || ^3.0.0",
37+
"@jupyter-widgets/base": "^1.2.5 || ^2.0.0 || ^3.0.0 || ^4.0.0-alpha.2",
3838
"bluebird": "^3.5.5",
3939
"jupyter-dataserializers": "^2.2.0",
4040
"three": "^0.97.0",
4141
"underscore": "^1.8.3"
4242
},
4343
"devDependencies": {
44+
"@jupyterlab/builder": "^3.0.0-rc.13",
4445
"@jupyterlab/buildutils": "^2.0.2",
4546
"eslint": "^6.8.0",
4647
"fs-extra": "^8.1.0",
@@ -53,6 +54,16 @@
5354
},
5455
"jupyterlab": {
5556
"extension": "src/jupyterlab-plugin",
57+
"outputDir": "../share/jupyter/labextensions/jupyter-threejs",
58+
"sharedPackages": {
59+
"@jupyter-widgets/base": {
60+
"bundled": false,
61+
"singleton": true
62+
},
63+
"threejs": {
64+
"bundled": true
65+
}
66+
},
5667
"discovery": {
5768
"kernel": [
5869
{

js/src/jupyterlab-plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module.exports = {
1919
console.error(err);
2020
reject(err);
2121
},
22-
'jupyter-threejs'
22+
'jupyter-threejs-chunk'
2323
);
2424
});
2525
}

setup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
('share/jupyter/lab/extensions',
4040
'js/lab-dist',
4141
'jupyter-threejs-*.tgz'),
42+
('share/jupyter/labextensions/jupyter-threejs/',
43+
'share/jupyter/labextensions/jupyter-threejs/',
44+
'*.*'),
45+
('share/jupyter/labextensions/jupyter-threejs/static',
46+
'share/jupyter/labextensions/jupyter-threejs/static/',
47+
'*.*'),
4248
('etc/jupyter/nbconfig',
4349
'jupyter-config',
4450
'**/*.json'),

0 commit comments

Comments
 (0)