@effect/platform-browser 0.33.29 → 0.35.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.
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.layerWorker = exports.layerManager = exports.layer = void 0;
|
|
7
7
|
var Worker = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("@effect/platform/Worker"));
|
|
8
8
|
var _WorkerError = /*#__PURE__*/require("@effect/platform/WorkerError");
|
|
9
|
+
var Deferred = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Deferred"));
|
|
9
10
|
var Effect = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Effect"));
|
|
10
11
|
var Layer = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Layer"));
|
|
11
12
|
var Queue = /*#__PURE__*/_interopRequireWildcard( /*#__PURE__*/require("effect/Queue"));
|
|
@@ -47,6 +48,7 @@ const platformWorkerImpl = /*#__PURE__*/Worker.PlatformWorker.of({
|
|
|
47
48
|
}
|
|
48
49
|
yield* _(Effect.addFinalizer(() => Effect.sync(() => port.postMessage([1]))));
|
|
49
50
|
const queue = yield* _(Queue.unbounded());
|
|
51
|
+
const latch = yield* Deferred.make();
|
|
50
52
|
const fiber = yield* _(Effect.async(resume => {
|
|
51
53
|
function onMessage(event) {
|
|
52
54
|
queue.unsafeOffer(event.data);
|
|
@@ -59,12 +61,13 @@ const platformWorkerImpl = /*#__PURE__*/Worker.PlatformWorker.of({
|
|
|
59
61
|
}
|
|
60
62
|
port.addEventListener("message", onMessage);
|
|
61
63
|
port.addEventListener("error", onError);
|
|
64
|
+
Deferred.unsafeDone(latch, Effect.void);
|
|
62
65
|
return Effect.sync(() => {
|
|
63
66
|
port.removeEventListener("message", onMessage);
|
|
64
67
|
port.removeEventListener("error", onError);
|
|
65
68
|
});
|
|
66
69
|
}), Effect.interruptible, Effect.forkScoped);
|
|
67
|
-
yield*
|
|
70
|
+
yield* Deferred.await(latch);
|
|
68
71
|
if ("start" in port) {
|
|
69
72
|
port.start();
|
|
70
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","names":["Worker","_interopRequireWildcard","require","_WorkerError","Effect","Layer","Queue","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","platformWorkerImpl","PlatformWorker","of","PlatformWorkerTypeId","spawn","worker_","gen","_","worker","port","addFinalizer","sync","postMessage","queue","unbounded","fiber","async","resume","onMessage","event","unsafeOffer","data","onError","WorkerError","reason","error","message","addEventListener","removeEventListener","interruptible","forkScoped","
|
|
1
|
+
{"version":3,"file":"worker.js","names":["Worker","_interopRequireWildcard","require","_WorkerError","Deferred","Effect","Layer","Queue","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","platformWorkerImpl","PlatformWorker","of","PlatformWorkerTypeId","spawn","worker_","gen","_","worker","port","addFinalizer","sync","postMessage","queue","unbounded","latch","make","fiber","async","resume","onMessage","event","unsafeOffer","data","onError","WorkerError","reason","error","message","addEventListener","unsafeDone","void","removeEventListener","interruptible","forkScoped","await","start","send","transfers","try","catch","layerWorker","exports","succeed","layerManager","provide","layer","merge","layerSpawner"],"sources":["../../../src/internal/worker.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,MAAA,gBAAAC,uBAAA,eAAAC,OAAA;AACA,IAAAC,YAAA,gBAAAD,OAAA;AACA,IAAAE,QAAA,gBAAAH,uBAAA,eAAAC,OAAA;AACA,IAAAG,MAAA,gBAAAJ,uBAAA,eAAAC,OAAA;AACA,IAAAI,KAAA,gBAAAL,uBAAA,eAAAC,OAAA;AACA,IAAAK,KAAA,gBAAAN,uBAAA,eAAAC,OAAA;AAAqC,S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","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as Worker from "@effect/platform/Worker";
|
|
2
2
|
import { WorkerError } from "@effect/platform/WorkerError";
|
|
3
|
+
import * as Deferred from "effect/Deferred";
|
|
3
4
|
import * as Effect from "effect/Effect";
|
|
4
5
|
import * as Layer from "effect/Layer";
|
|
5
6
|
import * as Queue from "effect/Queue";
|
|
@@ -16,6 +17,7 @@ const platformWorkerImpl = /*#__PURE__*/Worker.PlatformWorker.of({
|
|
|
16
17
|
}
|
|
17
18
|
yield* _(Effect.addFinalizer(() => Effect.sync(() => port.postMessage([1]))));
|
|
18
19
|
const queue = yield* _(Queue.unbounded());
|
|
20
|
+
const latch = yield* Deferred.make();
|
|
19
21
|
const fiber = yield* _(Effect.async(resume => {
|
|
20
22
|
function onMessage(event) {
|
|
21
23
|
queue.unsafeOffer(event.data);
|
|
@@ -28,12 +30,13 @@ const platformWorkerImpl = /*#__PURE__*/Worker.PlatformWorker.of({
|
|
|
28
30
|
}
|
|
29
31
|
port.addEventListener("message", onMessage);
|
|
30
32
|
port.addEventListener("error", onError);
|
|
33
|
+
Deferred.unsafeDone(latch, Effect.void);
|
|
31
34
|
return Effect.sync(() => {
|
|
32
35
|
port.removeEventListener("message", onMessage);
|
|
33
36
|
port.removeEventListener("error", onError);
|
|
34
37
|
});
|
|
35
38
|
}), Effect.interruptible, Effect.forkScoped);
|
|
36
|
-
yield*
|
|
39
|
+
yield* Deferred.await(latch);
|
|
37
40
|
if ("start" in port) {
|
|
38
41
|
port.start();
|
|
39
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","names":["Worker","WorkerError","Effect","Layer","Queue","platformWorkerImpl","PlatformWorker","of","PlatformWorkerTypeId","spawn","worker_","gen","_","worker","port","addFinalizer","sync","postMessage","queue","unbounded","fiber","async","resume","onMessage","event","unsafeOffer","data","onError","reason","error","message","addEventListener","removeEventListener","interruptible","forkScoped","
|
|
1
|
+
{"version":3,"file":"worker.js","names":["Worker","WorkerError","Deferred","Effect","Layer","Queue","platformWorkerImpl","PlatformWorker","of","PlatformWorkerTypeId","spawn","worker_","gen","_","worker","port","addFinalizer","sync","postMessage","queue","unbounded","latch","make","fiber","async","resume","onMessage","event","unsafeOffer","data","onError","reason","error","message","addEventListener","unsafeDone","void","removeEventListener","interruptible","forkScoped","await","start","send","transfers","try","catch","layerWorker","succeed","layerManager","provide","layer","merge","layerSpawner"],"sources":["../../../src/internal/worker.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAO,KAAKA,MAAM,MAAM,yBAAyB;AACjD,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,OAAO,KAAKC,QAAQ,MAAM,iBAAiB;AAC3C,OAAO,KAAKC,MAAM,MAAM,eAAe;AACvC,OAAO,KAAKC,KAAK,MAAM,cAAc;AACrC,OAAO,KAAKC,KAAK,MAAM,cAAc;AAErC,MAAMC,kBAAkB,gBAAGN,MAAM,CAACO,cAAc,CAACC,EAAE,CAAC;EAClD,CAACR,MAAM,CAACS,oBAAoB,GAAGT,MAAM,CAACS,oBAAoB;EAC1DC,KAAKA,CAAOC,OAAgB;IAC1B,OAAOR,MAAM,CAACS,GAAG,CAAC,WAAUC,CAAC;MAC3B,MAAMC,MAAM,GAAGH,OAAoE;MACnF,IAAII,IAAqC;MACzC,IAAI,MAAM,IAAID,MAAM,EAAE;QACpBC,IAAI,GAAGD,MAAM,CAACC,IAAI;MACpB,CAAC,MAAM;QACLA,IAAI,GAAGD,MAAM;MACf;MAEA,OAAOD,CAAC,CAACV,MAAM,CAACa,YAAY,CAAC,MAAMb,MAAM,CAACc,IAAI,CAAC,MAAMF,IAAI,CAACG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;MAE7E,MAAMC,KAAK,GAAG,OAAON,CAAC,CAACR,KAAK,CAACe,SAAS,EAAmC,CAAC;MAC1E,MAAMC,KAAK,GAAG,OAAOnB,QAAQ,CAACoB,IAAI,EAA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AM;UAAEC;QAAK,CAAE;OAC5D,CAAC;MAEJ,OAAO;QAAET,KAAK;QAAEJ,KAAK;QAAEuB;MAAI,CAAE;IAC/B,CAAC,CAAC;EACJ;CACD,CAAC;AAEF;AACA,OAAO,MAAMI,WAAW,gBAAG1C,KAAK,CAAC2C,OAAO,CAAC/C,MAAM,CAACO,cAAc,EAAED,kBAAkB,CAAC;AAEnF;AACA,OAAO,MAAM0C,YAAY,gBAAG5C,KAAK,CAAC6C,OAAO,CAACjD,MAAM,CAACgD,YAAY,EAAEF,WAAW,CAAC;AAE3E;AACA,OAAO,MAAMI,KAAK,GAAIxC,KAAgF,IACpGN,KAAK,CAAC+C,KAAK,CAACH,YAAY,EAAEhD,MAAM,CAACoD,YAAY,CAAC1C,KAAK,CAAC,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/platform-browser",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Platform specific implementations for the browser",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"multipasta": "^0.2.1"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@effect/platform": "^0.
|
|
17
|
-
"effect": "^3.2.
|
|
16
|
+
"@effect/platform": "^0.55.0",
|
|
17
|
+
"effect": "^3.2.5"
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"provenance": true
|
package/src/internal/worker.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as Worker from "@effect/platform/Worker"
|
|
2
2
|
import { WorkerError } from "@effect/platform/WorkerError"
|
|
3
|
+
import * as Deferred from "effect/Deferred"
|
|
3
4
|
import * as Effect from "effect/Effect"
|
|
4
5
|
import * as Layer from "effect/Layer"
|
|
5
6
|
import * as Queue from "effect/Queue"
|
|
@@ -19,6 +20,7 @@ const platformWorkerImpl = Worker.PlatformWorker.of({
|
|
|
19
20
|
yield* _(Effect.addFinalizer(() => Effect.sync(() => port.postMessage([1]))))
|
|
20
21
|
|
|
21
22
|
const queue = yield* _(Queue.unbounded<Worker.BackingWorker.Message<O>>())
|
|
23
|
+
const latch = yield* Deferred.make<void>()
|
|
22
24
|
|
|
23
25
|
const fiber = yield* _(
|
|
24
26
|
Effect.async<never, WorkerError, never>((resume) => {
|
|
@@ -30,6 +32,7 @@ const platformWorkerImpl = Worker.PlatformWorker.of({
|
|
|
30
32
|
}
|
|
31
33
|
port.addEventListener("message", onMessage as any)
|
|
32
34
|
port.addEventListener("error", onError as any)
|
|
35
|
+
Deferred.unsafeDone(latch, Effect.void)
|
|
33
36
|
return Effect.sync(() => {
|
|
34
37
|
port.removeEventListener("message", onMessage as any)
|
|
35
38
|
port.removeEventListener("error", onError as any)
|
|
@@ -38,7 +41,7 @@ const platformWorkerImpl = Worker.PlatformWorker.of({
|
|
|
38
41
|
Effect.interruptible,
|
|
39
42
|
Effect.forkScoped
|
|
40
43
|
)
|
|
41
|
-
yield*
|
|
44
|
+
yield* Deferred.await(latch)
|
|
42
45
|
|
|
43
46
|
if ("start" in port) {
|
|
44
47
|
port.start()
|