@vuu-ui/vuu-data-remote 3.5.0-beta.4 → 3.5.1
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/package.json +7 -7
- package/src/inlined-worker.js +27 -25
- package/src/server-proxy/array-backed-moving-window.js +12 -17
- package/types/inlined-worker.d.ts +1 -1
- package/types/src/ConnectionManager.d.ts +36 -0
- package/types/src/DedicatedWorker.d.ts +9 -0
- package/types/src/LostConnectionHandler.d.ts +28 -0
- package/types/src/VuuAuthProvider.d.ts +39 -0
- package/types/src/VuuAuthenticator.d.ts +21 -0
- package/types/src/VuuDataSource.d.ts +74 -0
- package/types/src/WebSocketConnection.d.ts +54 -0
- package/types/src/authenticate.d.ts +15 -0
- package/types/src/constants.d.ts +41 -0
- package/types/src/data-source.d.ts +6 -0
- package/types/src/index.d.ts +11 -0
- package/types/src/inlined-worker.d.ts +1 -0
- package/types/src/message-utils.d.ts +20 -0
- package/types/src/server-proxy/array-backed-moving-window.d.ts +27 -0
- package/types/src/server-proxy/messages.d.ts +33 -0
- package/types/src/server-proxy/server-proxy.d.ts +68 -0
- package/types/src/server-proxy/viewport.d.ts +132 -0
- package/types/src/worker.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.5.
|
|
2
|
+
"version": "3.5.1",
|
|
3
3
|
"main": "./src/index.js",
|
|
4
4
|
"author": "heswell",
|
|
5
5
|
"license": "Apache-2.0",
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"type-defs": "node ../../scripts/build-type-defs.mjs"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@vuu-ui/vuu-data-types": "3.5.
|
|
15
|
-
"@vuu-ui/vuu-table-types": "3.5.
|
|
16
|
-
"@vuu-ui/vuu-filter-types": "3.5.
|
|
17
|
-
"@vuu-ui/vuu-protocol-types": "3.5.
|
|
14
|
+
"@vuu-ui/vuu-data-types": "3.5.1",
|
|
15
|
+
"@vuu-ui/vuu-table-types": "3.5.1",
|
|
16
|
+
"@vuu-ui/vuu-filter-types": "3.5.1",
|
|
17
|
+
"@vuu-ui/vuu-protocol-types": "3.5.1"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@vuu-ui/vuu-filter-parser": "3.5.
|
|
21
|
-
"@vuu-ui/vuu-utils": "3.5.
|
|
20
|
+
"@vuu-ui/vuu-filter-parser": "3.5.1",
|
|
21
|
+
"@vuu-ui/vuu-utils": "3.5.1"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"README.md",
|
package/src/inlined-worker.js
CHANGED
|
@@ -348,9 +348,10 @@ var EMPTY = [];
|
|
|
348
348
|
var KeySet = class {
|
|
349
349
|
constructor(range) {
|
|
350
350
|
__publicField(this, "keys", /* @__PURE__ */ new Map());
|
|
351
|
+
__publicField(this, "freeKeys", []);
|
|
351
352
|
__publicField(this, "nextKeyValue", 0);
|
|
352
353
|
__publicField(this, "range");
|
|
353
|
-
this.range = range;
|
|
354
|
+
this.range = { from: range.from, to: range.to };
|
|
354
355
|
this.init(range);
|
|
355
356
|
}
|
|
356
357
|
next(free = EMPTY) {
|
|
@@ -362,6 +363,7 @@ var KeySet = class {
|
|
|
362
363
|
}
|
|
363
364
|
init({ from, to }) {
|
|
364
365
|
this.keys.clear();
|
|
366
|
+
this.freeKeys.length = 0;
|
|
365
367
|
this.nextKeyValue = 0;
|
|
366
368
|
for (let rowIndex = from; rowIndex < to; rowIndex++) {
|
|
367
369
|
const nextKeyValue = this.next();
|
|
@@ -369,27 +371,34 @@ var KeySet = class {
|
|
|
369
371
|
}
|
|
370
372
|
return true;
|
|
371
373
|
}
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
374
|
+
/**
|
|
375
|
+
* Keys assigned to rows that remain within range are never changed, keys
|
|
376
|
+
* released by rows leaving the range are recycled for rows entering the
|
|
377
|
+
* range. Keys are never re-sequenced, clients may retain rows (and their
|
|
378
|
+
* keys) that remain within range, so re-assigning keys to those rows would
|
|
379
|
+
* risk duplicate keys on the client.
|
|
380
|
+
* Note: range is copied, callers may mutate the range object they pass.
|
|
381
|
+
* Returns false, keys are never resequenced.
|
|
382
|
+
*/
|
|
383
|
+
reset({ from, to }) {
|
|
384
|
+
this.range = { from, to };
|
|
385
|
+
const { freeKeys } = this;
|
|
381
386
|
this.keys.forEach((keyValue, rowIndex) => {
|
|
382
387
|
if (rowIndex < from || rowIndex >= to) {
|
|
383
388
|
freeKeys.push(keyValue);
|
|
384
389
|
this.keys.delete(rowIndex);
|
|
385
390
|
}
|
|
386
391
|
});
|
|
392
|
+
let freeKeyIndex = 0;
|
|
387
393
|
for (let rowIndex = from; rowIndex < to; rowIndex++) {
|
|
388
394
|
if (!this.keys.has(rowIndex)) {
|
|
389
|
-
const nextKeyValue = this.
|
|
395
|
+
const nextKeyValue = freeKeyIndex < freeKeys.length ? freeKeys[freeKeyIndex++] : this.nextKeyValue++;
|
|
390
396
|
this.keys.set(rowIndex, nextKeyValue);
|
|
391
397
|
}
|
|
392
398
|
}
|
|
399
|
+
if (freeKeyIndex > 0) {
|
|
400
|
+
freeKeys.splice(0, freeKeyIndex);
|
|
401
|
+
}
|
|
393
402
|
return false;
|
|
394
403
|
}
|
|
395
404
|
keyFor(rowIndex) {
|
|
@@ -571,8 +580,9 @@ var ArrayBackedMovingWindow = class {
|
|
|
571
580
|
__publicField(this, "setRowCount", (rowCount) => {
|
|
572
581
|
var _a;
|
|
573
582
|
(_a = log.info) == null ? void 0 : _a.call(log, \`setRowCount \${rowCount}\`);
|
|
574
|
-
|
|
575
|
-
|
|
583
|
+
const dataLength = Math.max(0, rowCount - __privateGet(this, _range).from);
|
|
584
|
+
if (dataLength < this.internalData.length) {
|
|
585
|
+
this.internalData.length = dataLength;
|
|
576
586
|
}
|
|
577
587
|
if (rowCount < this.rowCount) {
|
|
578
588
|
this.rowsWithinRange = 0;
|
|
@@ -655,6 +665,7 @@ var ArrayBackedMovingWindow = class {
|
|
|
655
665
|
const currentFrom = this.clientRange.from;
|
|
656
666
|
const currentTo = Math.min(this.clientRange.to, this.rowCount);
|
|
657
667
|
if (from === currentFrom && to === currentTo) {
|
|
668
|
+
this.clientRange.to = to;
|
|
658
669
|
return [false, EMPTY_ARRAY];
|
|
659
670
|
}
|
|
660
671
|
const originalRange = this.clientRange.copy();
|
|
@@ -669,18 +680,9 @@ var ArrayBackedMovingWindow = class {
|
|
|
669
680
|
}
|
|
670
681
|
const clientRows = [];
|
|
671
682
|
const offset = __privateGet(this, _range).from;
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
const row = this.internalData[i];
|
|
676
|
-
if (row) {
|
|
677
|
-
clientRows.push(row);
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
} else {
|
|
681
|
-
const end = Math.min(originalRange.from, to);
|
|
682
|
-
for (let i = from - offset; i < end - offset; i++) {
|
|
683
|
-
const row = this.internalData[i];
|
|
683
|
+
for (let i = from; i < to; i++) {
|
|
684
|
+
if (i < originalRange.from || i >= originalRange.to) {
|
|
685
|
+
const row = this.internalData[i - offset];
|
|
684
686
|
if (row) {
|
|
685
687
|
clientRows.push(row);
|
|
686
688
|
}
|
|
@@ -33,7 +33,8 @@ class ArrayBackedMovingWindow {
|
|
|
33
33
|
}
|
|
34
34
|
setRowCount = (rowCount)=>{
|
|
35
35
|
log.info?.(`setRowCount ${rowCount}`);
|
|
36
|
-
|
|
36
|
+
const dataLength = Math.max(0, rowCount - this.#range.from);
|
|
37
|
+
if (dataLength < this.internalData.length) this.internalData.length = dataLength;
|
|
37
38
|
if (rowCount < this.rowCount) {
|
|
38
39
|
this.rowsWithinRange = 0;
|
|
39
40
|
const end = Math.min(rowCount, this.clientRange.to);
|
|
@@ -68,10 +69,13 @@ class ArrayBackedMovingWindow {
|
|
|
68
69
|
log.debug?.(`setClientRange ${from} - ${to}`);
|
|
69
70
|
const currentFrom = this.clientRange.from;
|
|
70
71
|
const currentTo = Math.min(this.clientRange.to, this.rowCount);
|
|
71
|
-
if (from === currentFrom && to === currentTo)
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
if (from === currentFrom && to === currentTo) {
|
|
73
|
+
this.clientRange.to = to;
|
|
74
|
+
return [
|
|
75
|
+
false,
|
|
76
|
+
EMPTY_ARRAY
|
|
77
|
+
];
|
|
78
|
+
}
|
|
75
79
|
const originalRange = this.clientRange.copy();
|
|
76
80
|
this.clientRange.from = from;
|
|
77
81
|
this.clientRange.to = to;
|
|
@@ -82,18 +86,9 @@ class ArrayBackedMovingWindow {
|
|
|
82
86
|
}
|
|
83
87
|
const clientRows = [];
|
|
84
88
|
const offset = this.#range.from;
|
|
85
|
-
if (
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
const row = this.internalData[i];
|
|
89
|
-
if (row) clientRows.push(row);
|
|
90
|
-
}
|
|
91
|
-
} else {
|
|
92
|
-
const end = Math.min(originalRange.from, to);
|
|
93
|
-
for(let i = from - offset; i < end - offset; i++){
|
|
94
|
-
const row = this.internalData[i];
|
|
95
|
-
if (row) clientRows.push(row);
|
|
96
|
-
}
|
|
89
|
+
for(let i = from; i < to; i++)if (i < originalRange.from || i >= originalRange.to) {
|
|
90
|
+
const row = this.internalData[i - offset];
|
|
91
|
+
if (row) clientRows.push(row);
|
|
97
92
|
}
|
|
98
93
|
const serverDataRequired = this.bufferBreakout(from, to);
|
|
99
94
|
return [
|