Skip to content

Commit bcb7bfb

Browse files
committed
Mount Jupyterlite storage and set the CWD
1 parent 0df3b2b commit bcb7bfb

File tree

5 files changed

+57
-56
lines changed

5 files changed

+57
-56
lines changed

README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ Cross-Origin-Opener-Policy: same-origin
5959
Cross-Origin-Embedder-Policy: require-corp
6060
```
6161

62-
### Virtual file system storage
63-
64-
Due to limitations in the way the webR worker thread is implemented, the persistent JupyterLite file storage and the Emscripten VFS used by webR are not accessible to one another. The simplest way to import data into a webR notebook at the time of writing is by using R functions such as `read.csv()` with a publicly accessible URL.
65-
6662
### Interruption
6763

6864
While webR supports interrupting long running computations, interrupting cell execution has not yet been implemented in JupyterLite. An infinite looping cell can only be recovered by restarting the kernel.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"@jupyterlite/kernel": "^0.5.0",
6464
"@jupyterlite/server": "^0.5.0",
6565
"hash.js": "^1.1.7",
66-
"webr": "^0.4.2"
66+
"webr": "^0.4.3"
6767
},
6868
"devDependencies": {
6969
"@jupyterlab/builder": "^4.4.1",

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const server_kernel: JupyterLiteServerPlugin<void> = {
1313
autoStart: true,
1414
requires: [IKernelSpecs],
1515
activate: (app: JupyterLiteServer, kernelspecs: IKernelSpecs) => {
16-
console.log(PageConfig.getOption('litePluginSettings'));
1716
const config = JSON.parse(
1817
PageConfig.getOption('litePluginSettings') || '{}'
1918
)[PLUGIN_ID] || {};

src/webr_kernel.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ export class WebRKernel extends BaseKernel {
5656
await this.webR.evalRVoid(`
5757
webr::shim_install()
5858
`);
59+
60+
// Mount Jupyterlite storage and set the CWD
61+
await this.webR.evalRVoid(`
62+
webr::mount("/drive", type="DRIVEFS")
63+
setwd("/drive")
64+
`);
5965
}
6066

6167
inputReply(content: KernelMessage.IInputReplyMsg['content']): void {

yarn.lock

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -406,25 +406,25 @@ __metadata:
406406
linkType: hard
407407

408408
"@jupyter/ydoc@npm:^3.0.4":
409-
version: 3.0.4
410-
resolution: "@jupyter/ydoc@npm:3.0.4"
409+
version: 3.0.5
410+
resolution: "@jupyter/ydoc@npm:3.0.5"
411411
dependencies:
412412
"@jupyterlab/nbformat": ^3.0.0 || ^4.0.0-alpha.21 || ^4.0.0
413413
"@lumino/coreutils": ^1.11.0 || ^2.0.0
414414
"@lumino/disposable": ^1.10.0 || ^2.0.0
415415
"@lumino/signaling": ^1.10.0 || ^2.0.0
416416
y-protocols: ^1.0.5
417417
yjs: ^13.5.40
418-
checksum: 85ca033a51c0f26080bcea7c0aac7cbd4ef66bc745fd48786aa1a2f9bdf06b99b67f40d8775ff04bb700e78782fbfdc6c97d2e94b45bd65ad5288c44ca158e19
418+
checksum: a4f8074790e34b649e581e093806ec84ccfdcd676735d35efdba74e93114c5ff3d40e5909322ce7fc7acd0faf379ecfb8979ab88af1db9705d74b0eff4e1c75c
419419
languageName: node
420420
linkType: hard
421421

422422
"@jupyterlab/builder@npm:^4.4.1":
423-
version: 4.4.1
424-
resolution: "@jupyterlab/builder@npm:4.4.1"
423+
version: 4.4.2
424+
resolution: "@jupyterlab/builder@npm:4.4.2"
425425
dependencies:
426426
"@lumino/algorithm": ^2.0.3
427-
"@lumino/application": ^2.4.3
427+
"@lumino/application": ^2.4.4
428428
"@lumino/commands": ^2.3.2
429429
"@lumino/coreutils": ^2.2.1
430430
"@lumino/disposable": ^2.1.4
@@ -434,7 +434,7 @@ __metadata:
434434
"@lumino/properties": ^2.0.3
435435
"@lumino/signaling": ^2.1.4
436436
"@lumino/virtualdom": ^2.0.3
437-
"@lumino/widgets": ^2.7.0
437+
"@lumino/widgets": ^2.7.1
438438
ajv: ^8.12.0
439439
commander: ^9.4.1
440440
css-loader: ^6.7.1
@@ -456,21 +456,21 @@ __metadata:
456456
worker-loader: ^3.0.2
457457
bin:
458458
build-labextension: lib/build-labextension.js
459-
checksum: 8a1e0003d5c1e73b5bb9c30edf990eb577d08d9964d1ada2ee439d75257754c11d3a2b7870be1684c59d5804ce2d3a104d803cbe1755e702dda48c847fe87b42
459+
checksum: e88d19e12f00586c7a42c744ed242c8192dded2f8961343c6d8d325b4363b9660f85942a406ceaf4ae2ef6b98a5a9071587cff99a13907b7a7cdb18af60de015
460460
languageName: node
461461
linkType: hard
462462

463463
"@jupyterlab/coreutils@npm:^6.3.7, @jupyterlab/coreutils@npm:^6.4.0":
464-
version: 6.4.1
465-
resolution: "@jupyterlab/coreutils@npm:6.4.1"
464+
version: 6.4.2
465+
resolution: "@jupyterlab/coreutils@npm:6.4.2"
466466
dependencies:
467467
"@lumino/coreutils": ^2.2.1
468468
"@lumino/disposable": ^2.1.4
469469
"@lumino/signaling": ^2.1.4
470470
minimist: ~1.2.0
471471
path-browserify: ^1.0.0
472472
url-parse: ~1.5.4
473-
checksum: 6679bb08d56e570a5fe98da2e100b8f242e6900a7d39454086804bab2cd522f31eca52747bc04ff27449a0006d159b9e9b13345308d0b6480a52fe944b383a11
473+
checksum: 09c65831a4a9130f2258e511eb7188ecf00052c32730425041eacbe7ebdbbf51822acbe23a46e0b267912ca07b4664580204f394379f1449bed11d1ec99cf2d1
474474
languageName: node
475475
linkType: hard
476476

@@ -488,12 +488,12 @@ __metadata:
488488
languageName: node
489489
linkType: hard
490490

491-
"@jupyterlab/nbformat@npm:^3.0.0 || ^4.0.0-alpha.21 || ^4.0.0, @jupyterlab/nbformat@npm:^4.3.7, @jupyterlab/nbformat@npm:^4.4.1":
492-
version: 4.4.1
493-
resolution: "@jupyterlab/nbformat@npm:4.4.1"
491+
"@jupyterlab/nbformat@npm:^3.0.0 || ^4.0.0-alpha.21 || ^4.0.0, @jupyterlab/nbformat@npm:^4.3.7, @jupyterlab/nbformat@npm:^4.4.2":
492+
version: 4.4.2
493+
resolution: "@jupyterlab/nbformat@npm:4.4.2"
494494
dependencies:
495495
"@lumino/coreutils": ^2.2.1
496-
checksum: cac3cc70bbd35f808cad2f76a6d85c18af00b94680527fc7c06a099dbfe3d59d53567c6556e947d7c5b5c351396ccbba16991cfa76eb96dec540d4666b301756
496+
checksum: fd000acfe69c4a3884dd503d090d36f6405a23b0a03b11ee1c0fccd8507f72b2b2310594d3097c7a3a732df1ed473346ba4fb001661e73e5477fc6bafdfc68d7
497497
languageName: node
498498
linkType: hard
499499

@@ -539,11 +539,11 @@ __metadata:
539539
linkType: hard
540540

541541
"@jupyterlab/settingregistry@npm:^4.3.7":
542-
version: 4.4.1
543-
resolution: "@jupyterlab/settingregistry@npm:4.4.1"
542+
version: 4.4.2
543+
resolution: "@jupyterlab/settingregistry@npm:4.4.2"
544544
dependencies:
545-
"@jupyterlab/nbformat": ^4.4.1
546-
"@jupyterlab/statedb": ^4.4.1
545+
"@jupyterlab/nbformat": ^4.4.2
546+
"@jupyterlab/statedb": ^4.4.2
547547
"@lumino/commands": ^2.3.2
548548
"@lumino/coreutils": ^2.2.1
549549
"@lumino/disposable": ^2.1.4
@@ -553,7 +553,7 @@ __metadata:
553553
json5: ^2.2.3
554554
peerDependencies:
555555
react: ">=16"
556-
checksum: 5da756d9fc860b1e04dc6fbafa05bc5e3d985be31224faebb7a6af434a445fdb769607b584d19f3d8c7377896279bfaec31ce2299f5073c2f770225a7196aaa1
556+
checksum: 543a8e42a691b8235860f480b5398304ef8008d56a8bf8ac0f1f7361468a90e7e68d5c931c582968f05089386a4fd8ceb43207d3d136914541b91340dc6540d9
557557
languageName: node
558558
linkType: hard
559559

@@ -576,16 +576,16 @@ __metadata:
576576
languageName: node
577577
linkType: hard
578578

579-
"@jupyterlab/statedb@npm:^4.3.7, @jupyterlab/statedb@npm:^4.4.1":
580-
version: 4.4.1
581-
resolution: "@jupyterlab/statedb@npm:4.4.1"
579+
"@jupyterlab/statedb@npm:^4.3.7, @jupyterlab/statedb@npm:^4.4.2":
580+
version: 4.4.2
581+
resolution: "@jupyterlab/statedb@npm:4.4.2"
582582
dependencies:
583583
"@lumino/commands": ^2.3.2
584584
"@lumino/coreutils": ^2.2.1
585585
"@lumino/disposable": ^2.1.4
586586
"@lumino/properties": ^2.0.3
587587
"@lumino/signaling": ^2.1.4
588-
checksum: 472893498cd9c8eb9bd9c891e2abf3d9a965e257b37e1d576f323b51032e72b16ac02d1c4b1864b0fa837089ad4e495690c2adb4a0e3685d56ee8496e43161c4
588+
checksum: 67041cf06ae2f54cdddaffa8e20d1b4269da13c474235c13a4f145b60ace96e878c94943c7f40326b0cf58a924dc7f9497e9fc252df48f5cadaa7f3f61ada422
589589
languageName: node
590590
linkType: hard
591591

@@ -738,7 +738,7 @@ __metadata:
738738
languageName: node
739739
linkType: hard
740740

741-
"@lumino/application@npm:^2.4.1, @lumino/application@npm:^2.4.3":
741+
"@lumino/application@npm:^2.4.1, @lumino/application@npm:^2.4.4":
742742
version: 2.4.4
743743
resolution: "@lumino/application@npm:2.4.4"
744744
dependencies:
@@ -862,7 +862,7 @@ __metadata:
862862
languageName: node
863863
linkType: hard
864864

865-
"@lumino/widgets@npm:^2.7.0, @lumino/widgets@npm:^2.7.1":
865+
"@lumino/widgets@npm:^2.7.1":
866866
version: 2.7.1
867867
resolution: "@lumino/widgets@npm:2.7.1"
868868
dependencies:
@@ -975,7 +975,7 @@ __metadata:
975975
shx: ^0.3.0
976976
typescript: ^4.9.5
977977
uuid: ^9.0.0
978-
webr: ^0.4.2
978+
webr: ^0.4.3
979979
languageName: unknown
980980
linkType: soft
981981

@@ -1036,11 +1036,11 @@ __metadata:
10361036
linkType: hard
10371037

10381038
"@types/node@npm:*":
1039-
version: 22.15.12
1040-
resolution: "@types/node@npm:22.15.12"
1039+
version: 22.15.17
1040+
resolution: "@types/node@npm:22.15.17"
10411041
dependencies:
10421042
undici-types: ~6.21.0
1043-
checksum: a8fd1eee5bc3e841f865d2ef6ca487fd639a3003b7acbfa720dc2dc980eb3ed89c7802d08620294f94b854bce8e1ac18ec21fff5ff632b8a8771fc4a70b0e820
1043+
checksum: f83748c14c8ae3b7d1672af4009b892a5ae652c05c4b61c39e842711e232a0db37991611364aea9522fdf48290a8cc27403138bc479ef24ff0c9222319e7858b
10441044
languageName: node
10451045
linkType: hard
10461046

@@ -1785,10 +1785,10 @@ __metadata:
17851785
languageName: node
17861786
linkType: hard
17871787

1788-
"clsx@npm:^1.1.1":
1789-
version: 1.2.1
1790-
resolution: "clsx@npm:1.2.1"
1791-
checksum: 30befca8019b2eb7dbad38cff6266cf543091dae2825c856a62a8ccf2c3ab9c2907c4d12b288b73101196767f66812365400a227581484a05f968b0307cfaf12
1788+
"clsx@npm:^2.0.0":
1789+
version: 2.1.1
1790+
resolution: "clsx@npm:2.1.1"
1791+
checksum: acd3e1ab9d8a433ecb3cc2f6a05ab95fe50b4a3cfc5ba47abb6cbf3754585fcb87b84e90c822a1f256c4198e3b41c7f6c391577ffc8678ad587fc0976b24fd57
17921792
languageName: node
17931793
linkType: hard
17941794

@@ -2160,9 +2160,9 @@ __metadata:
21602160
linkType: hard
21612161

21622162
"electron-to-chromium@npm:^1.5.149":
2163-
version: 1.5.150
2164-
resolution: "electron-to-chromium@npm:1.5.150"
2165-
checksum: 0d0dd1e045f293b4c2598910734ddc7a1ccd5bba1bd7f3319242e531e7f4d9f87f3a667593f49ec0d36662b50933efb76b7addf952c90f95cae18bb3b01327e5
2163+
version: 1.5.151
2164+
resolution: "electron-to-chromium@npm:1.5.151"
2165+
checksum: 50e272c418a8faea6bf33f15476a28f13af28ecbde95defaae5d9eb511083beebc5f3a7d19e2b4c2eb401cb2b7c924298933820f791f6da5e4b6e930d81d71eb
21662166
languageName: node
21672167
linkType: hard
21682168

@@ -4881,14 +4881,14 @@ __metadata:
48814881
linkType: hard
48824882

48834883
"react-data-grid@npm:^7.0.0-beta.44":
4884-
version: 7.0.0-canary.49
4885-
resolution: "react-data-grid@npm:7.0.0-canary.49"
4884+
version: 7.0.0-beta.52
4885+
resolution: "react-data-grid@npm:7.0.0-beta.52"
48864886
dependencies:
4887-
clsx: ^1.1.1
4887+
clsx: ^2.0.0
48884888
peerDependencies:
4889-
react: ^16.14 || ^17.0
4890-
react-dom: ^16.14 || ^17.0
4891-
checksum: fe57d441a5e56dac39a0f7e06979a27d5606515653ead31fc06f9c2fe08ebaf88ff4ab70f1565dd356b343cf4612137dea2d188a40a7e246b85dd5aa2589da04
4889+
react: ^19.0
4890+
react-dom: ^19.0
4891+
checksum: dd6e746ea7a641c416a9cb9a6a9815f56bce9bf1a3b4d20ac2de5b388923893b79d6a4151b962fea0dd43ec0b6b4da357a919fc5b6aef3f6ad22551e13000aae
48924892
languageName: node
48934893
linkType: hard
48944894

@@ -6260,8 +6260,8 @@ __metadata:
62606260
linkType: hard
62616261

62626262
"webpack@npm:*, webpack@npm:^5.76.1":
6263-
version: 5.99.7
6264-
resolution: "webpack@npm:5.99.7"
6263+
version: 5.99.8
6264+
resolution: "webpack@npm:5.99.8"
62656265
dependencies:
62666266
"@types/eslint-scope": ^3.7.7
62676267
"@types/estree": ^1.0.6
@@ -6292,13 +6292,13 @@ __metadata:
62926292
optional: true
62936293
bin:
62946294
webpack: bin/webpack.js
6295-
checksum: 691b0a57c5a4e9dc1bf99188c4b68a4ff3cf10c23ea8e726e6bf36643f40ecb0fb7a4d7a92f01b187184b8c9f3bc27ee0efc6973cf46ef3913ee6ee8fe806521
6295+
checksum: 40388883f17bb8c68fe0cc10cf158c350a90e52495c9ae465002b83a5eb0106079f42544bd7b177fb2a79fd9cd9c63f4a5a72c71474411bdccec3cfb53a597a5
62966296
languageName: node
62976297
linkType: hard
62986298

6299-
"webr@npm:^0.4.2":
6300-
version: 0.4.2
6301-
resolution: "webr@npm:0.4.2"
6299+
"webr@npm:^0.4.3":
6300+
version: 0.4.3
6301+
resolution: "webr@npm:0.4.3"
63026302
dependencies:
63036303
"@codemirror/autocomplete": ^6.8.1
63046304
"@codemirror/commands": ^6.2.4
@@ -6324,7 +6324,7 @@ __metadata:
63246324
xterm: ^5.1.0
63256325
xterm-addon-fit: ^0.7.0
63266326
xterm-readline: ^1.1.1
6327-
checksum: c7ae7b719acce56e1a2b2330d14b68d874562aa89aac63fe430d3a5f33512593a9855e5b75176cd4721414eafd7ea4d0e3a27ed5d1ce6a904b3cdc2cab99144b
6327+
checksum: 8d7ea3f6c5aea377cc16b1a86fc433fa880cc0b1132cb4897b23294c65f004f0e423aa0e5ae6f501e51354e0ca8a818437aa739dde1fffdde37783f0bb2c2f90
63286328
languageName: node
63296329
linkType: hard
63306330

0 commit comments

Comments
 (0)