File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change 22// Copyright (c) JupyterLite Contributors
33// Distributed under the terms of the Modified BSD License.
44
5- import coincident from 'coincident' ;
5+ // @ts -expect-error - no types available
6+ import coincident from 'coincident/main' ;
7+
8+ const { Worker : CoincidentWorker } = coincident ( ) ;
69
710import { ISignal , Signal } from '@lumino/signaling' ;
811import { PromiseDelegate } from '@lumino/coreutils' ;
@@ -48,14 +51,17 @@ export class WebWorkerKernel implements IKernel {
4851 this . _kernelspec = kernelspec ;
4952 this . _contentsManager = contentsManager ;
5053 this . _sendMessage = sendMessage ;
51- this . _worker = new Worker ( new URL ( './worker.js' , import . meta. url ) , {
52- type : 'module'
53- } ) ;
5454
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 ;
5563 this . _worker . onmessage = this . _processWorkerMessage . bind ( this ) ;
5664
57- this . _remote = coincident ( this . _worker ) as IXeusKernel ;
58-
5965 this . setupFilesystemAPIs ( ) ;
6066
6167 this . _remote . initialize ( this . _kernelspec , PageConfig . getBaseUrl ( ) ) ;
Original file line number Diff line number Diff line change 22// Copyright (c) JupyterLite Contributors
33// Distributed under the terms of the Modified BSD License.
44
5- import coincident from 'coincident' ;
5+ // @ts -expect-error - no types available
6+ import coincident from 'coincident/worker' ;
67
78import {
89 ContentsAPI ,
@@ -19,7 +20,7 @@ declare function createXeusModule(options: any): any;
1920
2021globalThis . Module = { } ;
2122
22- const workerAPI = coincident ( self ) as typeof globalThis ;
23+ const { proxy : workerAPI } = await coincident ( ) ;
2324
2425/**
2526 * An Emscripten-compatible synchronous Contents API using shared array buffers.
You can’t perform that action at this time.
0 commit comments