File tree 2 files changed +15
-8
lines changed
2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 2
2
// Copyright (c) JupyterLite Contributors
3
3
// Distributed under the terms of the Modified BSD License.
4
4
5
- import coincident from 'coincident' ;
5
+ // @ts -expect-error - no types available
6
+ import coincident from 'coincident/main' ;
7
+
8
+ const { Worker : CoincidentWorker } = coincident ( ) ;
6
9
7
10
import { ISignal , Signal } from '@lumino/signaling' ;
8
11
import { PromiseDelegate } from '@lumino/coreutils' ;
@@ -48,14 +51,17 @@ export class WebWorkerKernel implements IKernel {
48
51
this . _kernelspec = kernelspec ;
49
52
this . _contentsManager = contentsManager ;
50
53
this . _sendMessage = sendMessage ;
51
- this . _worker = new Worker ( new URL ( './worker.js' , import . meta. url ) , {
52
- type : 'module'
53
- } ) ;
54
54
55
+ const worker = new CoincidentWorker (
56
+ new URL ( './worker.js' , import . meta. url ) ,
57
+ {
58
+ type : 'module'
59
+ }
60
+ ) ;
61
+ this . _worker = worker ;
62
+ this . _remote = worker . proxy ;
55
63
this . _worker . onmessage = this . _processWorkerMessage . bind ( this ) ;
56
64
57
- this . _remote = coincident ( this . _worker ) as IXeusKernel ;
58
-
59
65
this . setupFilesystemAPIs ( ) ;
60
66
61
67
this . _remote . initialize ( this . _kernelspec , PageConfig . getBaseUrl ( ) ) ;
Original file line number Diff line number Diff line change 2
2
// Copyright (c) JupyterLite Contributors
3
3
// Distributed under the terms of the Modified BSD License.
4
4
5
- import coincident from 'coincident' ;
5
+ // @ts -expect-error - no types available
6
+ import coincident from 'coincident/worker' ;
6
7
7
8
import {
8
9
ContentsAPI ,
@@ -19,7 +20,7 @@ declare function createXeusModule(options: any): any;
19
20
20
21
globalThis . Module = { } ;
21
22
22
- const workerAPI = coincident ( self ) as typeof globalThis ;
23
+ const { proxy : workerAPI } = await coincident ( ) ;
23
24
24
25
/**
25
26
* An Emscripten-compatible synchronous Contents API using shared array buffers.
You can’t perform that action at this time.
0 commit comments