@volter/tabnode 0.5.13 → 0.5.15
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
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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-
|
|
35731
|
+
"/assets/runtime-worker-C5pP4aT7.js",
|
|
35732
35732
|
import.meta.url
|
|
35733
35733
|
),
|
|
35734
35734
|
{ type: "module" }
|
|
@@ -37932,7 +37932,7 @@ const _ServerBridge = class _ServerBridge extends EventEmitter {
|
|
|
37932
37932
|
const virtualServer = this.servers.get(port);
|
|
37933
37933
|
if (!virtualServer) return false;
|
|
37934
37934
|
const bodyBuffer = body ? Buffer$9.from(new Uint8Array(body)) : void 0;
|
|
37935
|
-
if (virtualServer.server === null) {
|
|
37935
|
+
if (virtualServer.server === null || this.guestServers.has(virtualServer.server)) {
|
|
37936
37936
|
const named = Object.keys(headers).some((name) => name.toLowerCase() === "host");
|
|
37937
37937
|
const authority = `${virtualServer.hostname && virtualServer.hostname !== "0.0.0.0" && virtualServer.hostname !== "::" ? virtualServer.hostname : "127.0.0.1"}:${port}`;
|
|
37938
37938
|
await __streamOverLoopback(
|
|
@@ -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
|
}
|
|
@@ -37982,7 +37983,7 @@ const _ServerBridge = class _ServerBridge extends EventEmitter {
|
|
|
37982
37983
|
(_b2 = this.messageChannel) == null ? void 0 : _b2.port1.postMessage({ type: "stream-end", id });
|
|
37983
37984
|
return;
|
|
37984
37985
|
}
|
|
37985
|
-
if (virtualServer.server === null) {
|
|
37986
|
+
if (virtualServer.server === null || this.guestServers.has(virtualServer.server)) {
|
|
37986
37987
|
const bodyBuffer = body ? Buffer$9.from(new Uint8Array(body)) : void 0;
|
|
37987
37988
|
const named = Object.keys(headers).some((name) => name.toLowerCase() === "host");
|
|
37988
37989
|
const authority = `${virtualServer.hostname && virtualServer.hostname !== "0.0.0.0" && virtualServer.hostname !== "::" ? virtualServer.hostname : "127.0.0.1"}:${port}`;
|
package/package.json
CHANGED
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`.
|
package/src/server-bridge.ts
CHANGED
|
@@ -774,7 +774,9 @@ export class ServerBridge extends EventEmitter {
|
|
|
774
774
|
const virtualServer = this.servers.get(port);
|
|
775
775
|
if (!virtualServer) return false;
|
|
776
776
|
const bodyBuffer = body ? Buffer.from(new Uint8Array(body)) : undefined;
|
|
777
|
-
|
|
777
|
+
// A guest's listener (the old null sentinel, now a request adapter) is
|
|
778
|
+
// streamed off its connection; its adapter would answer whole.
|
|
779
|
+
if (virtualServer.server === null || this.guestServers.has(virtualServer.server)) {
|
|
778
780
|
const named = Object.keys(headers).some((name) => name.toLowerCase() === 'host');
|
|
779
781
|
const authority = `${virtualServer.hostname && virtualServer.hostname !== '0.0.0.0' && virtualServer.hostname !== '::' ? virtualServer.hostname : '127.0.0.1'}:${port}`;
|
|
780
782
|
await __streamOverLoopback(
|
|
@@ -792,14 +794,18 @@ export class ServerBridge extends EventEmitter {
|
|
|
792
794
|
onStart: (statusCode: number, statusMessage: string, headers: Record<string, string>) => void,
|
|
793
795
|
onChunk: (chunk: string | Uint8Array) => void,
|
|
794
796
|
onEnd: () => void,
|
|
797
|
+
flow?: LoopbackStreamFlow,
|
|
795
798
|
) => Promise<void>;
|
|
796
799
|
};
|
|
797
800
|
if (typeof server.handleStreamingRequest === 'function') {
|
|
801
|
+
// a registered server that streams is paced the same way: it is handed
|
|
802
|
+
// the reader's going away and the pause and resume of its own producer
|
|
798
803
|
await server.handleStreamingRequest(
|
|
799
804
|
method, url, headers, bodyBuffer,
|
|
800
805
|
(statusCode, statusMessage, respHeaders) => callbacks.start(statusCode, statusMessage, respHeaders),
|
|
801
806
|
(chunk) => callbacks.chunk(typeof chunk === 'string' ? _encoder.encode(chunk) : ownedBytes(chunk)),
|
|
802
807
|
() => callbacks.end(),
|
|
808
|
+
flow,
|
|
803
809
|
);
|
|
804
810
|
return true;
|
|
805
811
|
}
|
|
@@ -835,7 +841,7 @@ export class ServerBridge extends EventEmitter {
|
|
|
835
841
|
|
|
836
842
|
// A guest's server is a port: its answer is streamed off the connection
|
|
837
843
|
// as it arrives, which is what the page reads chunk by chunk.
|
|
838
|
-
if (virtualServer.server === null) {
|
|
844
|
+
if (virtualServer.server === null || this.guestServers.has(virtualServer.server)) {
|
|
839
845
|
const bodyBuffer = body ? Buffer.from(new Uint8Array(body)) : undefined;
|
|
840
846
|
const named = Object.keys(headers).some((name) => name.toLowerCase() === 'host');
|
|
841
847
|
const authority = `${virtualServer.hostname && virtualServer.hostname !== '0.0.0.0' && virtualServer.hostname !== '::' ? virtualServer.hostname : '127.0.0.1'}:${port}`;
|