@loaders.gl/i3s 4.0.0 → 4.0.2
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/dist/dist.dev.js +64 -22
- package/dist/i3s-content-worker-node.js +27 -27
- package/dist/i3s-content-worker-node.js.map +3 -3
- package/dist/i3s-content-worker.js +45 -33
- package/package.json +11 -11
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
);
|
|
103
103
|
globalThis._loadersgl_.version = NPM_TAG;
|
|
104
104
|
} else {
|
|
105
|
-
globalThis._loadersgl_.version = "4.0.
|
|
105
|
+
globalThis._loadersgl_.version = "4.0.2";
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
return globalThis._loadersgl_.version;
|
|
@@ -602,61 +602,69 @@
|
|
|
602
602
|
__publicField(WorkerFarm, "_workerFarm");
|
|
603
603
|
|
|
604
604
|
// ../worker-utils/src/lib/worker-farm/worker-body.ts
|
|
605
|
-
function getParentPort() {
|
|
605
|
+
async function getParentPort() {
|
|
606
606
|
let parentPort;
|
|
607
607
|
try {
|
|
608
608
|
eval("globalThis.parentPort = require('worker_threads').parentPort");
|
|
609
609
|
parentPort = globalThis.parentPort;
|
|
610
610
|
} catch {
|
|
611
|
+
try {
|
|
612
|
+
eval("globalThis.workerThreadsPromise = import('worker_threads')");
|
|
613
|
+
const workerThreads = await globalThis.workerThreadsPromise;
|
|
614
|
+
parentPort = workerThreads.parentPort;
|
|
615
|
+
} catch (error) {
|
|
616
|
+
console.error(error.message);
|
|
617
|
+
}
|
|
611
618
|
}
|
|
612
619
|
return parentPort;
|
|
613
620
|
}
|
|
614
621
|
var onMessageWrapperMap = /* @__PURE__ */ new Map();
|
|
615
622
|
var WorkerBody = class {
|
|
616
623
|
/** Check that we are actually in a worker thread */
|
|
617
|
-
static inWorkerThread() {
|
|
618
|
-
return typeof self !== "undefined" || Boolean(getParentPort());
|
|
624
|
+
static async inWorkerThread() {
|
|
625
|
+
return typeof self !== "undefined" || Boolean(await getParentPort());
|
|
619
626
|
}
|
|
620
627
|
/*
|
|
621
628
|
* (type: WorkerMessageType, payload: WorkerMessagePayload) => any
|
|
622
629
|
*/
|
|
623
630
|
static set onmessage(onMessage2) {
|
|
624
|
-
function handleMessage(message) {
|
|
625
|
-
const
|
|
626
|
-
const { type, payload } =
|
|
631
|
+
async function handleMessage(message) {
|
|
632
|
+
const parentPort2 = await getParentPort();
|
|
633
|
+
const { type, payload } = parentPort2 ? message : message.data;
|
|
627
634
|
onMessage2(type, payload);
|
|
628
635
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
+
getParentPort().then((parentPort2) => {
|
|
637
|
+
if (parentPort2) {
|
|
638
|
+
parentPort2.on("message", handleMessage);
|
|
639
|
+
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
640
|
+
} else {
|
|
641
|
+
globalThis.onmessage = handleMessage;
|
|
642
|
+
}
|
|
643
|
+
});
|
|
636
644
|
}
|
|
637
|
-
static addEventListener(onMessage2) {
|
|
645
|
+
static async addEventListener(onMessage2) {
|
|
638
646
|
let onMessageWrapper = onMessageWrapperMap.get(onMessage2);
|
|
639
647
|
if (!onMessageWrapper) {
|
|
640
|
-
onMessageWrapper = (message) => {
|
|
648
|
+
onMessageWrapper = async (message) => {
|
|
641
649
|
if (!isKnownMessage(message)) {
|
|
642
650
|
return;
|
|
643
651
|
}
|
|
644
|
-
const parentPort3 = getParentPort();
|
|
652
|
+
const parentPort3 = await getParentPort();
|
|
645
653
|
const { type, payload } = parentPort3 ? message : message.data;
|
|
646
654
|
onMessage2(type, payload);
|
|
647
655
|
};
|
|
648
656
|
}
|
|
649
|
-
const parentPort2 = getParentPort();
|
|
657
|
+
const parentPort2 = await getParentPort();
|
|
650
658
|
if (parentPort2) {
|
|
651
659
|
console.error("not implemented");
|
|
652
660
|
} else {
|
|
653
661
|
globalThis.addEventListener("message", onMessageWrapper);
|
|
654
662
|
}
|
|
655
663
|
}
|
|
656
|
-
static removeEventListener(onMessage2) {
|
|
664
|
+
static async removeEventListener(onMessage2) {
|
|
657
665
|
const onMessageWrapper = onMessageWrapperMap.get(onMessage2);
|
|
658
666
|
onMessageWrapperMap.delete(onMessage2);
|
|
659
|
-
const parentPort2 = getParentPort();
|
|
667
|
+
const parentPort2 = await getParentPort();
|
|
660
668
|
if (parentPort2) {
|
|
661
669
|
console.error("not implemented");
|
|
662
670
|
} else {
|
|
@@ -668,10 +676,10 @@
|
|
|
668
676
|
* @param type
|
|
669
677
|
* @param payload
|
|
670
678
|
*/
|
|
671
|
-
static postMessage(type, payload) {
|
|
679
|
+
static async postMessage(type, payload) {
|
|
672
680
|
const data = { source: "loaders.gl", type, payload };
|
|
673
681
|
const transferList = getTransferList(payload);
|
|
674
|
-
const parentPort2 = getParentPort();
|
|
682
|
+
const parentPort2 = await getParentPort();
|
|
675
683
|
if (parentPort2) {
|
|
676
684
|
parentPort2.postMessage(data, transferList);
|
|
677
685
|
} else {
|
|
@@ -693,7 +701,11 @@
|
|
|
693
701
|
url = options.workerUrl;
|
|
694
702
|
}
|
|
695
703
|
if (options._workerType === "test") {
|
|
696
|
-
|
|
704
|
+
if (isBrowser2) {
|
|
705
|
+
url = `modules/${worker.module}/dist/${workerFile}`;
|
|
706
|
+
} else {
|
|
707
|
+
url = `modules/${worker.module}/src/workers/${worker.id}-worker-node.ts`;
|
|
708
|
+
}
|
|
697
709
|
}
|
|
698
710
|
if (!url) {
|
|
699
711
|
let version = worker.version;
|
|
@@ -786,14 +798,14 @@
|
|
|
786
798
|
return null;
|
|
787
799
|
}
|
|
788
800
|
async function loadAsArrayBuffer(url) {
|
|
789
|
-
if (!void 0 || url.startsWith("http")) {
|
|
801
|
+
if (isBrowser2 || !void 0 || url.startsWith("http")) {
|
|
790
802
|
const response = await fetch(url);
|
|
791
803
|
return await response.arrayBuffer();
|
|
792
804
|
}
|
|
793
805
|
return await (void 0)(url);
|
|
794
806
|
}
|
|
795
807
|
async function loadAsText(url) {
|
|
796
|
-
if (!void 0 || url.startsWith("http")) {
|
|
808
|
+
if (isBrowser2 || !void 0 || url.startsWith("http")) {
|
|
797
809
|
const response = await fetch(url);
|
|
798
810
|
return await response.text();
|
|
799
811
|
}
|
|
@@ -802,8 +814,8 @@
|
|
|
802
814
|
|
|
803
815
|
// ../loader-utils/src/lib/worker-loader-utils/create-loader-worker.ts
|
|
804
816
|
var requestId = 0;
|
|
805
|
-
function createLoaderWorker(loader) {
|
|
806
|
-
if (!WorkerBody.inWorkerThread()) {
|
|
817
|
+
async function createLoaderWorker(loader) {
|
|
818
|
+
if (!await WorkerBody.inWorkerThread()) {
|
|
807
819
|
return;
|
|
808
820
|
}
|
|
809
821
|
WorkerBody.onmessage = async (type, payload) => {
|
|
@@ -1343,7 +1355,7 @@
|
|
|
1343
1355
|
try {
|
|
1344
1356
|
const contentType = response.headers.get("Content-Type");
|
|
1345
1357
|
let text = response.statusText;
|
|
1346
|
-
if (contentType
|
|
1358
|
+
if (contentType?.includes("application/json")) {
|
|
1347
1359
|
text += ` ${await response.text()}`;
|
|
1348
1360
|
}
|
|
1349
1361
|
message += text;
|
|
@@ -1435,7 +1447,7 @@
|
|
|
1435
1447
|
var navigator_ = globalThis.navigator || {};
|
|
1436
1448
|
|
|
1437
1449
|
// ../../node_modules/@probe.gl/log/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
1438
|
-
var VERSION2 = true ? "4.0.
|
|
1450
|
+
var VERSION2 = true ? "4.0.2" : "untranspiled source";
|
|
1439
1451
|
var isBrowser4 = isBrowser3();
|
|
1440
1452
|
|
|
1441
1453
|
// ../../node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
@@ -5226,7 +5238,7 @@
|
|
|
5226
5238
|
_defineProperty(Ellipsoid, "WGS84", new Ellipsoid(WGS84_RADIUS_X, WGS84_RADIUS_Y, WGS84_RADIUS_Z));
|
|
5227
5239
|
|
|
5228
5240
|
// ../images/src/lib/utils/version.ts
|
|
5229
|
-
var VERSION3 = true ? "4.0.
|
|
5241
|
+
var VERSION3 = true ? "4.0.2" : "latest";
|
|
5230
5242
|
|
|
5231
5243
|
// ../images/src/lib/category-api/image-type.ts
|
|
5232
5244
|
var parseImageNode = globalThis.loaders?.parseImageNode;
|
|
@@ -5629,7 +5641,7 @@
|
|
|
5629
5641
|
};
|
|
5630
5642
|
|
|
5631
5643
|
// ../draco/src/lib/utils/version.ts
|
|
5632
|
-
var VERSION4 = true ? "4.0.
|
|
5644
|
+
var VERSION4 = true ? "4.0.2" : "latest";
|
|
5633
5645
|
|
|
5634
5646
|
// ../draco/src/draco-loader.ts
|
|
5635
5647
|
var DEFAULT_DRACO_OPTIONS = {
|
|
@@ -6310,7 +6322,7 @@
|
|
|
6310
6322
|
}
|
|
6311
6323
|
|
|
6312
6324
|
// ../textures/src/lib/utils/version.ts
|
|
6313
|
-
var VERSION5 = true ? "4.0.
|
|
6325
|
+
var VERSION5 = true ? "4.0.2" : "beta";
|
|
6314
6326
|
|
|
6315
6327
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
6316
6328
|
var BASIS_EXTERNAL_LIBRARIES = {
|
|
@@ -7838,7 +7850,7 @@
|
|
|
7838
7850
|
}
|
|
7839
7851
|
|
|
7840
7852
|
// src/i3s-content-loader.ts
|
|
7841
|
-
var VERSION6 = true ? "4.0.
|
|
7853
|
+
var VERSION6 = true ? "4.0.2" : "beta";
|
|
7842
7854
|
var I3SContentLoader = {
|
|
7843
7855
|
name: "I3S Content (Indexed Scene Layers)",
|
|
7844
7856
|
id: "i3s-content",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/i3s",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "i3s .",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -41,20 +41,20 @@
|
|
|
41
41
|
"build-worker-node": "esbuild src/workers/i3s-content-worker-node.ts --outfile=dist/i3s-content-worker-node.js --platform=node --target=node16 --minify --bundle --sourcemap --define:__VERSION__=\\\"$npm_package_version\\\""
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@loaders.gl/compression": "4.0.
|
|
45
|
-
"@loaders.gl/crypto": "4.0.
|
|
46
|
-
"@loaders.gl/draco": "4.0.
|
|
47
|
-
"@loaders.gl/images": "4.0.
|
|
48
|
-
"@loaders.gl/loader-utils": "4.0.
|
|
49
|
-
"@loaders.gl/schema": "4.0.
|
|
50
|
-
"@loaders.gl/textures": "4.0.
|
|
51
|
-
"@loaders.gl/tiles": "4.0.
|
|
44
|
+
"@loaders.gl/compression": "4.0.2",
|
|
45
|
+
"@loaders.gl/crypto": "4.0.2",
|
|
46
|
+
"@loaders.gl/draco": "4.0.2",
|
|
47
|
+
"@loaders.gl/images": "4.0.2",
|
|
48
|
+
"@loaders.gl/loader-utils": "4.0.2",
|
|
49
|
+
"@loaders.gl/schema": "4.0.2",
|
|
50
|
+
"@loaders.gl/textures": "4.0.2",
|
|
51
|
+
"@loaders.gl/tiles": "4.0.2",
|
|
52
52
|
"@math.gl/core": "^4.0.0",
|
|
53
53
|
"@math.gl/culling": "^4.0.0",
|
|
54
54
|
"@math.gl/geospatial": "^4.0.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@loaders.gl/core": "4.0.0
|
|
57
|
+
"@loaders.gl/core": "^4.0.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "471058d109d5652f28c32c1f296fd632f9a5c806"
|
|
60
60
|
}
|