@loaders.gl/core 4.2.0-alpha.5 → 4.2.0-alpha.6
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 +82 -51
- package/dist/dist.min.js +3 -3
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +2 -2
- package/dist/lib/api/parse-in-batches.js +1 -0
- package/dist/lib/filesystems/browser-filesystem.js +4 -3
- package/dist/lib/init.js +1 -1
- package/dist/lib/loader-utils/loggers.js +1 -0
- package/dist/null-loader.js +1 -1
- package/dist/null-worker-node.js +4 -2
- package/dist/null-worker.js +4 -2
- package/package.json +9 -8
- package/src/lib/api/parse-in-batches.ts +6 -5
- package/src/lib/utils/resource-utils.ts +1 -1
|
@@ -100,6 +100,7 @@ async function* parseChunkInBatches(transformedIterator, loader, options, contex
|
|
|
100
100
|
* @todo run through batch builder to apply options etc...
|
|
101
101
|
*/
|
|
102
102
|
function convertDataToBatch(parsedData, loader) {
|
|
103
|
+
// prettier-ignore
|
|
103
104
|
const batch = isTable(parsedData)
|
|
104
105
|
? makeBatchFromTable(parsedData)
|
|
105
106
|
: {
|
|
@@ -7,15 +7,16 @@ import { BlobFile } from '@loaders.gl/loader-utils';
|
|
|
7
7
|
* Holds a list of browser 'File' objects.
|
|
8
8
|
*/
|
|
9
9
|
export class BrowserFileSystem {
|
|
10
|
+
_fetch;
|
|
11
|
+
files = {};
|
|
12
|
+
lowerCaseFiles = {};
|
|
13
|
+
usedFiles = {};
|
|
10
14
|
/**
|
|
11
15
|
* A FileSystem API wrapper around a list of browser 'File' objects
|
|
12
16
|
* @param files
|
|
13
17
|
* @param options
|
|
14
18
|
*/
|
|
15
19
|
constructor(files, options) {
|
|
16
|
-
this.files = {};
|
|
17
|
-
this.lowerCaseFiles = {};
|
|
18
|
-
this.usedFiles = {};
|
|
19
20
|
this._fetch = options?.fetch || fetch;
|
|
20
21
|
for (let i = 0; i < files.length; ++i) {
|
|
21
22
|
const file = files[i];
|
package/dist/lib/init.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
import { log } from "./utils/log.js";
|
|
5
5
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
6
|
-
const version = typeof "4.2.0-alpha.
|
|
6
|
+
const version = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : '';
|
|
7
7
|
// @ts-ignore
|
|
8
8
|
if (!globalThis.loaders) {
|
|
9
9
|
log.log(1, `loaders.gl ${version}`)();
|
package/dist/null-loader.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
5
5
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
6
|
-
const VERSION = typeof "4.2.0-alpha.
|
|
6
|
+
const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest';
|
|
7
7
|
/**
|
|
8
8
|
* Loads any data and returns null (or optionally passes through data unparsed)
|
|
9
9
|
*/
|
package/dist/null-worker-node.js
CHANGED
|
@@ -94,7 +94,9 @@ var WorkerBody = class {
|
|
|
94
94
|
}
|
|
95
95
|
getParentPort().then((parentPort2) => {
|
|
96
96
|
if (parentPort2) {
|
|
97
|
-
parentPort2.on("message",
|
|
97
|
+
parentPort2.on("message", (message) => {
|
|
98
|
+
handleMessage(message);
|
|
99
|
+
});
|
|
98
100
|
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
99
101
|
} else {
|
|
100
102
|
globalThis.onmessage = handleMessage;
|
|
@@ -233,7 +235,7 @@ async function parseData({
|
|
|
233
235
|
}
|
|
234
236
|
|
|
235
237
|
// src/null-loader.ts
|
|
236
|
-
var VERSION = true ? "4.2.0-alpha.
|
|
238
|
+
var VERSION = true ? "4.2.0-alpha.5" : "latest";
|
|
237
239
|
var NullLoader = {
|
|
238
240
|
name: "Null loader",
|
|
239
241
|
id: "null",
|
package/dist/null-worker.js
CHANGED
|
@@ -59,7 +59,9 @@
|
|
|
59
59
|
}
|
|
60
60
|
getParentPort().then((parentPort2) => {
|
|
61
61
|
if (parentPort2) {
|
|
62
|
-
parentPort2.on("message",
|
|
62
|
+
parentPort2.on("message", (message) => {
|
|
63
|
+
handleMessage(message);
|
|
64
|
+
});
|
|
63
65
|
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
64
66
|
} else {
|
|
65
67
|
globalThis.onmessage = handleMessage;
|
|
@@ -198,7 +200,7 @@
|
|
|
198
200
|
}
|
|
199
201
|
|
|
200
202
|
// src/null-loader.ts
|
|
201
|
-
var VERSION = true ? "4.2.0-alpha.
|
|
203
|
+
var VERSION = true ? "4.2.0-alpha.5" : "latest";
|
|
202
204
|
var NullLoader = {
|
|
203
205
|
name: "Null loader",
|
|
204
206
|
id: "null",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/core",
|
|
3
|
-
"version": "4.2.0-alpha.
|
|
3
|
+
"version": "4.2.0-alpha.6",
|
|
4
4
|
"description": "The core API for working with loaders.gl loaders and writers",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
},
|
|
37
37
|
"sideEffects": false,
|
|
38
38
|
"browser": {
|
|
39
|
-
"
|
|
40
|
-
"stream": false,
|
|
41
|
-
"./src/iterators/make-stream/make-node-stream.ts": "./src/iterators/make-stream/make-dom-stream.ts",
|
|
39
|
+
"./dist/iterators/make-stream/make-node-stream.js": "./dist/iterators/make-stream/make-dom-stream.js",
|
|
42
40
|
"./src/iterators/make-stream/make-node-stream.js": "./src/iterators/make-stream/make-dom-stream.js",
|
|
43
|
-
"./
|
|
41
|
+
"./src/iterators/make-stream/make-node-stream.ts": "./src/iterators/make-stream/make-dom-stream.ts",
|
|
42
|
+
"fs": false,
|
|
43
|
+
"stream": false
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
46
46
|
"src",
|
|
@@ -55,9 +55,10 @@
|
|
|
55
55
|
"build-worker-node": "esbuild src/workers/null-worker.ts --outfile=dist/null-worker-node.js --bundle --platform=node --target=node16 --define:__VERSION__=\\\"$npm_package_version\\\""
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@loaders.gl/loader-utils": "4.2.0-alpha.
|
|
59
|
-
"@loaders.gl/
|
|
58
|
+
"@loaders.gl/loader-utils": "4.2.0-alpha.6",
|
|
59
|
+
"@loaders.gl/schema": "4.2.0-alpha.6",
|
|
60
|
+
"@loaders.gl/worker-utils": "4.2.0-alpha.6",
|
|
60
61
|
"@probe.gl/log": "^4.0.2"
|
|
61
62
|
},
|
|
62
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "37bd8ca71763529f18727ee4bf29dd176aa914ca"
|
|
63
64
|
}
|
|
@@ -186,14 +186,15 @@ async function* parseChunkInBatches(
|
|
|
186
186
|
* @todo run through batch builder to apply options etc...
|
|
187
187
|
*/
|
|
188
188
|
function convertDataToBatch(parsedData: unknown, loader: Loader): Batch {
|
|
189
|
+
// prettier-ignore
|
|
189
190
|
const batch: Batch = isTable(parsedData)
|
|
190
191
|
? makeBatchFromTable(parsedData)
|
|
191
192
|
: {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
193
|
+
shape: 'unknown',
|
|
194
|
+
batchType: 'data',
|
|
195
|
+
data: parsedData,
|
|
196
|
+
length: Array.isArray(parsedData) ? parsedData.length : 1
|
|
197
|
+
};
|
|
197
198
|
|
|
198
199
|
batch.mimeType = loader.mimeTypes[0];
|
|
199
200
|
|
|
@@ -31,7 +31,7 @@ export function getResourceUrl(resource: unknown): string {
|
|
|
31
31
|
const blob = resource as Blob;
|
|
32
32
|
// File objects have a "name" property. Blob objects don't have any
|
|
33
33
|
// url (name) information
|
|
34
|
-
return blob.name || '';
|
|
34
|
+
return (blob as any).name || '';
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
if (typeof resource === 'string') {
|