@perspective-dev/client 4.5.2 → 5.1.0
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/cdn/perspective-server.worker.js +1 -1
- package/dist/cdn/perspective-server.worker.js.map +3 -3
- package/dist/cdn/perspective.js +2 -2
- package/dist/cdn/perspective.js.map +4 -4
- package/dist/esm/perspective.browser.d.ts +50 -1
- package/dist/esm/perspective.inline.js +2 -2
- package/dist/esm/perspective.inline.js.map +4 -4
- package/dist/esm/perspective.js +2 -2
- package/dist/esm/perspective.js.map +4 -4
- package/dist/esm/perspective.node.d.ts +3 -0
- package/dist/esm/perspective.node.js +75 -21
- package/dist/esm/perspective.node.js.map +3 -3
- package/dist/esm/ts-rs/AggSpec.d.ts +8 -0
- package/dist/esm/ts-rs/Features.d.ts +59 -0
- package/dist/esm/ts-rs/ViewConfig.d.ts +2 -0
- package/dist/esm/ts-rs/ViewConfigUpdate.d.ts +9 -0
- package/dist/esm/ts-rs/WindowAggregate.d.ts +1 -0
- package/dist/esm/ts-rs/WindowSort.d.ts +7 -0
- package/dist/esm/ts-rs/WindowSortDir.d.ts +6 -0
- package/dist/esm/ts-rs/WindowSpec.d.ts +46 -0
- package/dist/esm/ts-rs/Windows.d.ts +10 -0
- package/dist/esm/virtual_server.d.ts +8 -34
- package/dist/esm/virtual_servers/clickhouse.js +1 -1
- package/dist/esm/virtual_servers/clickhouse.js.map +3 -3
- package/dist/esm/virtual_servers/duckdb.d.ts +6 -26
- package/dist/esm/virtual_servers/duckdb.js +1 -1
- package/dist/esm/virtual_servers/duckdb.js.map +3 -3
- package/dist/esm/wasm/features.d.ts +4 -0
- package/dist/wasm/perspective-js.d.ts +96 -6
- package/dist/wasm/perspective-js.js +11 -11
- package/dist/wasm/perspective-js.wasm +0 -0
- package/dist/wasm/perspective-js.wasm.d.ts +5 -5
- package/package.json +1 -1
- package/src/rust/lib.rs +6 -0
- package/src/rust/typed_array.rs +88 -54
- package/src/rust/virtual_server.rs +98 -2
- package/src/ts/perspective.browser.ts +176 -20
- package/src/ts/perspective.cdn.ts +11 -5
- package/src/ts/perspective.node.ts +39 -8
- package/src/ts/ts-rs/AggSpec.ts +10 -0
- package/src/ts/ts-rs/Features.ts +54 -0
- package/src/ts/ts-rs/ViewConfig.ts +2 -1
- package/src/ts/ts-rs/ViewConfigUpdate.ts +9 -0
- package/src/ts/ts-rs/WindowAggregate.ts +3 -0
- package/src/ts/ts-rs/WindowSort.ts +9 -0
- package/src/ts/ts-rs/WindowSortDir.ts +8 -0
- package/src/ts/ts-rs/WindowSpec.ts +46 -0
- package/src/ts/ts-rs/Windows.ts +10 -0
- package/src/ts/virtual_server.ts +17 -55
- package/src/ts/virtual_servers/clickhouse.ts +45 -2
- package/src/ts/virtual_servers/duckdb.ts +46 -4
- package/src/ts/wasm/cdn.ts +32 -0
- package/src/ts/wasm/engine.ts +7 -5
- package/src/ts/wasm/features.ts +31 -0
|
@@ -3,7 +3,9 @@ export type * from "./virtual_server.ts";
|
|
|
3
3
|
import { WebSocketServer as HttpWebSocketServer } from "ws";
|
|
4
4
|
import http from "node:http";
|
|
5
5
|
import * as perspective_client from "../../dist/wasm/perspective-js.js";
|
|
6
|
+
import { host_supports_memory64 } from "./wasm/features.ts";
|
|
6
7
|
import * as engine from "./wasm/engine.ts";
|
|
8
|
+
export { host_supports_memory64 } from "./wasm/features.ts";
|
|
7
9
|
import * as virtual_server from "./virtual_server.ts";
|
|
8
10
|
export { GenericSQLVirtualServerModel, VirtualDataSlice, VirtualServer, } from "../../dist/wasm/perspective-js.js";
|
|
9
11
|
export declare class PerspectiveServer extends engine.PerspectiveServer {
|
|
@@ -83,6 +85,7 @@ declare const _default: {
|
|
|
83
85
|
join: typeof join;
|
|
84
86
|
websocket: typeof websocket;
|
|
85
87
|
worker: typeof worker;
|
|
88
|
+
host_supports_memory64: typeof host_supports_memory64;
|
|
86
89
|
get_hosted_table_names: typeof get_hosted_table_names;
|
|
87
90
|
on_hosted_tables_update: typeof on_hosted_tables_update;
|
|
88
91
|
remove_hosted_tables_update: typeof remove_hosted_tables_update;
|
|
@@ -1650,7 +1650,7 @@ var VirtualServer = class {
|
|
|
1650
1650
|
return takeObject(ret);
|
|
1651
1651
|
}
|
|
1652
1652
|
/**
|
|
1653
|
-
* @param {
|
|
1653
|
+
* @param {VirtualServerHandler} handler
|
|
1654
1654
|
*/
|
|
1655
1655
|
constructor(handler) {
|
|
1656
1656
|
try {
|
|
@@ -2035,7 +2035,7 @@ function __wbg_get_imports() {
|
|
|
2035
2035
|
const a = state0.a;
|
|
2036
2036
|
state0.a = 0;
|
|
2037
2037
|
try {
|
|
2038
|
-
return
|
|
2038
|
+
return __wasm_bindgen_func_elem_11388(a, state0.b, arg02, arg12);
|
|
2039
2039
|
} finally {
|
|
2040
2040
|
state0.a = a;
|
|
2041
2041
|
}
|
|
@@ -2199,11 +2199,11 @@ function __wbg_get_imports() {
|
|
|
2199
2199
|
console.warn(getObject(arg0));
|
|
2200
2200
|
},
|
|
2201
2201
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2202
|
-
const ret = makeClosure(arg0, arg1, wasm.
|
|
2202
|
+
const ret = makeClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1125, __wasm_bindgen_func_elem_1843);
|
|
2203
2203
|
return addHeapObject(ret);
|
|
2204
2204
|
},
|
|
2205
2205
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2206
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2206
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_4193, __wasm_bindgen_func_elem_4210);
|
|
2207
2207
|
return addHeapObject(ret);
|
|
2208
2208
|
},
|
|
2209
2209
|
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
@@ -2268,15 +2268,15 @@ function __wbg_get_imports() {
|
|
|
2268
2268
|
"./perspective-js.wasm_bg.js": import0
|
|
2269
2269
|
};
|
|
2270
2270
|
}
|
|
2271
|
-
function
|
|
2272
|
-
const ret = wasm.
|
|
2271
|
+
function __wasm_bindgen_func_elem_1843(arg0, arg1) {
|
|
2272
|
+
const ret = wasm.__wasm_bindgen_func_elem_1843(arg0, arg1);
|
|
2273
2273
|
return takeObject(ret);
|
|
2274
2274
|
}
|
|
2275
|
-
function
|
|
2276
|
-
wasm.
|
|
2275
|
+
function __wasm_bindgen_func_elem_4210(arg0, arg1, arg2) {
|
|
2276
|
+
wasm.__wasm_bindgen_func_elem_4210(arg0, arg1, addHeapObject(arg2));
|
|
2277
2277
|
}
|
|
2278
|
-
function
|
|
2279
|
-
wasm.
|
|
2278
|
+
function __wasm_bindgen_func_elem_11388(arg0, arg1, arg2, arg3) {
|
|
2279
|
+
wasm.__wasm_bindgen_func_elem_11388(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
2280
2280
|
}
|
|
2281
2281
|
var ClientFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
|
|
2282
2282
|
}, unregister: () => {
|
|
@@ -2675,6 +2675,30 @@ async function load_wasm_stage_0(wasm2) {
|
|
|
2675
2675
|
}
|
|
2676
2676
|
}
|
|
2677
2677
|
|
|
2678
|
+
// src/ts/wasm/features.ts
|
|
2679
|
+
var MEMORY64_PROBE = new Uint8Array([
|
|
2680
|
+
0,
|
|
2681
|
+
97,
|
|
2682
|
+
115,
|
|
2683
|
+
109,
|
|
2684
|
+
1,
|
|
2685
|
+
0,
|
|
2686
|
+
0,
|
|
2687
|
+
0,
|
|
2688
|
+
5,
|
|
2689
|
+
3,
|
|
2690
|
+
1,
|
|
2691
|
+
4,
|
|
2692
|
+
1
|
|
2693
|
+
]);
|
|
2694
|
+
var MEMORY64_SUPPORTED;
|
|
2695
|
+
function host_supports_memory64() {
|
|
2696
|
+
if (MEMORY64_SUPPORTED === void 0) {
|
|
2697
|
+
MEMORY64_SUPPORTED = WebAssembly.validate(MEMORY64_PROBE);
|
|
2698
|
+
}
|
|
2699
|
+
return MEMORY64_SUPPORTED;
|
|
2700
|
+
}
|
|
2701
|
+
|
|
2678
2702
|
// src/ts/wasm/engine.ts
|
|
2679
2703
|
var AsyncLock = class {
|
|
2680
2704
|
tail = Promise.resolve();
|
|
@@ -2796,19 +2820,21 @@ var PerspectiveSession = class {
|
|
|
2796
2820
|
}
|
|
2797
2821
|
};
|
|
2798
2822
|
async function convert_typed_array_to_pointer(core, array, callback) {
|
|
2823
|
+
const is_64 = core._psp_is_memory64();
|
|
2799
2824
|
const ptr = core._psp_alloc(
|
|
2800
|
-
|
|
2825
|
+
is_64 ? BigInt(array.byteLength) : array.byteLength
|
|
2801
2826
|
);
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2827
|
+
const addr = is_64 ? Number(ptr) : Number(ptr) >>> 0;
|
|
2828
|
+
core.HEAPU8.set(array, addr);
|
|
2829
|
+
const msg = await callback(ptr);
|
|
2830
|
+
core._psp_free(ptr);
|
|
2805
2831
|
return msg;
|
|
2806
2832
|
}
|
|
2807
2833
|
async function decode_api_responses(core, ptr, callback) {
|
|
2808
2834
|
const is_64 = core._psp_is_memory64();
|
|
2809
2835
|
const response = new DataView(
|
|
2810
2836
|
core.HEAPU8.buffer,
|
|
2811
|
-
Number(ptr) >>> 0,
|
|
2837
|
+
is_64 ? Number(ptr) : Number(ptr) >>> 0,
|
|
2812
2838
|
is_64 ? 12 : 8
|
|
2813
2839
|
);
|
|
2814
2840
|
const num_msgs = response.getUint32(0, true);
|
|
@@ -3377,13 +3403,39 @@ function make_node_disk_bridge({
|
|
|
3377
3403
|
}
|
|
3378
3404
|
};
|
|
3379
3405
|
}
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3406
|
+
async function compile_server_module(wasm_path) {
|
|
3407
|
+
const buffer = await fs.readFile(wasm_path);
|
|
3408
|
+
const bytes = await load_wasm_stage_0(buffer.buffer);
|
|
3409
|
+
return await compile_perspective(bytes.buffer, {
|
|
3384
3410
|
make_disk_bridge: make_node_disk_bridge
|
|
3385
|
-
})
|
|
3386
|
-
|
|
3411
|
+
});
|
|
3412
|
+
}
|
|
3413
|
+
async function load_server_module() {
|
|
3414
|
+
if (host_supports_memory64()) {
|
|
3415
|
+
let wasm_path;
|
|
3416
|
+
try {
|
|
3417
|
+
wasm_path = resolve(
|
|
3418
|
+
"@perspective-dev/server/dist/wasm/perspective-server.memory64.wasm"
|
|
3419
|
+
);
|
|
3420
|
+
} catch (e) {
|
|
3421
|
+
wasm_path = void 0;
|
|
3422
|
+
}
|
|
3423
|
+
if (wasm_path !== void 0) {
|
|
3424
|
+
try {
|
|
3425
|
+
return await compile_server_module(wasm_path);
|
|
3426
|
+
} catch (e) {
|
|
3427
|
+
console.warn(
|
|
3428
|
+
"Memory64 perspective server wasm failed to load, falling back to wasm32",
|
|
3429
|
+
e
|
|
3430
|
+
);
|
|
3431
|
+
}
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
return await compile_server_module(
|
|
3435
|
+
resolve("@perspective-dev/server/dist/wasm/perspective-server.wasm")
|
|
3436
|
+
);
|
|
3437
|
+
}
|
|
3438
|
+
var SYNC_MODULE = await load_server_module();
|
|
3387
3439
|
var SYNC_CLIENT;
|
|
3388
3440
|
var SYNC_SERVER = new PerspectiveServer(SYNC_MODULE);
|
|
3389
3441
|
var SYNC_SESSION = SYNC_SERVER.make_session(
|
|
@@ -3584,6 +3636,7 @@ var perspective_node_default = {
|
|
|
3584
3636
|
join,
|
|
3585
3637
|
websocket: websocket2,
|
|
3586
3638
|
worker,
|
|
3639
|
+
host_supports_memory64,
|
|
3587
3640
|
get_hosted_table_names,
|
|
3588
3641
|
on_hosted_tables_update,
|
|
3589
3642
|
remove_hosted_tables_update,
|
|
@@ -3604,6 +3657,7 @@ export {
|
|
|
3604
3657
|
cwd_static_file_handler,
|
|
3605
3658
|
perspective_node_default as default,
|
|
3606
3659
|
get_hosted_table_names,
|
|
3660
|
+
host_supports_memory64,
|
|
3607
3661
|
join,
|
|
3608
3662
|
make_client,
|
|
3609
3663
|
make_session,
|