@mittwald/flow-remote-core 0.2.0-alpha.1031 → 0.2.0-alpha.1033
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/js/_virtual/_rolldown/runtime.mjs +13 -0
- package/dist/js/index-node.mjs +21 -17
- package/dist/js/index-node.mjs.map +1 -1
- package/dist/js/index.mjs +24 -16
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs +33 -36
- package/dist/js/node_modules/.pnpm/@quilted_events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/Thread.mjs +167 -225
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/Thread.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/constants.mjs +6 -9
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/constants.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/errors.mjs +9 -7
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/errors.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/functions/ThreadFunctionsAutomatic.mjs +68 -67
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/functions/ThreadFunctionsAutomatic.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/nanoid.mjs +8 -8
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/nanoid.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/ThreadSerializationStructuredClone.mjs +130 -210
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/ThreadSerializationStructuredClone.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/shared.mjs +8 -6
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/serialization/shared.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadIframe.mjs +152 -159
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadIframe.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadNestedIframe.mjs +76 -84
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/ThreadNestedIframe.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadNestedWindow.mjs +117 -137
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadNestedWindow.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadWindow.mjs +189 -208
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/ThreadWindow.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/shared.mjs +6 -4
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/threads/window/shared.mjs.map +1 -1
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/transfer.mjs +12 -13
- package/dist/js/node_modules/.pnpm/@quilted_threads@3.3.1_patch_hash_df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/transfer.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/connection/connectHostRenderRoot.mjs +51 -61
- package/dist/js/packages/remote-core/src/connection/connectHostRenderRoot.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/connection/connectRemoteIframe.mjs +73 -101
- package/dist/js/packages/remote-core/src/connection/connectRemoteIframe.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/connection/index.mjs +4 -0
- package/dist/js/packages/remote-core/src/connection/types.mjs +13 -11
- package/dist/js/packages/remote-core/src/connection/types.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/error.mjs +10 -8
- package/dist/js/packages/remote-core/src/error.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/events/remoteEvents.mjs +14 -16
- package/dist/js/packages/remote-core/src/events/remoteEvents.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/ext-bridge/getWithMergedHostConfig.mjs +10 -8
- package/dist/js/packages/remote-core/src/ext-bridge/getWithMergedHostConfig.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/ext-bridge/implementation.mjs +8 -12
- package/dist/js/packages/remote-core/src/ext-bridge/implementation.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/FlowThreadSerialization.mjs +49 -61
- package/dist/js/packages/remote-core/src/serialization/FlowThreadSerialization.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/Serializer.mjs +31 -31
- package/dist/js/packages/remote-core/src/serialization/Serializer.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/index.mjs +10 -0
- package/dist/js/packages/remote-core/src/serialization/serializers/dataTransferText.mjs +20 -21
- package/dist/js/packages/remote-core/src/serialization/serializers/dataTransferText.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/date.mjs +13 -14
- package/dist/js/packages/remote-core/src/serialization/serializers/date.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/file.mjs +27 -28
- package/dist/js/packages/remote-core/src/serialization/serializers/file.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/fileList.mjs +18 -22
- package/dist/js/packages/remote-core/src/serialization/serializers/fileList.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/formData.mjs +27 -34
- package/dist/js/packages/remote-core/src/serialization/serializers/formData.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/index.mjs +23 -7
- package/dist/js/packages/remote-core/src/serialization/serializers/index.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/serialization/serializers/passwordPolicy.mjs +13 -14
- package/dist/js/packages/remote-core/src/serialization/serializers/passwordPolicy.mjs.map +1 -1
- package/dist/js/packages/remote-core/src/shim.mjs +32 -15
- package/dist/js/packages/remote-core/src/shim.mjs.map +1 -1
- package/dist/types/index-node.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/shim.d.ts +13 -1
- package/dist/types/shim.d.ts.map +1 -1
- package/package.json +9 -11
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
|
+
let target = {};
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return target;
|
|
11
|
+
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { __exportAll };
|
package/dist/js/index-node.mjs
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { domShimApplied } from "./packages/remote-core/src/shim.mjs";
|
|
2
|
+
import { Serializer } from "./packages/remote-core/src/serialization/Serializer.mjs";
|
|
3
|
+
import { calendarDateSerializer } from "./packages/remote-core/src/serialization/serializers/date.mjs";
|
|
4
|
+
import { fileDeSerialize, fileSerialize, fileSerializer, isSerializedFile } from "./packages/remote-core/src/serialization/serializers/file.mjs";
|
|
5
|
+
import { fileListSerializer } from "./packages/remote-core/src/serialization/serializers/fileList.mjs";
|
|
6
|
+
import { dataTransferTextSerializer } from "./packages/remote-core/src/serialization/serializers/dataTransferText.mjs";
|
|
7
|
+
import { formDataSerializer } from "./packages/remote-core/src/serialization/serializers/formData.mjs";
|
|
8
|
+
import { passwordPolicySerializer } from "./packages/remote-core/src/serialization/serializers/passwordPolicy.mjs";
|
|
9
|
+
import { FlowThreadSerialization } from "./packages/remote-core/src/serialization/FlowThreadSerialization.mjs";
|
|
10
|
+
import { Version } from "./packages/remote-core/src/connection/types.mjs";
|
|
11
|
+
import { RemoteError } from "./packages/remote-core/src/error.mjs";
|
|
12
|
+
import { connectHostRenderRoot, connectHostRenderRootRef, connectRemoteReceiver } from "./packages/remote-core/src/connection/connectHostRenderRoot.mjs";
|
|
13
|
+
import { componentRenderedEventSchema, parseReportedEvent, reportedEventSchema } from "./packages/remote-core/src/events/remoteEvents.mjs";
|
|
14
|
+
import { connectRemoteIframe, connectRemoteIframeRef } from "./packages/remote-core/src/connection/connectRemoteIframe.mjs";
|
|
15
|
+
import { RemoteElement, RemoteEvent, RemoteReceiver } from "./index.mjs";
|
|
16
|
+
//#region src/index-node.ts
|
|
17
|
+
if (!domShimApplied) throw new Error("remote-core DOM shim failed to initialize");
|
|
18
|
+
//#endregion
|
|
19
|
+
export { FlowThreadSerialization, RemoteElement, RemoteError, RemoteEvent, RemoteReceiver, Serializer, Version, calendarDateSerializer, componentRenderedEventSchema, connectHostRenderRoot, connectHostRenderRootRef, connectRemoteIframe, connectRemoteIframeRef, connectRemoteReceiver, dataTransferTextSerializer, fileDeSerialize, fileListSerializer, fileSerialize, fileSerializer, formDataSerializer, isSerializedFile, parseReportedEvent, passwordPolicySerializer, reportedEventSchema };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=index-node.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-node.mjs","
|
|
1
|
+
{"version":3,"file":"index-node.mjs","names":[],"sources":["../../src/index-node.ts"],"sourcesContent":["// The `node` export condition resolves here. The shim must be the very first\n// import so the DOM globals exist before any sibling module transitively pulls\n// in RemoteElement (which subclasses HTMLElement). Do NOT simplify this to a\n// bare `import \"./shim\"` or a plain `export * from \"./index\"`: Rollup then hoists\n// the remote-dom import ahead of the shim and SSR breaks with \"HTMLElement is\n// not defined\". Importing the shim as a used binding keeps it first.\nimport { domShimApplied } from \"./shim\";\nif (!domShimApplied) {\n throw new Error(\"remote-core DOM shim failed to initialize\");\n}\nexport * from \"./index\";\n"],"mappings":";;;;;;;;;;;;;;;;AAOA,IAAI,CAAC,gBACH,MAAM,IAAI,MAAM,2CAA2C"}
|
package/dist/js/index.mjs
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { domShimApplied } from "./packages/remote-core/src/shim.mjs";
|
|
2
|
+
import { Serializer } from "./packages/remote-core/src/serialization/Serializer.mjs";
|
|
3
|
+
import { calendarDateSerializer } from "./packages/remote-core/src/serialization/serializers/date.mjs";
|
|
4
|
+
import { fileDeSerialize, fileSerialize, fileSerializer, isSerializedFile } from "./packages/remote-core/src/serialization/serializers/file.mjs";
|
|
5
|
+
import { fileListSerializer } from "./packages/remote-core/src/serialization/serializers/fileList.mjs";
|
|
6
|
+
import { dataTransferTextSerializer } from "./packages/remote-core/src/serialization/serializers/dataTransferText.mjs";
|
|
7
|
+
import { formDataSerializer } from "./packages/remote-core/src/serialization/serializers/formData.mjs";
|
|
8
|
+
import { passwordPolicySerializer } from "./packages/remote-core/src/serialization/serializers/passwordPolicy.mjs";
|
|
9
|
+
import { FlowThreadSerialization } from "./packages/remote-core/src/serialization/FlowThreadSerialization.mjs";
|
|
10
|
+
import "./packages/remote-core/src/serialization/index.mjs";
|
|
11
|
+
import { Version } from "./packages/remote-core/src/connection/types.mjs";
|
|
12
|
+
import { RemoteError } from "./packages/remote-core/src/error.mjs";
|
|
13
|
+
import { connectHostRenderRoot, connectHostRenderRootRef, connectRemoteReceiver } from "./packages/remote-core/src/connection/connectHostRenderRoot.mjs";
|
|
14
|
+
import { componentRenderedEventSchema, parseReportedEvent, reportedEventSchema } from "./packages/remote-core/src/events/remoteEvents.mjs";
|
|
15
|
+
import { connectRemoteIframe, connectRemoteIframeRef } from "./packages/remote-core/src/connection/connectRemoteIframe.mjs";
|
|
16
|
+
import "./packages/remote-core/src/connection/index.mjs";
|
|
17
|
+
import { RemoteReceiver } from "@mittwald/remote-dom-core/receivers";
|
|
18
|
+
import { RemoteElement, RemoteEvent } from "@mittwald/remote-dom-core/elements";
|
|
19
|
+
//#region src/index.ts
|
|
20
|
+
if (!domShimApplied) throw new Error("remote-core DOM shim failed to initialize");
|
|
21
|
+
//#endregion
|
|
22
|
+
export { FlowThreadSerialization, RemoteElement, RemoteError, RemoteEvent, RemoteReceiver, Serializer, Version, calendarDateSerializer, componentRenderedEventSchema, connectHostRenderRoot, connectHostRenderRootRef, connectRemoteIframe, connectRemoteIframeRef, connectRemoteReceiver, dataTransferTextSerializer, fileDeSerialize, fileListSerializer, fileSerialize, fileSerializer, formDataSerializer, isSerializedFile, parseReportedEvent, passwordPolicySerializer, reportedEventSchema };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=index.mjs.map
|
package/dist/js/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/index.ts"],"sourcesContent":["import { domShimApplied } from \"./shim\";\n\nexport { RemoteReceiver } from \"@mittwald/remote-dom-core/receivers\";\nexport {\n RemoteElement,\n RemoteEvent,\n type RemoteElementConstructor,\n} from \"@mittwald/remote-dom-core/elements\";\nexport * from \"./serialization\";\nexport * from \"./connection\";\nexport * from \"./error\";\nexport * from \"./events/remoteEvents\";\n\n// The DOM shim above must be evaluated before RemoteElement (which subclasses\n// HTMLElement) is imported. Referencing the binding keeps the import from being\n// tree-shaken or reordered after the remote-dom re-export.\nif (!domShimApplied) {\n throw new Error(\"remote-core DOM shim failed to initialize\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBA,IAAI,CAAC,gBACH,MAAM,IAAI,MAAM,2CAA2C"}
|
|
@@ -1,38 +1,35 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@quilted+events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs
|
|
1
2
|
/**
|
|
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
|
-
|
|
3
|
+
* An `AbortController` that will automatically abort when any of
|
|
4
|
+
* its "parent" `AbortController`s abort. This is useful for when
|
|
5
|
+
* you have nested asynchronous operations that may abort independently.
|
|
6
|
+
* The `AbortController` can also be independently aborted.
|
|
7
|
+
*
|
|
8
|
+
* To associate the parent `AbortController`s, pass their signals
|
|
9
|
+
* as arguments to the constructor.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* import {NestedAbortController} from '@shopify/events';
|
|
13
|
+
*
|
|
14
|
+
* const parent = new AbortController();
|
|
15
|
+
* const nested = new NestedAbortController(parent.signal);
|
|
16
|
+
*
|
|
17
|
+
* parent.abort();
|
|
18
|
+
* nested.signal.aborted; // true
|
|
19
|
+
*/
|
|
20
|
+
var NestedAbortController = class extends AbortController {
|
|
21
|
+
constructor(...parents) {
|
|
22
|
+
super();
|
|
23
|
+
const abortedSignal = parents.find((signal) => signal.aborted);
|
|
24
|
+
if (abortedSignal) this.abort(abortedSignal.reason);
|
|
25
|
+
else {
|
|
26
|
+
const abort = (event) => this.abort(event.target.reason);
|
|
27
|
+
const options = { signal: this.signal };
|
|
28
|
+
for (const signal of parents) signal.addEventListener("abort", abort, options);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
37
33
|
export { NestedAbortController };
|
|
38
|
-
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=NestedAbortController.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestedAbortController.mjs","sources":["../../../../../../../../../../../../../node_modules/.pnpm/@quilted+events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs"],"sourcesContent":["/**\n * An `AbortController` that will automatically abort when any of\n * its \"parent\" `AbortController`s abort. This is useful for when\n * you have nested asynchronous operations that may abort independently.\n * The `AbortController` can also be independently aborted.\n *\n * To associate the parent `AbortController`s, pass their signals\n * as arguments to the constructor.\n *\n * @example\n * import {NestedAbortController} from '@shopify/events';\n *\n * const parent = new AbortController();\n * const nested = new NestedAbortController(parent.signal);\n *\n * parent.abort();\n * nested.signal.aborted; // true\n */\nclass NestedAbortController extends AbortController {\n constructor(...parents) {\n super();\n const abortedSignal = parents.find(signal => signal.aborted);\n if (abortedSignal) {\n this.abort(abortedSignal.reason);\n } else {\n const abort = event => this.abort(event.target.reason);\n const options = {\n signal: this.signal\n };\n for (const signal of parents) {\n signal.addEventListener('abort', abort, options);\n }\n }\n }\n}\n\nexport { NestedAbortController };\n"],"
|
|
1
|
+
{"version":3,"file":"NestedAbortController.mjs","names":[],"sources":["../../../../../../../../../../../../../node_modules/.pnpm/@quilted+events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs"],"sourcesContent":["/**\n * An `AbortController` that will automatically abort when any of\n * its \"parent\" `AbortController`s abort. This is useful for when\n * you have nested asynchronous operations that may abort independently.\n * The `AbortController` can also be independently aborted.\n *\n * To associate the parent `AbortController`s, pass their signals\n * as arguments to the constructor.\n *\n * @example\n * import {NestedAbortController} from '@shopify/events';\n *\n * const parent = new AbortController();\n * const nested = new NestedAbortController(parent.signal);\n *\n * parent.abort();\n * nested.signal.aborted; // true\n */\nclass NestedAbortController extends AbortController {\n constructor(...parents) {\n super();\n const abortedSignal = parents.find(signal => signal.aborted);\n if (abortedSignal) {\n this.abort(abortedSignal.reason);\n } else {\n const abort = event => this.abort(event.target.reason);\n const options = {\n signal: this.signal\n };\n for (const signal of parents) {\n signal.addEventListener('abort', abort, options);\n }\n }\n }\n}\n\nexport { NestedAbortController };\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,IAAM,wBAAN,cAAoC,gBAAgB;CAClD,YAAY,GAAG,SAAS;EACtB,MAAM;EACN,MAAM,gBAAgB,QAAQ,MAAK,WAAU,OAAO,OAAO;EAC3D,IAAI,eACF,KAAK,MAAM,cAAc,MAAM;OAC1B;GACL,MAAM,SAAQ,UAAS,KAAK,MAAM,MAAM,OAAO,MAAM;GACrD,MAAM,UAAU,EACd,QAAQ,KAAK,OACf;GACA,KAAK,MAAM,UAAU,SACnB,OAAO,iBAAiB,SAAS,OAAO,OAAO;EAEnD;CACF;AACF"}
|
|
@@ -1,231 +1,173 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { ThreadFunctionsAutomatic } from
|
|
5
|
-
import { ThreadSerializationStructuredClone } from
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { NestedAbortController } from "../../../../../../@quilted_events@2.1.5/node_modules/@quilted/events/build/esm/abort/NestedAbortController.mjs";
|
|
2
|
+
import { ThreadClosedError } from "./errors.mjs";
|
|
3
|
+
import { nanoid } from "./nanoid.mjs";
|
|
4
|
+
import { ThreadFunctionsAutomatic } from "./functions/ThreadFunctionsAutomatic.mjs";
|
|
5
|
+
import { ThreadSerializationStructuredClone } from "./serialization/ThreadSerializationStructuredClone.mjs";
|
|
6
|
+
//#region ../../node_modules/.pnpm/@quilted+threads@3.3.1_patch_hash=df15ead5d86def314ee16ab6a48f9e4faa765b52aa161b10d2848_aa11bff1669c76d0bae25976909ea4eb/node_modules/@quilted/threads/build/esm/Thread.mjs
|
|
8
7
|
/**
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
#resolveCall(...args) {
|
|
149
|
-
const callID = args[0];
|
|
150
|
-
const resolver = this.#idsToResolver.get(callID);
|
|
151
|
-
|
|
152
|
-
if (resolver) {
|
|
153
|
-
resolver(...args);
|
|
154
|
-
this.#idsToResolver.delete(callID);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
#waitForResult(id) {
|
|
159
|
-
const promise = new Promise((resolve, reject) => {
|
|
160
|
-
this.#idsToResolver.set(id, async (_, value, error) => {
|
|
161
|
-
try {
|
|
162
|
-
if (error == null) {
|
|
163
|
-
resolve(await this.serialization.deserialize(value, this));
|
|
164
|
-
} else {
|
|
165
|
-
reject(await this.serialization.deserialize(error, this));
|
|
166
|
-
}
|
|
167
|
-
} catch (deserializeError) {
|
|
168
|
-
reject(deserializeError);
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
|
|
173
|
-
Object.defineProperty(promise, Symbol.asyncIterator, {
|
|
174
|
-
async *value() {
|
|
175
|
-
const result = await promise;
|
|
176
|
-
|
|
177
|
-
Object.defineProperty(result, Symbol.asyncIterator, {
|
|
178
|
-
value: () => result
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
yield* result;
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
return promise;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
8
|
+
* A thread represents a target JavaScript environment that exposes a set
|
|
9
|
+
* of callable, asynchronous methods. The thread takes care of automatically
|
|
10
|
+
* encoding and decoding its arguments and return values, so you can interact
|
|
11
|
+
* with it as if its methods were implemented in the same environment as your
|
|
12
|
+
* own code.
|
|
13
|
+
*/
|
|
14
|
+
var Thread = class {
|
|
15
|
+
get signal() {
|
|
16
|
+
return this.#abort.signal;
|
|
17
|
+
}
|
|
18
|
+
get closed() {
|
|
19
|
+
return this.#abort.signal.aborted;
|
|
20
|
+
}
|
|
21
|
+
#abort;
|
|
22
|
+
#idsToResolver = (() => /* @__PURE__ */ new Map())();
|
|
23
|
+
constructor(messages, { imports, exports, functions = new ThreadFunctionsAutomatic(), serialization = new ThreadSerializationStructuredClone(), signal } = {}) {
|
|
24
|
+
this.messages = messages;
|
|
25
|
+
this.#abort = signal ? new NestedAbortController(signal) : new AbortController();
|
|
26
|
+
this.exports = exports ?? {};
|
|
27
|
+
this.imports = createThreadImports(this.#handlerForCall.bind(this), imports);
|
|
28
|
+
this.functions = functions;
|
|
29
|
+
this.serialization = serialization;
|
|
30
|
+
this.functions.start?.(this);
|
|
31
|
+
this.serialization.start?.(this);
|
|
32
|
+
this.signal.addEventListener("abort", () => {
|
|
33
|
+
for (const id of this.#idsToResolver.keys()) this.#resolveCall(id, void 0, new ThreadClosedError());
|
|
34
|
+
this.#idsToResolver.clear();
|
|
35
|
+
}, { once: true });
|
|
36
|
+
messages.listen(async (rawData) => {
|
|
37
|
+
if (!(Array.isArray(rawData) && typeof rawData[0] === "number")) return;
|
|
38
|
+
const data = rawData;
|
|
39
|
+
switch (data[0]) {
|
|
40
|
+
case 1: {
|
|
41
|
+
const [, id, property, args] = data;
|
|
42
|
+
const func = this.exports[property] ?? (() => {
|
|
43
|
+
throw new Error(`No '${property}' method is exported from this thread`);
|
|
44
|
+
});
|
|
45
|
+
await this.#callLocal(func, args, (value, error, transferable) => {
|
|
46
|
+
this.messages.send([
|
|
47
|
+
2,
|
|
48
|
+
id,
|
|
49
|
+
value,
|
|
50
|
+
error
|
|
51
|
+
], transferable);
|
|
52
|
+
});
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case 3: {
|
|
56
|
+
const [, callID, funcID, args] = data;
|
|
57
|
+
const func = this.functions.get(funcID, this) ?? missingThreadFunction;
|
|
58
|
+
await this.#callLocal(func, args, (value, error, transferable) => {
|
|
59
|
+
this.messages.send([
|
|
60
|
+
4,
|
|
61
|
+
callID,
|
|
62
|
+
value,
|
|
63
|
+
error
|
|
64
|
+
], transferable);
|
|
65
|
+
});
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
case 2:
|
|
69
|
+
case 4:
|
|
70
|
+
this.#resolveCall(...data.slice(1));
|
|
71
|
+
break;
|
|
72
|
+
case 5: {
|
|
73
|
+
const id = data[1];
|
|
74
|
+
this.functions.release(id, this);
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}, { signal: this.signal });
|
|
79
|
+
}
|
|
80
|
+
close() {
|
|
81
|
+
this.#abort.abort();
|
|
82
|
+
}
|
|
83
|
+
async call(func, args) {
|
|
84
|
+
if (this.closed) return Promise.reject(new ThreadClosedError());
|
|
85
|
+
const transferable = [];
|
|
86
|
+
const serialized = await this.serialization.serialize(args, this, transferable);
|
|
87
|
+
const id = nanoid();
|
|
88
|
+
const done = this.#waitForResult(id);
|
|
89
|
+
func(id, serialized, transferable);
|
|
90
|
+
return done;
|
|
91
|
+
}
|
|
92
|
+
async #callLocal(func, args, withResult) {
|
|
93
|
+
try {
|
|
94
|
+
const result = this.functions.call ? await this.functions.call(func, args, this) : await func(...await this.serialization.deserialize(args, this));
|
|
95
|
+
const transferable = [];
|
|
96
|
+
withResult(await this.serialization.serialize(result, this, transferable), void 0, transferable);
|
|
97
|
+
} catch (error) {
|
|
98
|
+
withResult(void 0, await this.serialization.serialize(error, this));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
#handlerForCall(property) {
|
|
102
|
+
return (...args) => {
|
|
103
|
+
try {
|
|
104
|
+
if (typeof property !== "string" && typeof property !== "number") throw new Error(`Can’t call a symbol method on a thread: ${property.toString()}`);
|
|
105
|
+
return this.call((id, serializedArgs, transferable) => {
|
|
106
|
+
this.messages.send([
|
|
107
|
+
1,
|
|
108
|
+
id,
|
|
109
|
+
property,
|
|
110
|
+
serializedArgs
|
|
111
|
+
], transferable);
|
|
112
|
+
}, args);
|
|
113
|
+
} catch (error) {
|
|
114
|
+
return Promise.reject(error);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
#resolveCall(...args) {
|
|
119
|
+
const callID = args[0];
|
|
120
|
+
const resolver = this.#idsToResolver.get(callID);
|
|
121
|
+
if (resolver) {
|
|
122
|
+
resolver(...args);
|
|
123
|
+
this.#idsToResolver.delete(callID);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
#waitForResult(id) {
|
|
127
|
+
const promise = new Promise((resolve, reject) => {
|
|
128
|
+
this.#idsToResolver.set(id, async (_, value, error) => {
|
|
129
|
+
try {
|
|
130
|
+
if (error == null) resolve(await this.serialization.deserialize(value, this));
|
|
131
|
+
else reject(await this.serialization.deserialize(error, this));
|
|
132
|
+
} catch (deserializeError) {
|
|
133
|
+
reject(deserializeError);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
Object.defineProperty(promise, Symbol.asyncIterator, { async *value() {
|
|
138
|
+
const result = await promise;
|
|
139
|
+
Object.defineProperty(result, Symbol.asyncIterator, { value: () => result });
|
|
140
|
+
yield* result;
|
|
141
|
+
} });
|
|
142
|
+
return promise;
|
|
143
|
+
}
|
|
144
|
+
};
|
|
189
145
|
function createThreadImports(handlerForImport, imported) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
} else {
|
|
211
|
-
call = {};
|
|
212
|
-
|
|
213
|
-
for (const method of imported) {
|
|
214
|
-
Object.defineProperty(call, method, {
|
|
215
|
-
value: handlerForImport(method),
|
|
216
|
-
writable: false,
|
|
217
|
-
configurable: true,
|
|
218
|
-
enumerable: true
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
return call;
|
|
146
|
+
let call;
|
|
147
|
+
if (imported == null) {
|
|
148
|
+
if (typeof Proxy !== "function") throw new Error(`You must pass an array of callable methods in environments without Proxies.`);
|
|
149
|
+
const cache = /* @__PURE__ */ new Map();
|
|
150
|
+
call = new Proxy({}, { get(_target, property) {
|
|
151
|
+
if (cache.has(property)) return cache.get(property);
|
|
152
|
+
const handler = handlerForImport(property);
|
|
153
|
+
cache.set(property, handler);
|
|
154
|
+
return handler;
|
|
155
|
+
} });
|
|
156
|
+
} else {
|
|
157
|
+
call = {};
|
|
158
|
+
for (const method of imported) Object.defineProperty(call, method, {
|
|
159
|
+
value: handlerForImport(method),
|
|
160
|
+
writable: false,
|
|
161
|
+
configurable: true,
|
|
162
|
+
enumerable: true
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
return call;
|
|
224
166
|
}
|
|
225
|
-
|
|
226
167
|
function missingThreadFunction() {
|
|
227
|
-
|
|
168
|
+
throw new Error(`You attempted to call a function that is not stored. It may have already been released.`);
|
|
228
169
|
}
|
|
229
|
-
|
|
170
|
+
//#endregion
|
|
230
171
|
export { Thread };
|
|
231
|
-
|
|
172
|
+
|
|
173
|
+
//# sourceMappingURL=Thread.mjs.map
|