@volter/tabnode 0.5.13 → 0.5.14

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.
@@ -17621,10 +17621,17 @@ var implementation$1 = function bind2(that) {
17621
17621
  var implementation = implementation$1;
17622
17622
  var functionBind = Function.prototype.bind || implementation;
17623
17623
  var functionCall = Function.prototype.call;
17624
- var functionApply = Function.prototype.apply;
17624
+ var functionApply;
17625
+ var hasRequiredFunctionApply;
17626
+ function requireFunctionApply() {
17627
+ if (hasRequiredFunctionApply) return functionApply;
17628
+ hasRequiredFunctionApply = 1;
17629
+ functionApply = Function.prototype.apply;
17630
+ return functionApply;
17631
+ }
17625
17632
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
17626
17633
  var bind$2 = functionBind;
17627
- var $apply$1 = functionApply;
17634
+ var $apply$1 = requireFunctionApply();
17628
17635
  var $call$2 = functionCall;
17629
17636
  var $reflectApply = reflectApply;
17630
17637
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
@@ -17744,7 +17751,7 @@ var hasSymbols = requireHasSymbols()();
17744
17751
  var getProto = requireGetProto();
17745
17752
  var $ObjectGPO = requireObject_getPrototypeOf();
17746
17753
  var $ReflectGPO = requireReflect_getPrototypeOf();
17747
- var $apply = functionApply;
17754
+ var $apply = requireFunctionApply();
17748
17755
  var $call = functionCall;
17749
17756
  var needsEval = {};
17750
17757
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
@@ -18385,7 +18392,7 @@ function requireApplyBind() {
18385
18392
  if (hasRequiredApplyBind) return applyBind;
18386
18393
  hasRequiredApplyBind = 1;
18387
18394
  var bind3 = functionBind;
18388
- var $apply2 = functionApply;
18395
+ var $apply2 = requireFunctionApply();
18389
18396
  var actualApply$1 = actualApply;
18390
18397
  applyBind = function applyBind2() {
18391
18398
  return actualApply$1(bind3, $apply2, arguments);
package/dist/index.d.ts CHANGED
@@ -33,7 +33,7 @@ export { PackageManager, install } from './npm';
33
33
  export { ServerBridge, getServerBridge, resetServerBridge } from './server-bridge';
34
34
  export type { InitServiceWorkerOptions } from './server-bridge';
35
35
  /** What a page's request is answered with, the shape the bridge answers. */
36
- export type { ResponseData } from './node-lib/http-bridge';
36
+ export type { ResponseData, LoopbackStreamFlow } from './node-lib/http-bridge';
37
37
  export * as esbuild from './shims/esbuild';
38
38
  export * as rollup from './shims/rollup';
39
39
  export * as module from './shims/module';
package/dist/index.mjs CHANGED
@@ -35728,7 +35728,7 @@ class WorkerRuntime {
35728
35728
  this.worker = new Worker(
35729
35729
  new URL(
35730
35730
  /* @vite-ignore */
35731
- "/assets/runtime-worker-CQv8H3sj.js",
35731
+ "/assets/runtime-worker-C5pP4aT7.js",
35732
35732
  import.meta.url
35733
35733
  ),
35734
35734
  { type: "module" }
@@ -37957,7 +37957,8 @@ const _ServerBridge = class _ServerBridge extends EventEmitter {
37957
37957
  bodyBuffer,
37958
37958
  (statusCode, statusMessage, respHeaders) => callbacks.start(statusCode, statusMessage, respHeaders),
37959
37959
  (chunk) => callbacks.chunk(typeof chunk === "string" ? _encoder.encode(chunk) : ownedBytes(chunk)),
37960
- () => callbacks.end()
37960
+ () => callbacks.end(),
37961
+ flow
37961
37962
  );
37962
37963
  return true;
37963
37964
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/tabnode",
3
- "version": "0.5.13",
3
+ "version": "0.5.14",
4
4
  "description": "Node's own library, in a browser tab.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -38,7 +38,7 @@ export { PackageManager, install } from './npm';
38
38
  export { ServerBridge, getServerBridge, resetServerBridge } from './server-bridge';
39
39
  export type { InitServiceWorkerOptions } from './server-bridge';
40
40
  /** What a page's request is answered with, the shape the bridge answers. */
41
- export type { ResponseData } from './node-lib/http-bridge';
41
+ export type { ResponseData, LoopbackStreamFlow } from './node-lib/http-bridge';
42
42
  // The bundlers' own wasm builds, as doors: a host that builds outside a run
43
43
  // (the substrate's rolldown pass) reaches them here rather than through a
44
44
  // guest's `require`.
@@ -792,14 +792,18 @@ export class ServerBridge extends EventEmitter {
792
792
  onStart: (statusCode: number, statusMessage: string, headers: Record<string, string>) => void,
793
793
  onChunk: (chunk: string | Uint8Array) => void,
794
794
  onEnd: () => void,
795
+ flow?: LoopbackStreamFlow,
795
796
  ) => Promise<void>;
796
797
  };
797
798
  if (typeof server.handleStreamingRequest === 'function') {
799
+ // a registered server that streams is paced the same way: it is handed
800
+ // the reader's going away and the pause and resume of its own producer
798
801
  await server.handleStreamingRequest(
799
802
  method, url, headers, bodyBuffer,
800
803
  (statusCode, statusMessage, respHeaders) => callbacks.start(statusCode, statusMessage, respHeaders),
801
804
  (chunk) => callbacks.chunk(typeof chunk === 'string' ? _encoder.encode(chunk) : ownedBytes(chunk)),
802
805
  () => callbacks.end(),
806
+ flow,
803
807
  );
804
808
  return true;
805
809
  }