@spikard/wasm 0.3.6 → 0.5.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/README.md +21 -1
- package/dist-bundler/README.md +21 -1
- package/dist-bundler/package.json +1 -1
- package/dist-bundler/spikard_wasm.d.ts +1 -1
- package/dist-bundler/spikard_wasm_bg.js +70 -10
- package/dist-bundler/spikard_wasm_bg.wasm +0 -0
- package/dist-bundler/spikard_wasm_bg.wasm.d.ts +6 -4
- package/dist-node/README.md +21 -1
- package/dist-node/package.json +1 -1
- package/dist-node/spikard_wasm.d.ts +1 -1
- package/dist-node/spikard_wasm.js +70 -10
- package/dist-node/spikard_wasm_bg.wasm +0 -0
- package/dist-node/spikard_wasm_bg.wasm.d.ts +6 -4
- package/dist-web/README.md +21 -1
- package/dist-web/package.json +1 -1
- package/dist-web/spikard_wasm.d.ts +7 -5
- package/dist-web/spikard_wasm.js +59 -10
- package/dist-web/spikard_wasm_bg.wasm +0 -0
- package/dist-web/spikard_wasm_bg.wasm.d.ts +6 -4
- package/package.json +68 -68
package/README.md
CHANGED
|
@@ -528,12 +528,32 @@ post("/users", { bodySchema: UserSchema })(async function createUser(req) {
|
|
|
528
528
|
|
|
529
529
|
## Performance
|
|
530
530
|
|
|
531
|
+
### Benchmark Results
|
|
532
|
+
|
|
533
|
+
Latest comparative run (2025-12-20, commit `25e4fdf`, Linux x86_64, AMD EPYC 7763 2c/4t, 50 concurrency, 10s, oha). Full artifacts: `snapshots/benchmarks/20397054933`.
|
|
534
|
+
|
|
535
|
+
| Binding | Avg RPS (all workloads) | Avg latency (ms) |
|
|
536
|
+
| --- | --- | --- |
|
|
537
|
+
| spikard-rust | 55,755 | 1.00 |
|
|
538
|
+
| spikard-node | 24,283 | 2.22 |
|
|
539
|
+
| spikard-php | 20,176 | 2.66 |
|
|
540
|
+
| spikard-python | 11,902 | 4.41 |
|
|
541
|
+
| **spikard-wasm** | **10,658** | **5.70** |
|
|
542
|
+
| spikard-ruby | 8,271 | 6.50 |
|
|
543
|
+
|
|
544
|
+
WASM bindings deliver solid edge runtime performance—ideal for serverless platforms (Cloudflare Workers, Vercel Edge, Deno Deploy) where startup time and memory efficiency matter more than absolute throughput. Trade-offs vs Node.js bindings:
|
|
545
|
+
- **Advantages:** Portable across all runtimes, smaller bundle size, cold start friendly
|
|
546
|
+
- **Trade-offs:** ~2.3x lower RPS on traditional servers vs native napi-rs bindings
|
|
547
|
+
|
|
548
|
+
### Runtime Characteristics
|
|
549
|
+
|
|
531
550
|
WASM bindings provide:
|
|
532
|
-
- **WebAssembly compilation** for near-native performance
|
|
551
|
+
- **WebAssembly compilation** for near-native performance in edge runtimes
|
|
533
552
|
- **Zero-copy data structures** where supported by runtime
|
|
534
553
|
- **Shared memory optimization** for large payloads
|
|
535
554
|
- **Streaming support** for efficient data transfer
|
|
536
555
|
- **Tree-shakable ESM** for minimal bundle sizes
|
|
556
|
+
- **Multi-runtime support:** Cloudflare Workers, Deno Deploy, Vercel Edge, browsers, Node.js
|
|
537
557
|
|
|
538
558
|
### Bundle Size Optimization
|
|
539
559
|
|
package/dist-bundler/README.md
CHANGED
|
@@ -528,12 +528,32 @@ post("/users", { bodySchema: UserSchema })(async function createUser(req) {
|
|
|
528
528
|
|
|
529
529
|
## Performance
|
|
530
530
|
|
|
531
|
+
### Benchmark Results
|
|
532
|
+
|
|
533
|
+
Latest comparative run (2025-12-20, commit `25e4fdf`, Linux x86_64, AMD EPYC 7763 2c/4t, 50 concurrency, 10s, oha). Full artifacts: `snapshots/benchmarks/20397054933`.
|
|
534
|
+
|
|
535
|
+
| Binding | Avg RPS (all workloads) | Avg latency (ms) |
|
|
536
|
+
| --- | --- | --- |
|
|
537
|
+
| spikard-rust | 55,755 | 1.00 |
|
|
538
|
+
| spikard-node | 24,283 | 2.22 |
|
|
539
|
+
| spikard-php | 20,176 | 2.66 |
|
|
540
|
+
| spikard-python | 11,902 | 4.41 |
|
|
541
|
+
| **spikard-wasm** | **10,658** | **5.70** |
|
|
542
|
+
| spikard-ruby | 8,271 | 6.50 |
|
|
543
|
+
|
|
544
|
+
WASM bindings deliver solid edge runtime performance—ideal for serverless platforms (Cloudflare Workers, Vercel Edge, Deno Deploy) where startup time and memory efficiency matter more than absolute throughput. Trade-offs vs Node.js bindings:
|
|
545
|
+
- **Advantages:** Portable across all runtimes, smaller bundle size, cold start friendly
|
|
546
|
+
- **Trade-offs:** ~2.3x lower RPS on traditional servers vs native napi-rs bindings
|
|
547
|
+
|
|
548
|
+
### Runtime Characteristics
|
|
549
|
+
|
|
531
550
|
WASM bindings provide:
|
|
532
|
-
- **WebAssembly compilation** for near-native performance
|
|
551
|
+
- **WebAssembly compilation** for near-native performance in edge runtimes
|
|
533
552
|
- **Zero-copy data structures** where supported by runtime
|
|
534
553
|
- **Shared memory optimization** for large payloads
|
|
535
554
|
- **Streaming support** for efficient data transfer
|
|
536
555
|
- **Tree-shakable ESM** for minimal bundle sizes
|
|
556
|
+
- **Multi-runtime support:** Cloudflare Workers, Deno Deploy, Vercel Edge, browsers, Node.js
|
|
537
557
|
|
|
538
558
|
### Bundle Size Optimization
|
|
539
559
|
|
|
@@ -12,7 +12,7 @@ export class TestClient {
|
|
|
12
12
|
/**
|
|
13
13
|
* Build a [`TestClient`] from serialized route metadata, handler map, server config, and lifecycle hooks.
|
|
14
14
|
*/
|
|
15
|
-
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null);
|
|
15
|
+
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null, dependencies?: any | null);
|
|
16
16
|
put(path: string, options: any): Promise<any>;
|
|
17
17
|
head(path: string, headers: any): Promise<any>;
|
|
18
18
|
post(path: string, options: any): Promise<any>;
|
|
@@ -232,12 +232,16 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
232
232
|
|
|
233
233
|
let WASM_VECTOR_LEN = 0;
|
|
234
234
|
|
|
235
|
-
function
|
|
236
|
-
wasm.
|
|
235
|
+
function __wasm_bindgen_func_elem_405(arg0, arg1) {
|
|
236
|
+
wasm.__wasm_bindgen_func_elem_405(arg0, arg1);
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
function
|
|
240
|
-
wasm.
|
|
239
|
+
function __wasm_bindgen_func_elem_641(arg0, arg1, arg2) {
|
|
240
|
+
wasm.__wasm_bindgen_func_elem_641(arg0, arg1, addHeapObject(arg2));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function __wasm_bindgen_func_elem_4144(arg0, arg1, arg2, arg3) {
|
|
244
|
+
wasm.__wasm_bindgen_func_elem_4144(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
241
245
|
}
|
|
242
246
|
|
|
243
247
|
const TestClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -283,13 +287,14 @@ export class TestClient {
|
|
|
283
287
|
* @param {any} handlers
|
|
284
288
|
* @param {any} config
|
|
285
289
|
* @param {any | null} [lifecycle_hooks]
|
|
290
|
+
* @param {any | null} [dependencies]
|
|
286
291
|
*/
|
|
287
|
-
constructor(routes_json, handlers, config, lifecycle_hooks) {
|
|
292
|
+
constructor(routes_json, handlers, config, lifecycle_hooks, dependencies) {
|
|
288
293
|
try {
|
|
289
294
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
290
295
|
const ptr0 = passStringToWasm0(routes_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
291
296
|
const len0 = WASM_VECTOR_LEN;
|
|
292
|
-
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks));
|
|
297
|
+
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks), isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
293
298
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
294
299
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
295
300
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -395,6 +400,11 @@ export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
|
|
|
395
400
|
return addHeapObject(ret);
|
|
396
401
|
};
|
|
397
402
|
|
|
403
|
+
export function __wbg_Number_2d1dcfcf4ec51736(arg0) {
|
|
404
|
+
const ret = Number(getObject(arg0));
|
|
405
|
+
return ret;
|
|
406
|
+
};
|
|
407
|
+
|
|
398
408
|
export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
|
|
399
409
|
const ret = String(getObject(arg1));
|
|
400
410
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -504,6 +514,16 @@ export function __wbg_call_abb4ff46ce38be40() { return handleError(function (arg
|
|
|
504
514
|
return addHeapObject(ret);
|
|
505
515
|
}, arguments) };
|
|
506
516
|
|
|
517
|
+
export function __wbg_call_c8baa5c5e72d274e() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
518
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
519
|
+
return addHeapObject(ret);
|
|
520
|
+
}, arguments) };
|
|
521
|
+
|
|
522
|
+
export function __wbg_construct_8d61a09a064d7a0e() { return handleError(function (arg0, arg1) {
|
|
523
|
+
const ret = Reflect.construct(getObject(arg0), getObject(arg1));
|
|
524
|
+
return addHeapObject(ret);
|
|
525
|
+
}, arguments) };
|
|
526
|
+
|
|
507
527
|
export function __wbg_done_62ea16af4ce34b24(arg0) {
|
|
508
528
|
const ret = getObject(arg0).done;
|
|
509
529
|
return ret;
|
|
@@ -526,6 +546,11 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
|
526
546
|
}
|
|
527
547
|
};
|
|
528
548
|
|
|
549
|
+
export function __wbg_finally_9d2144c01c15bee7(arg0, arg1) {
|
|
550
|
+
const ret = getObject(arg0).finally(getObject(arg1));
|
|
551
|
+
return addHeapObject(ret);
|
|
552
|
+
};
|
|
553
|
+
|
|
529
554
|
export function __wbg_for_7246e2a062d6960c(arg0, arg1) {
|
|
530
555
|
const ret = Symbol.for(getStringFromWasm0(arg0, arg1));
|
|
531
556
|
return addHeapObject(ret);
|
|
@@ -540,6 +565,10 @@ export function __wbg_getRandomValues_1c61fac11405ffdc() { return handleError(fu
|
|
|
540
565
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
541
566
|
}, arguments) };
|
|
542
567
|
|
|
568
|
+
export function __wbg_getRandomValues_9b655bdd369112f2() { return handleError(function (arg0, arg1) {
|
|
569
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
570
|
+
}, arguments) };
|
|
571
|
+
|
|
543
572
|
export function __wbg_get_6b7bd52aca3f9671(arg0, arg1) {
|
|
544
573
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
545
574
|
return addHeapObject(ret);
|
|
@@ -646,6 +675,11 @@ export function __wbg_keys_f5c6002ff150fc6c(arg0) {
|
|
|
646
675
|
return addHeapObject(ret);
|
|
647
676
|
};
|
|
648
677
|
|
|
678
|
+
export function __wbg_length_1f83b8e5895c84aa(arg0) {
|
|
679
|
+
const ret = getObject(arg0).length;
|
|
680
|
+
return ret;
|
|
681
|
+
};
|
|
682
|
+
|
|
649
683
|
export function __wbg_length_22ac23eaec9d8053(arg0) {
|
|
650
684
|
const ret = getObject(arg0).length;
|
|
651
685
|
return ret;
|
|
@@ -693,7 +727,7 @@ export function __wbg_new_ff12d2b041fb48f1(arg0, arg1) {
|
|
|
693
727
|
const a = state0.a;
|
|
694
728
|
state0.a = 0;
|
|
695
729
|
try {
|
|
696
|
-
return
|
|
730
|
+
return __wasm_bindgen_func_elem_4144(a, state0.b, arg0, arg1);
|
|
697
731
|
} finally {
|
|
698
732
|
state0.a = a;
|
|
699
733
|
}
|
|
@@ -725,10 +759,20 @@ export function __wbg_now_69d776cd24f5215b() {
|
|
|
725
759
|
return ret;
|
|
726
760
|
};
|
|
727
761
|
|
|
762
|
+
export function __wbg_of_b8cd42ebb79fb759(arg0, arg1) {
|
|
763
|
+
const ret = Array.of(getObject(arg0), getObject(arg1));
|
|
764
|
+
return addHeapObject(ret);
|
|
765
|
+
};
|
|
766
|
+
|
|
728
767
|
export function __wbg_prototypesetcall_dfe9b766cdc1f1fd(arg0, arg1, arg2) {
|
|
729
768
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
730
769
|
};
|
|
731
770
|
|
|
771
|
+
export function __wbg_push_7d9be8f38fc13975(arg0, arg1) {
|
|
772
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
773
|
+
return ret;
|
|
774
|
+
};
|
|
775
|
+
|
|
732
776
|
export function __wbg_queueMicrotask_9b549dfce8865860(arg0) {
|
|
733
777
|
const ret = getObject(arg0).queueMicrotask;
|
|
734
778
|
return addHeapObject(ret);
|
|
@@ -738,6 +782,11 @@ export function __wbg_queueMicrotask_fca69f5bfad613a5(arg0) {
|
|
|
738
782
|
queueMicrotask(getObject(arg0));
|
|
739
783
|
};
|
|
740
784
|
|
|
785
|
+
export function __wbg_race_cf804f784a97f8db(arg0) {
|
|
786
|
+
const ret = Promise.race(getObject(arg0));
|
|
787
|
+
return addHeapObject(ret);
|
|
788
|
+
};
|
|
789
|
+
|
|
741
790
|
export function __wbg_resolve_fd5bfbaa4ce36e1e(arg0) {
|
|
742
791
|
const ret = Promise.resolve(getObject(arg0));
|
|
743
792
|
return addHeapObject(ret);
|
|
@@ -804,6 +853,11 @@ export function __wbg_then_4f95312d68691235(arg0, arg1) {
|
|
|
804
853
|
return addHeapObject(ret);
|
|
805
854
|
};
|
|
806
855
|
|
|
856
|
+
export function __wbg_toString_49326ce0cb2d58c4() { return handleError(function (arg0, arg1) {
|
|
857
|
+
const ret = getObject(arg0).toString(arg1);
|
|
858
|
+
return addHeapObject(ret);
|
|
859
|
+
}, arguments) };
|
|
860
|
+
|
|
807
861
|
export function __wbg_value_57b7b035e117f7ee(arg0) {
|
|
808
862
|
const ret = getObject(arg0).value;
|
|
809
863
|
return addHeapObject(ret);
|
|
@@ -815,9 +869,9 @@ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
|
|
|
815
869
|
return addHeapObject(ret);
|
|
816
870
|
};
|
|
817
871
|
|
|
818
|
-
export function
|
|
819
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
820
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
872
|
+
export function __wbindgen_cast_35aab93a0b8c860f(arg0, arg1) {
|
|
873
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 14, function: Function { arguments: [], shim_idx: 15, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
874
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_404, __wasm_bindgen_func_elem_405);
|
|
821
875
|
return addHeapObject(ret);
|
|
822
876
|
};
|
|
823
877
|
|
|
@@ -827,6 +881,12 @@ export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
|
|
|
827
881
|
return addHeapObject(ret);
|
|
828
882
|
};
|
|
829
883
|
|
|
884
|
+
export function __wbindgen_cast_75edd3f875320618(arg0, arg1) {
|
|
885
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 120, function: Function { arguments: [Externref], shim_idx: 121, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
886
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_640, __wasm_bindgen_func_elem_641);
|
|
887
|
+
return addHeapObject(ret);
|
|
888
|
+
};
|
|
889
|
+
|
|
830
890
|
export function __wbindgen_cast_9ae0607507abb057(arg0) {
|
|
831
891
|
// Cast intrinsic for `I64 -> Externref`.
|
|
832
892
|
const ret = arg0;
|
|
Binary file
|
|
@@ -6,16 +6,18 @@ export const testclient_delete: (a: number, b: number, c: number, d: number) =>
|
|
|
6
6
|
export const testclient_get: (a: number, b: number, c: number, d: number) => number;
|
|
7
7
|
export const testclient_handle_request: (a: number, b: number, c: number) => number;
|
|
8
8
|
export const testclient_head: (a: number, b: number, c: number, d: number) => number;
|
|
9
|
-
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
9
|
+
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
10
10
|
export const testclient_options: (a: number, b: number, c: number, d: number) => number;
|
|
11
11
|
export const testclient_patch: (a: number, b: number, c: number, d: number) => number;
|
|
12
12
|
export const testclient_post: (a: number, b: number, c: number, d: number) => number;
|
|
13
13
|
export const testclient_put: (a: number, b: number, c: number, d: number) => number;
|
|
14
14
|
export const testclient_trace: (a: number, b: number, c: number, d: number) => number;
|
|
15
15
|
export const init: () => void;
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
16
|
+
export const __wasm_bindgen_func_elem_405: (a: number, b: number) => void;
|
|
17
|
+
export const __wasm_bindgen_func_elem_404: (a: number, b: number) => void;
|
|
18
|
+
export const __wasm_bindgen_func_elem_641: (a: number, b: number, c: number) => void;
|
|
19
|
+
export const __wasm_bindgen_func_elem_640: (a: number, b: number) => void;
|
|
20
|
+
export const __wasm_bindgen_func_elem_4144: (a: number, b: number, c: number, d: number) => void;
|
|
19
21
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
20
22
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
21
23
|
export const __wbindgen_export3: (a: number) => void;
|
package/dist-node/README.md
CHANGED
|
@@ -528,12 +528,32 @@ post("/users", { bodySchema: UserSchema })(async function createUser(req) {
|
|
|
528
528
|
|
|
529
529
|
## Performance
|
|
530
530
|
|
|
531
|
+
### Benchmark Results
|
|
532
|
+
|
|
533
|
+
Latest comparative run (2025-12-20, commit `25e4fdf`, Linux x86_64, AMD EPYC 7763 2c/4t, 50 concurrency, 10s, oha). Full artifacts: `snapshots/benchmarks/20397054933`.
|
|
534
|
+
|
|
535
|
+
| Binding | Avg RPS (all workloads) | Avg latency (ms) |
|
|
536
|
+
| --- | --- | --- |
|
|
537
|
+
| spikard-rust | 55,755 | 1.00 |
|
|
538
|
+
| spikard-node | 24,283 | 2.22 |
|
|
539
|
+
| spikard-php | 20,176 | 2.66 |
|
|
540
|
+
| spikard-python | 11,902 | 4.41 |
|
|
541
|
+
| **spikard-wasm** | **10,658** | **5.70** |
|
|
542
|
+
| spikard-ruby | 8,271 | 6.50 |
|
|
543
|
+
|
|
544
|
+
WASM bindings deliver solid edge runtime performance—ideal for serverless platforms (Cloudflare Workers, Vercel Edge, Deno Deploy) where startup time and memory efficiency matter more than absolute throughput. Trade-offs vs Node.js bindings:
|
|
545
|
+
- **Advantages:** Portable across all runtimes, smaller bundle size, cold start friendly
|
|
546
|
+
- **Trade-offs:** ~2.3x lower RPS on traditional servers vs native napi-rs bindings
|
|
547
|
+
|
|
548
|
+
### Runtime Characteristics
|
|
549
|
+
|
|
531
550
|
WASM bindings provide:
|
|
532
|
-
- **WebAssembly compilation** for near-native performance
|
|
551
|
+
- **WebAssembly compilation** for near-native performance in edge runtimes
|
|
533
552
|
- **Zero-copy data structures** where supported by runtime
|
|
534
553
|
- **Shared memory optimization** for large payloads
|
|
535
554
|
- **Streaming support** for efficient data transfer
|
|
536
555
|
- **Tree-shakable ESM** for minimal bundle sizes
|
|
556
|
+
- **Multi-runtime support:** Cloudflare Workers, Deno Deploy, Vercel Edge, browsers, Node.js
|
|
537
557
|
|
|
538
558
|
### Bundle Size Optimization
|
|
539
559
|
|
package/dist-node/package.json
CHANGED
|
@@ -12,7 +12,7 @@ export class TestClient {
|
|
|
12
12
|
/**
|
|
13
13
|
* Build a [`TestClient`] from serialized route metadata, handler map, server config, and lifecycle hooks.
|
|
14
14
|
*/
|
|
15
|
-
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null);
|
|
15
|
+
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null, dependencies?: any | null);
|
|
16
16
|
put(path: string, options: any): Promise<any>;
|
|
17
17
|
head(path: string, headers: any): Promise<any>;
|
|
18
18
|
post(path: string, options: any): Promise<any>;
|
|
@@ -223,12 +223,16 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
223
223
|
|
|
224
224
|
let WASM_VECTOR_LEN = 0;
|
|
225
225
|
|
|
226
|
-
function
|
|
227
|
-
wasm.
|
|
226
|
+
function __wasm_bindgen_func_elem_405(arg0, arg1) {
|
|
227
|
+
wasm.__wasm_bindgen_func_elem_405(arg0, arg1);
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
function
|
|
231
|
-
wasm.
|
|
230
|
+
function __wasm_bindgen_func_elem_641(arg0, arg1, arg2) {
|
|
231
|
+
wasm.__wasm_bindgen_func_elem_641(arg0, arg1, addHeapObject(arg2));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function __wasm_bindgen_func_elem_4144(arg0, arg1, arg2, arg3) {
|
|
235
|
+
wasm.__wasm_bindgen_func_elem_4144(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
232
236
|
}
|
|
233
237
|
|
|
234
238
|
const TestClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -274,13 +278,14 @@ class TestClient {
|
|
|
274
278
|
* @param {any} handlers
|
|
275
279
|
* @param {any} config
|
|
276
280
|
* @param {any | null} [lifecycle_hooks]
|
|
281
|
+
* @param {any | null} [dependencies]
|
|
277
282
|
*/
|
|
278
|
-
constructor(routes_json, handlers, config, lifecycle_hooks) {
|
|
283
|
+
constructor(routes_json, handlers, config, lifecycle_hooks, dependencies) {
|
|
279
284
|
try {
|
|
280
285
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
281
286
|
const ptr0 = passStringToWasm0(routes_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
282
287
|
const len0 = WASM_VECTOR_LEN;
|
|
283
|
-
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks));
|
|
288
|
+
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks), isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
284
289
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
285
290
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
286
291
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -388,6 +393,11 @@ exports.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
|
|
|
388
393
|
return addHeapObject(ret);
|
|
389
394
|
};
|
|
390
395
|
|
|
396
|
+
exports.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
|
|
397
|
+
const ret = Number(getObject(arg0));
|
|
398
|
+
return ret;
|
|
399
|
+
};
|
|
400
|
+
|
|
391
401
|
exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
392
402
|
const ret = String(getObject(arg1));
|
|
393
403
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -497,6 +507,16 @@ exports.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (
|
|
|
497
507
|
return addHeapObject(ret);
|
|
498
508
|
}, arguments) };
|
|
499
509
|
|
|
510
|
+
exports.__wbg_call_c8baa5c5e72d274e = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
511
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
512
|
+
return addHeapObject(ret);
|
|
513
|
+
}, arguments) };
|
|
514
|
+
|
|
515
|
+
exports.__wbg_construct_8d61a09a064d7a0e = function() { return handleError(function (arg0, arg1) {
|
|
516
|
+
const ret = Reflect.construct(getObject(arg0), getObject(arg1));
|
|
517
|
+
return addHeapObject(ret);
|
|
518
|
+
}, arguments) };
|
|
519
|
+
|
|
500
520
|
exports.__wbg_done_62ea16af4ce34b24 = function(arg0) {
|
|
501
521
|
const ret = getObject(arg0).done;
|
|
502
522
|
return ret;
|
|
@@ -519,6 +539,11 @@ exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
|
519
539
|
}
|
|
520
540
|
};
|
|
521
541
|
|
|
542
|
+
exports.__wbg_finally_9d2144c01c15bee7 = function(arg0, arg1) {
|
|
543
|
+
const ret = getObject(arg0).finally(getObject(arg1));
|
|
544
|
+
return addHeapObject(ret);
|
|
545
|
+
};
|
|
546
|
+
|
|
522
547
|
exports.__wbg_for_7246e2a062d6960c = function(arg0, arg1) {
|
|
523
548
|
const ret = Symbol.for(getStringFromWasm0(arg0, arg1));
|
|
524
549
|
return addHeapObject(ret);
|
|
@@ -533,6 +558,10 @@ exports.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError
|
|
|
533
558
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
534
559
|
}, arguments) };
|
|
535
560
|
|
|
561
|
+
exports.__wbg_getRandomValues_9b655bdd369112f2 = function() { return handleError(function (arg0, arg1) {
|
|
562
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
563
|
+
}, arguments) };
|
|
564
|
+
|
|
536
565
|
exports.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
537
566
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
538
567
|
return addHeapObject(ret);
|
|
@@ -639,6 +668,11 @@ exports.__wbg_keys_f5c6002ff150fc6c = function(arg0) {
|
|
|
639
668
|
return addHeapObject(ret);
|
|
640
669
|
};
|
|
641
670
|
|
|
671
|
+
exports.__wbg_length_1f83b8e5895c84aa = function(arg0) {
|
|
672
|
+
const ret = getObject(arg0).length;
|
|
673
|
+
return ret;
|
|
674
|
+
};
|
|
675
|
+
|
|
642
676
|
exports.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
643
677
|
const ret = getObject(arg0).length;
|
|
644
678
|
return ret;
|
|
@@ -686,7 +720,7 @@ exports.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
|
|
|
686
720
|
const a = state0.a;
|
|
687
721
|
state0.a = 0;
|
|
688
722
|
try {
|
|
689
|
-
return
|
|
723
|
+
return __wasm_bindgen_func_elem_4144(a, state0.b, arg0, arg1);
|
|
690
724
|
} finally {
|
|
691
725
|
state0.a = a;
|
|
692
726
|
}
|
|
@@ -718,10 +752,20 @@ exports.__wbg_now_69d776cd24f5215b = function() {
|
|
|
718
752
|
return ret;
|
|
719
753
|
};
|
|
720
754
|
|
|
755
|
+
exports.__wbg_of_b8cd42ebb79fb759 = function(arg0, arg1) {
|
|
756
|
+
const ret = Array.of(getObject(arg0), getObject(arg1));
|
|
757
|
+
return addHeapObject(ret);
|
|
758
|
+
};
|
|
759
|
+
|
|
721
760
|
exports.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
722
761
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
723
762
|
};
|
|
724
763
|
|
|
764
|
+
exports.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
|
|
765
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
766
|
+
return ret;
|
|
767
|
+
};
|
|
768
|
+
|
|
725
769
|
exports.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
|
|
726
770
|
const ret = getObject(arg0).queueMicrotask;
|
|
727
771
|
return addHeapObject(ret);
|
|
@@ -731,6 +775,11 @@ exports.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
|
|
|
731
775
|
queueMicrotask(getObject(arg0));
|
|
732
776
|
};
|
|
733
777
|
|
|
778
|
+
exports.__wbg_race_cf804f784a97f8db = function(arg0) {
|
|
779
|
+
const ret = Promise.race(getObject(arg0));
|
|
780
|
+
return addHeapObject(ret);
|
|
781
|
+
};
|
|
782
|
+
|
|
734
783
|
exports.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
|
|
735
784
|
const ret = Promise.resolve(getObject(arg0));
|
|
736
785
|
return addHeapObject(ret);
|
|
@@ -797,6 +846,11 @@ exports.__wbg_then_4f95312d68691235 = function(arg0, arg1) {
|
|
|
797
846
|
return addHeapObject(ret);
|
|
798
847
|
};
|
|
799
848
|
|
|
849
|
+
exports.__wbg_toString_49326ce0cb2d58c4 = function() { return handleError(function (arg0, arg1) {
|
|
850
|
+
const ret = getObject(arg0).toString(arg1);
|
|
851
|
+
return addHeapObject(ret);
|
|
852
|
+
}, arguments) };
|
|
853
|
+
|
|
800
854
|
exports.__wbg_value_57b7b035e117f7ee = function(arg0) {
|
|
801
855
|
const ret = getObject(arg0).value;
|
|
802
856
|
return addHeapObject(ret);
|
|
@@ -808,9 +862,9 @@ exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
|
808
862
|
return addHeapObject(ret);
|
|
809
863
|
};
|
|
810
864
|
|
|
811
|
-
exports.
|
|
812
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
813
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
865
|
+
exports.__wbindgen_cast_35aab93a0b8c860f = function(arg0, arg1) {
|
|
866
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 14, function: Function { arguments: [], shim_idx: 15, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
867
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_404, __wasm_bindgen_func_elem_405);
|
|
814
868
|
return addHeapObject(ret);
|
|
815
869
|
};
|
|
816
870
|
|
|
@@ -820,6 +874,12 @@ exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
|
820
874
|
return addHeapObject(ret);
|
|
821
875
|
};
|
|
822
876
|
|
|
877
|
+
exports.__wbindgen_cast_75edd3f875320618 = function(arg0, arg1) {
|
|
878
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 120, function: Function { arguments: [Externref], shim_idx: 121, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
879
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_640, __wasm_bindgen_func_elem_641);
|
|
880
|
+
return addHeapObject(ret);
|
|
881
|
+
};
|
|
882
|
+
|
|
823
883
|
exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
824
884
|
// Cast intrinsic for `I64 -> Externref`.
|
|
825
885
|
const ret = arg0;
|
|
Binary file
|
|
@@ -6,16 +6,18 @@ export const testclient_delete: (a: number, b: number, c: number, d: number) =>
|
|
|
6
6
|
export const testclient_get: (a: number, b: number, c: number, d: number) => number;
|
|
7
7
|
export const testclient_handle_request: (a: number, b: number, c: number) => number;
|
|
8
8
|
export const testclient_head: (a: number, b: number, c: number, d: number) => number;
|
|
9
|
-
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
9
|
+
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
10
10
|
export const testclient_options: (a: number, b: number, c: number, d: number) => number;
|
|
11
11
|
export const testclient_patch: (a: number, b: number, c: number, d: number) => number;
|
|
12
12
|
export const testclient_post: (a: number, b: number, c: number, d: number) => number;
|
|
13
13
|
export const testclient_put: (a: number, b: number, c: number, d: number) => number;
|
|
14
14
|
export const testclient_trace: (a: number, b: number, c: number, d: number) => number;
|
|
15
15
|
export const init: () => void;
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
16
|
+
export const __wasm_bindgen_func_elem_405: (a: number, b: number) => void;
|
|
17
|
+
export const __wasm_bindgen_func_elem_404: (a: number, b: number) => void;
|
|
18
|
+
export const __wasm_bindgen_func_elem_641: (a: number, b: number, c: number) => void;
|
|
19
|
+
export const __wasm_bindgen_func_elem_640: (a: number, b: number) => void;
|
|
20
|
+
export const __wasm_bindgen_func_elem_4144: (a: number, b: number, c: number, d: number) => void;
|
|
19
21
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
20
22
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
21
23
|
export const __wbindgen_export3: (a: number) => void;
|
package/dist-web/README.md
CHANGED
|
@@ -528,12 +528,32 @@ post("/users", { bodySchema: UserSchema })(async function createUser(req) {
|
|
|
528
528
|
|
|
529
529
|
## Performance
|
|
530
530
|
|
|
531
|
+
### Benchmark Results
|
|
532
|
+
|
|
533
|
+
Latest comparative run (2025-12-20, commit `25e4fdf`, Linux x86_64, AMD EPYC 7763 2c/4t, 50 concurrency, 10s, oha). Full artifacts: `snapshots/benchmarks/20397054933`.
|
|
534
|
+
|
|
535
|
+
| Binding | Avg RPS (all workloads) | Avg latency (ms) |
|
|
536
|
+
| --- | --- | --- |
|
|
537
|
+
| spikard-rust | 55,755 | 1.00 |
|
|
538
|
+
| spikard-node | 24,283 | 2.22 |
|
|
539
|
+
| spikard-php | 20,176 | 2.66 |
|
|
540
|
+
| spikard-python | 11,902 | 4.41 |
|
|
541
|
+
| **spikard-wasm** | **10,658** | **5.70** |
|
|
542
|
+
| spikard-ruby | 8,271 | 6.50 |
|
|
543
|
+
|
|
544
|
+
WASM bindings deliver solid edge runtime performance—ideal for serverless platforms (Cloudflare Workers, Vercel Edge, Deno Deploy) where startup time and memory efficiency matter more than absolute throughput. Trade-offs vs Node.js bindings:
|
|
545
|
+
- **Advantages:** Portable across all runtimes, smaller bundle size, cold start friendly
|
|
546
|
+
- **Trade-offs:** ~2.3x lower RPS on traditional servers vs native napi-rs bindings
|
|
547
|
+
|
|
548
|
+
### Runtime Characteristics
|
|
549
|
+
|
|
531
550
|
WASM bindings provide:
|
|
532
|
-
- **WebAssembly compilation** for near-native performance
|
|
551
|
+
- **WebAssembly compilation** for near-native performance in edge runtimes
|
|
533
552
|
- **Zero-copy data structures** where supported by runtime
|
|
534
553
|
- **Shared memory optimization** for large payloads
|
|
535
554
|
- **Streaming support** for efficient data transfer
|
|
536
555
|
- **Tree-shakable ESM** for minimal bundle sizes
|
|
556
|
+
- **Multi-runtime support:** Cloudflare Workers, Deno Deploy, Vercel Edge, browsers, Node.js
|
|
537
557
|
|
|
538
558
|
### Bundle Size Optimization
|
|
539
559
|
|
package/dist-web/package.json
CHANGED
|
@@ -12,7 +12,7 @@ export class TestClient {
|
|
|
12
12
|
/**
|
|
13
13
|
* Build a [`TestClient`] from serialized route metadata, handler map, server config, and lifecycle hooks.
|
|
14
14
|
*/
|
|
15
|
-
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null);
|
|
15
|
+
constructor(routes_json: string, handlers: any, config: any, lifecycle_hooks?: any | null, dependencies?: any | null);
|
|
16
16
|
put(path: string, options: any): Promise<any>;
|
|
17
17
|
head(path: string, headers: any): Promise<any>;
|
|
18
18
|
post(path: string, options: any): Promise<any>;
|
|
@@ -36,16 +36,18 @@ export interface InitOutput {
|
|
|
36
36
|
readonly testclient_get: (a: number, b: number, c: number, d: number) => number;
|
|
37
37
|
readonly testclient_handle_request: (a: number, b: number, c: number) => number;
|
|
38
38
|
readonly testclient_head: (a: number, b: number, c: number, d: number) => number;
|
|
39
|
-
readonly testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
39
|
+
readonly testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
40
40
|
readonly testclient_options: (a: number, b: number, c: number, d: number) => number;
|
|
41
41
|
readonly testclient_patch: (a: number, b: number, c: number, d: number) => number;
|
|
42
42
|
readonly testclient_post: (a: number, b: number, c: number, d: number) => number;
|
|
43
43
|
readonly testclient_put: (a: number, b: number, c: number, d: number) => number;
|
|
44
44
|
readonly testclient_trace: (a: number, b: number, c: number, d: number) => number;
|
|
45
45
|
readonly init: () => void;
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
48
|
-
readonly
|
|
46
|
+
readonly __wasm_bindgen_func_elem_405: (a: number, b: number) => void;
|
|
47
|
+
readonly __wasm_bindgen_func_elem_404: (a: number, b: number) => void;
|
|
48
|
+
readonly __wasm_bindgen_func_elem_641: (a: number, b: number, c: number) => void;
|
|
49
|
+
readonly __wasm_bindgen_func_elem_640: (a: number, b: number) => void;
|
|
50
|
+
readonly __wasm_bindgen_func_elem_4144: (a: number, b: number, c: number, d: number) => void;
|
|
49
51
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
50
52
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
51
53
|
readonly __wbindgen_export3: (a: number) => void;
|
package/dist-web/spikard_wasm.js
CHANGED
|
@@ -229,12 +229,16 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
229
229
|
|
|
230
230
|
let WASM_VECTOR_LEN = 0;
|
|
231
231
|
|
|
232
|
-
function
|
|
233
|
-
wasm.
|
|
232
|
+
function __wasm_bindgen_func_elem_405(arg0, arg1) {
|
|
233
|
+
wasm.__wasm_bindgen_func_elem_405(arg0, arg1);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
function
|
|
237
|
-
wasm.
|
|
236
|
+
function __wasm_bindgen_func_elem_641(arg0, arg1, arg2) {
|
|
237
|
+
wasm.__wasm_bindgen_func_elem_641(arg0, arg1, addHeapObject(arg2));
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
function __wasm_bindgen_func_elem_4144(arg0, arg1, arg2, arg3) {
|
|
241
|
+
wasm.__wasm_bindgen_func_elem_4144(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
238
242
|
}
|
|
239
243
|
|
|
240
244
|
const TestClientFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -280,13 +284,14 @@ export class TestClient {
|
|
|
280
284
|
* @param {any} handlers
|
|
281
285
|
* @param {any} config
|
|
282
286
|
* @param {any | null} [lifecycle_hooks]
|
|
287
|
+
* @param {any | null} [dependencies]
|
|
283
288
|
*/
|
|
284
|
-
constructor(routes_json, handlers, config, lifecycle_hooks) {
|
|
289
|
+
constructor(routes_json, handlers, config, lifecycle_hooks, dependencies) {
|
|
285
290
|
try {
|
|
286
291
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
287
292
|
const ptr0 = passStringToWasm0(routes_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
288
293
|
const len0 = WASM_VECTOR_LEN;
|
|
289
|
-
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks));
|
|
294
|
+
wasm.testclient_new(retptr, ptr0, len0, addHeapObject(handlers), addHeapObject(config), isLikeNone(lifecycle_hooks) ? 0 : addHeapObject(lifecycle_hooks), isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
290
295
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
291
296
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
292
297
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -426,6 +431,10 @@ function __wbg_get_imports() {
|
|
|
426
431
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
427
432
|
return addHeapObject(ret);
|
|
428
433
|
};
|
|
434
|
+
imports.wbg.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
|
|
435
|
+
const ret = Number(getObject(arg0));
|
|
436
|
+
return ret;
|
|
437
|
+
};
|
|
429
438
|
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
430
439
|
const ret = String(getObject(arg1));
|
|
431
440
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -516,6 +525,14 @@ function __wbg_get_imports() {
|
|
|
516
525
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
517
526
|
return addHeapObject(ret);
|
|
518
527
|
}, arguments) };
|
|
528
|
+
imports.wbg.__wbg_call_c8baa5c5e72d274e = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
529
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
530
|
+
return addHeapObject(ret);
|
|
531
|
+
}, arguments) };
|
|
532
|
+
imports.wbg.__wbg_construct_8d61a09a064d7a0e = function() { return handleError(function (arg0, arg1) {
|
|
533
|
+
const ret = Reflect.construct(getObject(arg0), getObject(arg1));
|
|
534
|
+
return addHeapObject(ret);
|
|
535
|
+
}, arguments) };
|
|
519
536
|
imports.wbg.__wbg_done_62ea16af4ce34b24 = function(arg0) {
|
|
520
537
|
const ret = getObject(arg0).done;
|
|
521
538
|
return ret;
|
|
@@ -535,6 +552,10 @@ function __wbg_get_imports() {
|
|
|
535
552
|
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
536
553
|
}
|
|
537
554
|
};
|
|
555
|
+
imports.wbg.__wbg_finally_9d2144c01c15bee7 = function(arg0, arg1) {
|
|
556
|
+
const ret = getObject(arg0).finally(getObject(arg1));
|
|
557
|
+
return addHeapObject(ret);
|
|
558
|
+
};
|
|
538
559
|
imports.wbg.__wbg_for_7246e2a062d6960c = function(arg0, arg1) {
|
|
539
560
|
const ret = Symbol.for(getStringFromWasm0(arg0, arg1));
|
|
540
561
|
return addHeapObject(ret);
|
|
@@ -546,6 +567,9 @@ function __wbg_get_imports() {
|
|
|
546
567
|
imports.wbg.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
|
|
547
568
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
548
569
|
}, arguments) };
|
|
570
|
+
imports.wbg.__wbg_getRandomValues_9b655bdd369112f2 = function() { return handleError(function (arg0, arg1) {
|
|
571
|
+
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
572
|
+
}, arguments) };
|
|
549
573
|
imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
|
|
550
574
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
551
575
|
return addHeapObject(ret);
|
|
@@ -638,6 +662,10 @@ function __wbg_get_imports() {
|
|
|
638
662
|
const ret = Object.keys(getObject(arg0));
|
|
639
663
|
return addHeapObject(ret);
|
|
640
664
|
};
|
|
665
|
+
imports.wbg.__wbg_length_1f83b8e5895c84aa = function(arg0) {
|
|
666
|
+
const ret = getObject(arg0).length;
|
|
667
|
+
return ret;
|
|
668
|
+
};
|
|
641
669
|
imports.wbg.__wbg_length_22ac23eaec9d8053 = function(arg0) {
|
|
642
670
|
const ret = getObject(arg0).length;
|
|
643
671
|
return ret;
|
|
@@ -677,7 +705,7 @@ function __wbg_get_imports() {
|
|
|
677
705
|
const a = state0.a;
|
|
678
706
|
state0.a = 0;
|
|
679
707
|
try {
|
|
680
|
-
return
|
|
708
|
+
return __wasm_bindgen_func_elem_4144(a, state0.b, arg0, arg1);
|
|
681
709
|
} finally {
|
|
682
710
|
state0.a = a;
|
|
683
711
|
}
|
|
@@ -704,9 +732,17 @@ function __wbg_get_imports() {
|
|
|
704
732
|
const ret = Date.now();
|
|
705
733
|
return ret;
|
|
706
734
|
};
|
|
735
|
+
imports.wbg.__wbg_of_b8cd42ebb79fb759 = function(arg0, arg1) {
|
|
736
|
+
const ret = Array.of(getObject(arg0), getObject(arg1));
|
|
737
|
+
return addHeapObject(ret);
|
|
738
|
+
};
|
|
707
739
|
imports.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
|
|
708
740
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
709
741
|
};
|
|
742
|
+
imports.wbg.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
|
|
743
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
744
|
+
return ret;
|
|
745
|
+
};
|
|
710
746
|
imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
|
|
711
747
|
const ret = getObject(arg0).queueMicrotask;
|
|
712
748
|
return addHeapObject(ret);
|
|
@@ -714,6 +750,10 @@ function __wbg_get_imports() {
|
|
|
714
750
|
imports.wbg.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
|
|
715
751
|
queueMicrotask(getObject(arg0));
|
|
716
752
|
};
|
|
753
|
+
imports.wbg.__wbg_race_cf804f784a97f8db = function(arg0) {
|
|
754
|
+
const ret = Promise.race(getObject(arg0));
|
|
755
|
+
return addHeapObject(ret);
|
|
756
|
+
};
|
|
717
757
|
imports.wbg.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
|
|
718
758
|
const ret = Promise.resolve(getObject(arg0));
|
|
719
759
|
return addHeapObject(ret);
|
|
@@ -767,6 +807,10 @@ function __wbg_get_imports() {
|
|
|
767
807
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
768
808
|
return addHeapObject(ret);
|
|
769
809
|
};
|
|
810
|
+
imports.wbg.__wbg_toString_49326ce0cb2d58c4 = function() { return handleError(function (arg0, arg1) {
|
|
811
|
+
const ret = getObject(arg0).toString(arg1);
|
|
812
|
+
return addHeapObject(ret);
|
|
813
|
+
}, arguments) };
|
|
770
814
|
imports.wbg.__wbg_value_57b7b035e117f7ee = function(arg0) {
|
|
771
815
|
const ret = getObject(arg0).value;
|
|
772
816
|
return addHeapObject(ret);
|
|
@@ -776,9 +820,9 @@ function __wbg_get_imports() {
|
|
|
776
820
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
777
821
|
return addHeapObject(ret);
|
|
778
822
|
};
|
|
779
|
-
imports.wbg.
|
|
780
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
781
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
823
|
+
imports.wbg.__wbindgen_cast_35aab93a0b8c860f = function(arg0, arg1) {
|
|
824
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 14, function: Function { arguments: [], shim_idx: 15, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
825
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_404, __wasm_bindgen_func_elem_405);
|
|
782
826
|
return addHeapObject(ret);
|
|
783
827
|
};
|
|
784
828
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
@@ -786,6 +830,11 @@ function __wbg_get_imports() {
|
|
|
786
830
|
const ret = BigInt.asUintN(64, arg0);
|
|
787
831
|
return addHeapObject(ret);
|
|
788
832
|
};
|
|
833
|
+
imports.wbg.__wbindgen_cast_75edd3f875320618 = function(arg0, arg1) {
|
|
834
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 120, function: Function { arguments: [Externref], shim_idx: 121, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
835
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_640, __wasm_bindgen_func_elem_641);
|
|
836
|
+
return addHeapObject(ret);
|
|
837
|
+
};
|
|
789
838
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
790
839
|
// Cast intrinsic for `I64 -> Externref`.
|
|
791
840
|
const ret = arg0;
|
|
Binary file
|
|
@@ -6,16 +6,18 @@ export const testclient_delete: (a: number, b: number, c: number, d: number) =>
|
|
|
6
6
|
export const testclient_get: (a: number, b: number, c: number, d: number) => number;
|
|
7
7
|
export const testclient_handle_request: (a: number, b: number, c: number) => number;
|
|
8
8
|
export const testclient_head: (a: number, b: number, c: number, d: number) => number;
|
|
9
|
-
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
9
|
+
export const testclient_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
10
10
|
export const testclient_options: (a: number, b: number, c: number, d: number) => number;
|
|
11
11
|
export const testclient_patch: (a: number, b: number, c: number, d: number) => number;
|
|
12
12
|
export const testclient_post: (a: number, b: number, c: number, d: number) => number;
|
|
13
13
|
export const testclient_put: (a: number, b: number, c: number, d: number) => number;
|
|
14
14
|
export const testclient_trace: (a: number, b: number, c: number, d: number) => number;
|
|
15
15
|
export const init: () => void;
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
16
|
+
export const __wasm_bindgen_func_elem_405: (a: number, b: number) => void;
|
|
17
|
+
export const __wasm_bindgen_func_elem_404: (a: number, b: number) => void;
|
|
18
|
+
export const __wasm_bindgen_func_elem_641: (a: number, b: number, c: number) => void;
|
|
19
|
+
export const __wasm_bindgen_func_elem_640: (a: number, b: number) => void;
|
|
20
|
+
export const __wasm_bindgen_func_elem_4144: (a: number, b: number, c: number, d: number) => void;
|
|
19
21
|
export const __wbindgen_export: (a: number, b: number) => number;
|
|
20
22
|
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
21
23
|
export const __wbindgen_export3: (a: number) => void;
|
package/package.json
CHANGED
|
@@ -1,70 +1,70 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
2
|
+
"name": "@spikard/wasm",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "WebAssembly bindings for spikard - High-performance HTTP framework",
|
|
5
|
+
"main": "dist-bundler/spikard_wasm.js",
|
|
6
|
+
"types": "dist-bundler/spikard_wasm.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist-bundler/spikard_wasm.js",
|
|
10
|
+
"types": "./dist-bundler/spikard_wasm.d.ts",
|
|
11
|
+
"default": "./dist-bundler/spikard_wasm.js"
|
|
12
|
+
},
|
|
13
|
+
"./dist-node": {
|
|
14
|
+
"import": "./dist-node/spikard_wasm.js",
|
|
15
|
+
"require": "./dist-node/spikard_wasm.js",
|
|
16
|
+
"types": "./dist-node/spikard_wasm.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./dist-node/*": "./dist-node/*",
|
|
19
|
+
"./dist-web": {
|
|
20
|
+
"import": "./dist-web/spikard_wasm.js",
|
|
21
|
+
"types": "./dist-web/spikard_wasm.d.ts"
|
|
22
|
+
},
|
|
23
|
+
"./dist-web/*": "./dist-web/*"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"keywords": [
|
|
27
|
+
"wasm",
|
|
28
|
+
"webassembly",
|
|
29
|
+
"http",
|
|
30
|
+
"framework",
|
|
31
|
+
"rust",
|
|
32
|
+
"performance",
|
|
33
|
+
"web",
|
|
34
|
+
"api"
|
|
35
|
+
],
|
|
36
|
+
"author": {
|
|
37
|
+
"name": "Na'aman Hirschfeld",
|
|
38
|
+
"email": "nhirschfeld@gmail.com"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/Goldziher/spikard"
|
|
43
|
+
},
|
|
44
|
+
"homepage": "https://github.com/Goldziher/spikard",
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/Goldziher/spikard/issues"
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"README.md",
|
|
50
|
+
"dist-bundler",
|
|
51
|
+
"dist-node",
|
|
52
|
+
"dist-web"
|
|
53
|
+
],
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "pnpm run build:bundler",
|
|
56
|
+
"build:bundler": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target bundler --out-dir dist-bundler --release",
|
|
57
|
+
"build:web": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target web --out-dir dist-web --release",
|
|
58
|
+
"build:node": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target nodejs --out-dir dist-node --release",
|
|
59
|
+
"build:all": "pnpm run build:bundler && pnpm run build:node && pnpm run build:web",
|
|
60
|
+
"test": "PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack build --target web && PATH=\"$HOME/.cargo/bin:$PATH\" pnpm exec wasm-pack test --node",
|
|
61
|
+
"clean": "rm -rf dist-bundler dist-node dist-web node_modules"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"wasm-pack": "^0.13.1"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"registry": "https://registry.npmjs.org/",
|
|
68
|
+
"access": "public"
|
|
69
|
+
}
|
|
70
70
|
}
|