@jupyterlite/xeus 3.0.0-a1 → 3.0.0-a3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/worker.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Copyright (c) JupyterLite Contributors
|
|
3
3
|
// Distributed under the terms of the Modified BSD License.
|
|
4
4
|
import { URLExt } from '@jupyterlab/coreutils';
|
|
5
|
+
import { bootstrapFromEmpackPackedEnvironment } from '@emscripten-forge/mambajs';
|
|
5
6
|
globalThis.Module = {};
|
|
6
7
|
// when a toplevel cell uses an await, the cell is implicitly
|
|
7
8
|
// wrapped in a async function. Since the webloop - eventloop
|
|
@@ -97,17 +98,16 @@ export class XeusRemoteKernel {
|
|
|
97
98
|
});
|
|
98
99
|
try {
|
|
99
100
|
await waitRunDependency();
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// This function is usually implemented in the pre/post.js
|
|
103
|
-
// in the emscripten build of that kernel
|
|
104
|
-
if (globalThis.Module['async_init'] !== undefined) {
|
|
101
|
+
if (globalThis.Module.FS !== undefined &&
|
|
102
|
+
globalThis.Module.loadDynamicLibrary !== undefined) {
|
|
105
103
|
const kernel_root_url = empackEnvMetaLink
|
|
106
104
|
? empackEnvMetaLink
|
|
107
105
|
: URLExt.join(baseUrl, `xeus/kernels/${kernelSpec.dir}`);
|
|
108
|
-
const pkg_root_url = URLExt.join(baseUrl, 'xeus/kernel_packages');
|
|
109
106
|
const verbose = true;
|
|
110
|
-
|
|
107
|
+
const packagesJsonUrl = `${kernel_root_url}/empack_env_meta.json`;
|
|
108
|
+
const pkgRootUrl = URLExt.join(baseUrl, 'xeus/kernel_packages');
|
|
109
|
+
const bootstrapPython = kernelSpec.name === 'xpython';
|
|
110
|
+
await bootstrapFromEmpackPackedEnvironment(packagesJsonUrl, verbose, false, globalThis.Module, pkgRootUrl, bootstrapPython);
|
|
111
111
|
}
|
|
112
112
|
await waitRunDependency();
|
|
113
113
|
rawXKernel = new globalThis.Module.xkernel();
|
|
@@ -120,11 +120,9 @@ export class XeusRemoteKernel {
|
|
|
120
120
|
catch (e) {
|
|
121
121
|
if (typeof e === 'number') {
|
|
122
122
|
const msg = globalThis.Module.get_exception_message(e);
|
|
123
|
-
console.error(msg);
|
|
124
123
|
throw new Error(msg);
|
|
125
124
|
}
|
|
126
125
|
else {
|
|
127
|
-
console.error(e);
|
|
128
126
|
throw e;
|
|
129
127
|
}
|
|
130
128
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jupyterlite/xeus",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-a3",
|
|
4
4
|
"description": "JupyterLite Xeus kernels",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jupyter",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"watch:src": "tsc -w --sourceMap"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@emscripten-forge/mambajs": "^0.2.0",
|
|
39
40
|
"@jupyterlab/coreutils": "^6",
|
|
40
41
|
"@jupyterlab/services": "~7.2.5",
|
|
41
42
|
"@jupyterlite/contents": "^0.2.0 || ^0.3.0 || ^0.4.5",
|