@livestore/devtools-web-common 0.3.0-dev.4 → 0.3.0-dev.41
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/.tsbuildinfo +1 -1
- package/dist/web-channel/index.d.ts +44 -19
- package/dist/web-channel/index.d.ts.map +1 -1
- package/dist/web-channel/index.js +50 -20
- package/dist/web-channel/index.js.map +1 -1
- package/dist/worker/mod.d.ts.map +1 -1
- package/dist/worker/mod.js +7 -5
- package/dist/worker/mod.js.map +1 -1
- package/package.json +10 -8
- package/src/web-channel/index.ts +72 -61
- package/src/worker/mod.ts +8 -5
- package/dist/devtools-bridge/index.d.ts +0 -12
- package/dist/devtools-bridge/index.d.ts.map +0 -1
- package/dist/devtools-bridge/index.js +0 -65
- package/dist/devtools-bridge/index.js.map +0 -1
- package/src/devtools-bridge/index.ts +0 -124
- package/tsconfig.json +0 -10
|
@@ -1,25 +1,50 @@
|
|
|
1
|
-
import { UnexpectedError } from '@livestore/common';
|
|
1
|
+
import { Devtools, UnexpectedError } from '@livestore/common';
|
|
2
2
|
import type { Scope, Worker } from '@livestore/utils/effect';
|
|
3
|
-
import { Effect, WebChannel } from '@livestore/utils/effect';
|
|
3
|
+
import { Effect, Schema, WebChannel } from '@livestore/utils/effect';
|
|
4
4
|
import type { MeshNode } from '@livestore/webmesh';
|
|
5
5
|
import * as WorkerSchema from '../worker/schema.js';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export declare const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
export * as WorkerSchema from '../worker/schema.js';
|
|
7
|
+
declare global {
|
|
8
|
+
var __debugWebmeshNode: any;
|
|
9
|
+
}
|
|
10
|
+
export declare const makeSessionInfoBroadcastChannel: Effect.Effect<WebChannel.WebChannel<Devtools.SessionInfo.Message, Devtools.SessionInfo.Message>, UnexpectedError, Scope.Scope>;
|
|
11
|
+
export declare const makeNodeName: {
|
|
12
|
+
sharedWorker: ({ storeId }: {
|
|
13
|
+
storeId: string;
|
|
14
|
+
}) => string;
|
|
15
|
+
browserExtension: {
|
|
16
|
+
contentscriptMain: (tabId: number) => string;
|
|
17
|
+
contentscriptIframe: (tabId: number) => string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const ClientSessionContentscriptMainReq: Schema.TaggedStruct<"ClientSessionContentscriptMainReq", {
|
|
21
|
+
storeId: typeof Schema.String;
|
|
22
|
+
clientId: typeof Schema.String;
|
|
23
|
+
sessionId: typeof Schema.String;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const ClientSessionContentscriptMainRes: Schema.TaggedStruct<"ClientSessionContentscriptMainRes", {
|
|
26
|
+
tabId: typeof Schema.Number;
|
|
27
|
+
}>;
|
|
28
|
+
export declare const makeStaticClientSessionChannel: {
|
|
29
|
+
contentscriptMain: Effect.Effect<WebChannel.WebChannel<{
|
|
30
|
+
readonly _tag: "ClientSessionContentscriptMainReq";
|
|
31
|
+
readonly storeId: string;
|
|
32
|
+
readonly clientId: string;
|
|
33
|
+
readonly sessionId: string;
|
|
34
|
+
}, {
|
|
35
|
+
readonly _tag: "ClientSessionContentscriptMainRes";
|
|
36
|
+
readonly tabId: number;
|
|
37
|
+
}, never>, never, Scope.Scope>;
|
|
38
|
+
clientSession: Effect.Effect<WebChannel.WebChannel<{
|
|
39
|
+
readonly _tag: "ClientSessionContentscriptMainRes";
|
|
40
|
+
readonly tabId: number;
|
|
41
|
+
}, {
|
|
42
|
+
readonly _tag: "ClientSessionContentscriptMainReq";
|
|
43
|
+
readonly storeId: string;
|
|
44
|
+
readonly clientId: string;
|
|
45
|
+
readonly sessionId: string;
|
|
46
|
+
}, never>, never, Scope.Scope>;
|
|
47
|
+
};
|
|
23
48
|
export declare const connectViaWorker: ({ node, target, worker, }: {
|
|
24
49
|
node: MeshNode;
|
|
25
50
|
target: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web-channel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/web-channel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAE7D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAY,MAAM,EAAE,MAAM,EAAU,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACtF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGlD,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAA;AAEnD,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAA;AAEnD,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,kBAAkB,EAAE,GAAG,CAAA;CAC5B;AAED,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAAC,MAAM,CACzD,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,EACjF,eAAe,EACf,KAAK,CAAC,KAAK,CAIX,CAAA;AAEF,eAAO,MAAM,YAAY;gCACK;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;;mCAIlB,MAAM;qCACJ,MAAM;;CAEtC,CAAA;AAED,eAAO,MAAM,iCAAiC;;;;EAI5C,CAAA;AAEF,eAAO,MAAM,iCAAiC;;EAE5C,CAAA;AAGF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;CAqB1C,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,2BAI9B;IACD,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAC,oBAAoB,CAAC,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;CACtE,sDA+B8C,CAAA"}
|
|
@@ -1,34 +1,64 @@
|
|
|
1
|
-
import { UnexpectedError } from '@livestore/common';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { Devtools, UnexpectedError } from '@livestore/common';
|
|
2
|
+
import { LS_DEV } from '@livestore/utils';
|
|
3
|
+
import { Deferred, Effect, Schema, Stream, WebChannel } from '@livestore/utils/effect';
|
|
4
|
+
import { WebmeshSchema } from '@livestore/webmesh';
|
|
4
5
|
import * as WorkerSchema from '../worker/schema.js';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export * as WorkerSchema from '../worker/schema.js';
|
|
7
|
+
export const makeSessionInfoBroadcastChannel = WebChannel.broadcastChannel({
|
|
8
|
+
channelName: 'session-info',
|
|
9
|
+
schema: Devtools.SessionInfo.Message,
|
|
9
10
|
});
|
|
10
|
-
export const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
export const makeNodeName = {
|
|
12
|
+
sharedWorker: ({ storeId }) => `shared-worker-${storeId}`,
|
|
13
|
+
// TODO refactor shared-worker setup so there's only a single shared-worker per origin
|
|
14
|
+
// sharedWorker: () => `shared-worker`,
|
|
15
|
+
browserExtension: {
|
|
16
|
+
contentscriptMain: (tabId) => `contentscript-main-${tabId}`,
|
|
17
|
+
contentscriptIframe: (tabId) => `contentscript-iframe-${tabId}`,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const ClientSessionContentscriptMainReq = Schema.TaggedStruct('ClientSessionContentscriptMainReq', {
|
|
21
|
+
storeId: Schema.String,
|
|
22
|
+
clientId: Schema.String,
|
|
23
|
+
sessionId: Schema.String,
|
|
15
24
|
});
|
|
16
|
-
export const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
export const ClientSessionContentscriptMainRes = Schema.TaggedStruct('ClientSessionContentscriptMainRes', {
|
|
26
|
+
tabId: Schema.Number,
|
|
27
|
+
});
|
|
28
|
+
// Effect.suspend is needed since `window` is not available in the shared worker
|
|
29
|
+
export const makeStaticClientSessionChannel = {
|
|
30
|
+
contentscriptMain: Effect.suspend(() => WebChannel.windowChannel({
|
|
31
|
+
// eslint-disable-next-line unicorn/prefer-global-this
|
|
32
|
+
listenWindow: window,
|
|
33
|
+
// eslint-disable-next-line unicorn/prefer-global-this
|
|
34
|
+
sendWindow: window,
|
|
35
|
+
schema: { listen: ClientSessionContentscriptMainReq, send: ClientSessionContentscriptMainRes },
|
|
36
|
+
ids: { own: 'contentscript-main-static', other: 'client-session-static' },
|
|
37
|
+
})),
|
|
38
|
+
clientSession: Effect.suspend(() => WebChannel.windowChannel({
|
|
39
|
+
// eslint-disable-next-line unicorn/prefer-global-this
|
|
40
|
+
listenWindow: window,
|
|
41
|
+
// eslint-disable-next-line unicorn/prefer-global-this
|
|
42
|
+
sendWindow: window,
|
|
43
|
+
schema: { listen: ClientSessionContentscriptMainRes, send: ClientSessionContentscriptMainReq },
|
|
44
|
+
ids: { own: 'client-session-static', other: 'contentscript-main-static' },
|
|
45
|
+
})),
|
|
46
|
+
};
|
|
21
47
|
export const connectViaWorker = ({ node, target, worker, }) => Effect.gen(function* () {
|
|
22
48
|
const mc = new MessageChannel();
|
|
23
49
|
const isConnected = yield* Deferred.make();
|
|
24
|
-
|
|
50
|
+
if (LS_DEV) {
|
|
51
|
+
yield* Effect.addFinalizerLog(`@livestore/devtools-web-common: closing message channel ${node.nodeName} → ${target}`);
|
|
52
|
+
}
|
|
25
53
|
yield* worker.execute(WorkerSchema.CreateConnection.make({ from: node.nodeName, port: mc.port1 })).pipe(Stream.tap(() => Deferred.succeed(isConnected, true)), Stream.runDrain, Effect.tapCauseLogPretty, Effect.forkScoped);
|
|
26
54
|
yield* isConnected;
|
|
27
55
|
const sharedWorkerConnection = yield* WebChannel.messagePortChannel({
|
|
28
56
|
port: mc.port2,
|
|
29
57
|
schema: WebmeshSchema.Packet,
|
|
30
58
|
});
|
|
31
|
-
yield* node.
|
|
32
|
-
|
|
59
|
+
yield* node.addEdge({ target, edgeChannel: sharedWorkerConnection, replaceIfExists: true });
|
|
60
|
+
if (LS_DEV) {
|
|
61
|
+
yield* Effect.logDebug(`@livestore/devtools-web-common: initiated connection: ${node.nodeName} → ${target}`);
|
|
62
|
+
}
|
|
33
63
|
}).pipe(UnexpectedError.mapToUnexpectedError);
|
|
34
64
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web-channel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/web-channel/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAA;AAEnD,OAAO,KAAK,YAAY,MAAM,qBAAqB,CAAA;AAOnD,MAAM,CAAC,MAAM,+BAA+B,GAIxC,UAAU,CAAC,gBAAgB,CAAC;IAC9B,WAAW,EAAE,cAAc;IAC3B,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,OAAO;CACrC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,YAAY,EAA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3F,IAAI,MAAM,EAAE,CAAC;QACX,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,yDAAyD,IAAI,CAAC,QAAQ,MAAM,MAAM,EAAE,CAAC,CAAA;IAC9G,CAAC;AACH,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,CAAA"}
|
package/dist/worker/mod.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/worker/mod.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/worker/mod.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAU,KAAK,EAAE,MAAM,EAAc,MAAM,yBAAyB,CAAA;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAGlD,OAAO,KAAK,KAAK,kBAAkB,MAAM,aAAa,CAAA;AAEtD,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;;UAI3B,QAAQ;;AAFlB,qBAAa,YAAa,SAAQ,iBAG/B;IACD,MAAM,CAAC,KAAK,GAAI,cAAc;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,6CAOb;CACtC;AAED,eAAO,MAAM,gBAAgB,GAAI,gBAAgB,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,2CAsBJ,CAAA"}
|
package/dist/worker/mod.js
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
|
+
import { LS_DEV } from '@livestore/utils';
|
|
1
2
|
import { Context, Effect, Layer, Stream, WebChannel } from '@livestore/utils/effect';
|
|
2
3
|
import { makeMeshNode, WebmeshSchema } from '@livestore/webmesh';
|
|
3
4
|
export * as Schema from './schema.js';
|
|
4
5
|
export class CacheService extends Context.Tag('@livestore/devtools-web-common:CacheService')() {
|
|
5
6
|
static layer = ({ nodeName }) => Effect.gen(function* () {
|
|
6
7
|
const node = yield* makeMeshNode(nodeName);
|
|
7
|
-
|
|
8
|
-
globalThis.__debugWebMeshNode = node;
|
|
8
|
+
globalThis.__debugWebmeshNode = node;
|
|
9
9
|
return { node };
|
|
10
10
|
}).pipe(Layer.scoped(CacheService));
|
|
11
11
|
}
|
|
12
12
|
export const CreateConnection = ({ from, port }) => Stream.asyncScoped((emit) => Effect.gen(function* () {
|
|
13
13
|
const { node } = yield* CacheService;
|
|
14
14
|
const messagePortChannel = yield* WebChannel.messagePortChannel({ port, schema: WebmeshSchema.Packet });
|
|
15
|
-
yield* node.
|
|
16
|
-
|
|
15
|
+
yield* node.addEdge({ target: from, edgeChannel: messagePortChannel, replaceIfExists: true });
|
|
16
|
+
if (LS_DEV) {
|
|
17
|
+
yield* Effect.logDebug(`@livestore/devtools-web-common: accepted edge: ${node.nodeName} ← ${from}`);
|
|
18
|
+
}
|
|
17
19
|
emit.single({});
|
|
18
|
-
yield* Effect.spanEvent({ connectedTo: [...node.
|
|
20
|
+
yield* Effect.spanEvent({ connectedTo: [...node.edgeKeys] });
|
|
19
21
|
// Keep connection alive
|
|
20
22
|
// yield* Effect.never
|
|
21
23
|
// return {}
|
package/dist/worker/mod.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.js","sourceRoot":"","sources":["../../src/worker/mod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpF,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAIhE,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AAErC,MAAM,OAAO,YAAa,SAAQ,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,EAGzF;IACD,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAwB,EAAE,EAAE,CACpD,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClB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AEvG,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAAE,eAAe,EAAE,IAAI,EAAE,CAAC,CAAA;IAE7F,IAAI,MAAM,EAAE,CAAC;QACX,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,kDAAkD,IAAI,CAAC,QAAQ,MAAM,IAAI,EAAE,CAAC,CAAA;IACrG,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAEf,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,WAAW,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;IAE5D,wBAAwB;IACxB,sBAAsB;IAEtB,YAAY;AACd,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CACtB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,2DAA2D,IAAI,EAAE,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@livestore/devtools-web-common",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.41",
|
|
4
4
|
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
5
6
|
"exports": {
|
|
6
7
|
"./web-channel": {
|
|
7
8
|
"types": "./dist/web-channel/index.d.ts",
|
|
@@ -10,18 +11,19 @@
|
|
|
10
11
|
"./worker": {
|
|
11
12
|
"types": "./dist/worker/mod.d.ts",
|
|
12
13
|
"default": "./dist/worker/mod.js"
|
|
13
|
-
},
|
|
14
|
-
"./devtools-bridge": {
|
|
15
|
-
"types": "./dist/devtools-bridge/index.d.ts",
|
|
16
|
-
"default": "./dist/devtools-bridge/index.js"
|
|
17
14
|
}
|
|
18
15
|
},
|
|
19
16
|
"dependencies": {
|
|
20
|
-
"@livestore/common": "0.3.0-dev.
|
|
21
|
-
"@livestore/
|
|
22
|
-
"@livestore/
|
|
17
|
+
"@livestore/common": "0.3.0-dev.41",
|
|
18
|
+
"@livestore/webmesh": "0.3.0-dev.41",
|
|
19
|
+
"@livestore/utils": "0.3.0-dev.41"
|
|
23
20
|
},
|
|
24
21
|
"devDependencies": {},
|
|
22
|
+
"files": [
|
|
23
|
+
"package.json",
|
|
24
|
+
"src",
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
25
27
|
"publishConfig": {
|
|
26
28
|
"access": "public"
|
|
27
29
|
},
|
package/src/web-channel/index.ts
CHANGED
|
@@ -1,64 +1,71 @@
|
|
|
1
|
-
import { UnexpectedError } from '@livestore/common'
|
|
1
|
+
import { Devtools, UnexpectedError } from '@livestore/common'
|
|
2
|
+
import { LS_DEV } from '@livestore/utils'
|
|
2
3
|
import type { Scope, Worker } from '@livestore/utils/effect'
|
|
3
|
-
import { Deferred, Effect, Stream, WebChannel } from '@livestore/utils/effect'
|
|
4
|
+
import { Deferred, Effect, Schema, Stream, WebChannel } from '@livestore/utils/effect'
|
|
4
5
|
import type { MeshNode } from '@livestore/webmesh'
|
|
5
|
-
import {
|
|
6
|
+
import { WebmeshSchema } from '@livestore/webmesh'
|
|
6
7
|
|
|
7
8
|
import * as WorkerSchema from '../worker/schema.js'
|
|
8
9
|
|
|
9
|
-
export
|
|
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
|
-
|
|
10
|
+
export * as WorkerSchema from '../worker/schema.js'
|
|
11
|
+
|
|
12
|
+
declare global {
|
|
13
|
+
// eslint-disable-next-line no-var
|
|
14
|
+
var __debugWebmeshNode: any
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const makeSessionInfoBroadcastChannel: Effect.Effect<
|
|
18
|
+
WebChannel.WebChannel<Devtools.SessionInfo.Message, Devtools.SessionInfo.Message>,
|
|
19
|
+
UnexpectedError,
|
|
20
|
+
Scope.Scope
|
|
21
|
+
> = WebChannel.broadcastChannel({
|
|
22
|
+
channelName: 'session-info',
|
|
23
|
+
schema: Devtools.SessionInfo.Message,
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
export const makeNodeName = {
|
|
27
|
+
sharedWorker: ({ storeId }: { storeId: string }) => `shared-worker-${storeId}`,
|
|
28
|
+
// TODO refactor shared-worker setup so there's only a single shared-worker per origin
|
|
29
|
+
// sharedWorker: () => `shared-worker`,
|
|
30
|
+
browserExtension: {
|
|
31
|
+
contentscriptMain: (tabId: number) => `contentscript-main-${tabId}`,
|
|
32
|
+
contentscriptIframe: (tabId: number) => `contentscript-iframe-${tabId}`,
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export const ClientSessionContentscriptMainReq = Schema.TaggedStruct('ClientSessionContentscriptMainReq', {
|
|
37
|
+
storeId: Schema.String,
|
|
38
|
+
clientId: Schema.String,
|
|
39
|
+
sessionId: Schema.String,
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
export const ClientSessionContentscriptMainRes = Schema.TaggedStruct('ClientSessionContentscriptMainRes', {
|
|
43
|
+
tabId: Schema.Number,
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
// Effect.suspend is needed since `window` is not available in the shared worker
|
|
47
|
+
export const makeStaticClientSessionChannel = {
|
|
48
|
+
contentscriptMain: Effect.suspend(() =>
|
|
49
|
+
WebChannel.windowChannel({
|
|
50
|
+
// eslint-disable-next-line unicorn/prefer-global-this
|
|
51
|
+
listenWindow: window,
|
|
52
|
+
// eslint-disable-next-line unicorn/prefer-global-this
|
|
53
|
+
sendWindow: window,
|
|
54
|
+
schema: { listen: ClientSessionContentscriptMainReq, send: ClientSessionContentscriptMainRes },
|
|
55
|
+
ids: { own: 'contentscript-main-static', other: 'client-session-static' },
|
|
56
|
+
}),
|
|
57
|
+
),
|
|
58
|
+
clientSession: Effect.suspend(() =>
|
|
59
|
+
WebChannel.windowChannel({
|
|
60
|
+
// eslint-disable-next-line unicorn/prefer-global-this
|
|
61
|
+
listenWindow: window,
|
|
62
|
+
// eslint-disable-next-line unicorn/prefer-global-this
|
|
63
|
+
sendWindow: window,
|
|
64
|
+
schema: { listen: ClientSessionContentscriptMainRes, send: ClientSessionContentscriptMainReq },
|
|
65
|
+
ids: { own: 'client-session-static', other: 'contentscript-main-static' },
|
|
66
|
+
}),
|
|
67
|
+
),
|
|
68
|
+
}
|
|
62
69
|
|
|
63
70
|
export const connectViaWorker = ({
|
|
64
71
|
node,
|
|
@@ -74,9 +81,11 @@ export const connectViaWorker = ({
|
|
|
74
81
|
|
|
75
82
|
const isConnected = yield* Deferred.make<boolean, never>()
|
|
76
83
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
if (LS_DEV) {
|
|
85
|
+
yield* Effect.addFinalizerLog(
|
|
86
|
+
`@livestore/devtools-web-common: closing message channel ${node.nodeName} → ${target}`,
|
|
87
|
+
)
|
|
88
|
+
}
|
|
80
89
|
|
|
81
90
|
yield* worker.execute(WorkerSchema.CreateConnection.make({ from: node.nodeName, port: mc.port1 })).pipe(
|
|
82
91
|
Stream.tap(() => Deferred.succeed(isConnected, true)),
|
|
@@ -92,7 +101,9 @@ export const connectViaWorker = ({
|
|
|
92
101
|
schema: WebmeshSchema.Packet,
|
|
93
102
|
})
|
|
94
103
|
|
|
95
|
-
yield* node.
|
|
104
|
+
yield* node.addEdge({ target, edgeChannel: sharedWorkerConnection, replaceIfExists: true })
|
|
96
105
|
|
|
97
|
-
|
|
106
|
+
if (LS_DEV) {
|
|
107
|
+
yield* Effect.logDebug(`@livestore/devtools-web-common: initiated connection: ${node.nodeName} → ${target}`)
|
|
108
|
+
}
|
|
98
109
|
}).pipe(UnexpectedError.mapToUnexpectedError)
|
package/src/worker/mod.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LS_DEV } from '@livestore/utils'
|
|
1
2
|
import { Context, Effect, Layer, Stream, WebChannel } from '@livestore/utils/effect'
|
|
2
3
|
import type { MeshNode } from '@livestore/webmesh'
|
|
3
4
|
import { makeMeshNode, WebmeshSchema } from '@livestore/webmesh'
|
|
@@ -14,8 +15,7 @@ export class CacheService extends Context.Tag('@livestore/devtools-web-common:Ca
|
|
|
14
15
|
Effect.gen(function* () {
|
|
15
16
|
const node = yield* makeMeshNode(nodeName)
|
|
16
17
|
|
|
17
|
-
|
|
18
|
-
globalThis.__debugWebMeshNode = node
|
|
18
|
+
globalThis.__debugWebmeshNode = node
|
|
19
19
|
|
|
20
20
|
return { node }
|
|
21
21
|
}).pipe(Layer.scoped(CacheService))
|
|
@@ -28,12 +28,15 @@ export const CreateConnection = ({ from, port }: typeof SharedWorkerSchema.Creat
|
|
|
28
28
|
|
|
29
29
|
const messagePortChannel = yield* WebChannel.messagePortChannel({ port, schema: WebmeshSchema.Packet })
|
|
30
30
|
|
|
31
|
-
yield* node.
|
|
32
|
-
|
|
31
|
+
yield* node.addEdge({ target: from, edgeChannel: messagePortChannel, replaceIfExists: true })
|
|
32
|
+
|
|
33
|
+
if (LS_DEV) {
|
|
34
|
+
yield* Effect.logDebug(`@livestore/devtools-web-common: accepted edge: ${node.nodeName} ← ${from}`)
|
|
35
|
+
}
|
|
33
36
|
|
|
34
37
|
emit.single({})
|
|
35
38
|
|
|
36
|
-
yield* Effect.spanEvent({ connectedTo: [...node.
|
|
39
|
+
yield* Effect.spanEvent({ connectedTo: [...node.edgeKeys] })
|
|
37
40
|
|
|
38
41
|
// Keep connection alive
|
|
39
42
|
// yield* Effect.never
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Devtools } from '@livestore/common';
|
|
2
|
-
import type { Scope, Worker } from '@livestore/utils/effect';
|
|
3
|
-
import { Effect } from '@livestore/utils/effect';
|
|
4
|
-
import type * as WorkerSchema from '../worker/schema.js';
|
|
5
|
-
export declare const prepareWebDevtoolsBridge: ({ worker, workerTargetName, storeId, appHostId, }: {
|
|
6
|
-
worker: Worker.SerializedWorkerPool<typeof WorkerSchema.Request.Type>;
|
|
7
|
-
/** Usually `shared-worker` */
|
|
8
|
-
workerTargetName: string;
|
|
9
|
-
storeId: string;
|
|
10
|
-
appHostId: string;
|
|
11
|
-
}) => Effect.Effect<Devtools.PrepareDevtoolsBridge, never, Scope.Scope>;
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/devtools-bridge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,mBAAmB,CAAA;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAY,MAAM,EAA0B,MAAM,yBAAyB,CAAA;AAGlF,OAAO,KAAK,KAAK,YAAY,MAAM,qBAAqB,CAAA;AAIxD,eAAO,MAAM,wBAAwB,sDAKlC;IACD,MAAM,EAAE,MAAM,CAAC,oBAAoB,CAAC,OAAO,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IACrE,8BAA8B;IAC9B,gBAAgB,EAAE,MAAM,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;CAClB,KAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAuG7C,CAAA"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { Devtools, liveStoreVersion } from '@livestore/common';
|
|
2
|
-
import { Deferred, Effect, PubSub, Schema, Stream } from '@livestore/utils/effect';
|
|
3
|
-
import { makeChannelForConnectedMeshNode, makeWebDevtoolsConnectedMeshNode } from '../web-channel/index.js';
|
|
4
|
-
// TODO use a unique bridgeId for each connection (similar to web bridge)
|
|
5
|
-
// TODO refactor the bridge creation code to be re-used for both web and node and possibly expo
|
|
6
|
-
export const prepareWebDevtoolsBridge = ({ worker, workerTargetName, storeId, appHostId, }) => Effect.gen(function* () {
|
|
7
|
-
const meshNode = yield* makeWebDevtoolsConnectedMeshNode({
|
|
8
|
-
nodeName: `devtools`,
|
|
9
|
-
target: workerTargetName,
|
|
10
|
-
worker,
|
|
11
|
-
});
|
|
12
|
-
// @ts-expect-error typing
|
|
13
|
-
globalThis.__debugWebMeshNode = meshNode;
|
|
14
|
-
// const appHostId = `${storeId}-${sessionId}`
|
|
15
|
-
const isLeader = true; // For now we only support a single node instance, which always is the leader
|
|
16
|
-
// TODO maybe we need a temporary channel to create a unique bridge channel e..g see appHostInfoDeferred below
|
|
17
|
-
const webDevtoolsChannelStore = yield* makeChannelForConnectedMeshNode({
|
|
18
|
-
node: meshNode,
|
|
19
|
-
target: `app-store-${storeId}-${appHostId}`,
|
|
20
|
-
schema: { listen: Devtools.MessageFromAppClientSession, send: Devtools.MessageToAppClientSession },
|
|
21
|
-
});
|
|
22
|
-
const webDevtoolsChannelCoordinator = yield* makeChannelForConnectedMeshNode({
|
|
23
|
-
node: meshNode,
|
|
24
|
-
target: 'leader-worker',
|
|
25
|
-
schema: { listen: Devtools.MessageFromAppLeader, send: Devtools.MessageToAppLeader },
|
|
26
|
-
});
|
|
27
|
-
const responsePubSub = yield* PubSub.unbounded().pipe(Effect.acquireRelease(PubSub.shutdown));
|
|
28
|
-
// const appHostInfoDeferred = yield* Deferred.make<{ appHostId: string; isLeader: boolean }>()
|
|
29
|
-
yield* webDevtoolsChannelCoordinator.listen.pipe(Stream.flatten(),
|
|
30
|
-
// Stream.tapLogWithLabel('fromCoordinator.listen'),
|
|
31
|
-
Stream.tap((msg) => Effect.gen(function* () {
|
|
32
|
-
yield* PubSub.publish(responsePubSub, msg);
|
|
33
|
-
})), Stream.runDrain, Effect.withSpan('portForDevtoolsChannelCoordinator.listen'), Effect.tapCauseLogPretty, Effect.forkScoped);
|
|
34
|
-
yield* webDevtoolsChannelStore.listen.pipe(Stream.flatten(),
|
|
35
|
-
// Stream.tapLogWithLabel('fromStore.listen'),
|
|
36
|
-
Stream.tap((msg) => Effect.gen(function* () {
|
|
37
|
-
yield* PubSub.publish(responsePubSub, msg);
|
|
38
|
-
})), Stream.runDrain, Effect.withSpan('portForDevtoolsChannelStore.listen'), Effect.tapCauseLogPretty, Effect.forkScoped);
|
|
39
|
-
// yield* webDevtoolsChannelCoordinator.send(Devtools.DevtoolsReady.make({ liveStoreVersion }))
|
|
40
|
-
// const { appHostId, isLeader } = yield* Deferred.await(appHostInfoDeferred)
|
|
41
|
-
// TODO improve disconnect handling
|
|
42
|
-
yield* Deferred.await(webDevtoolsChannelCoordinator.closedDeferred).pipe(Effect.tap(() => PubSub.publish(responsePubSub, Devtools.Disconnect.make({ liveStoreVersion, appHostId }))), Effect.tapCauseLogPretty, Effect.forkScoped);
|
|
43
|
-
// TODO improve disconnect handling
|
|
44
|
-
yield* Deferred.await(webDevtoolsChannelStore.closedDeferred).pipe(Effect.tap(() => PubSub.publish(responsePubSub, Devtools.Disconnect.make({ liveStoreVersion, appHostId }))), Effect.tapCauseLogPretty, Effect.forkScoped);
|
|
45
|
-
const sendToAppHost = (msg) => Effect.gen(function* () {
|
|
46
|
-
// NOTE it's possible that a message is for both the coordinator and the store (e.g. Disconnect)
|
|
47
|
-
if (Schema.is(Devtools.MessageToAppLeader)(msg)) {
|
|
48
|
-
yield* webDevtoolsChannelCoordinator.send(msg);
|
|
49
|
-
}
|
|
50
|
-
if (Schema.is(Devtools.MessageToAppClientSession)(msg)) {
|
|
51
|
-
yield* webDevtoolsChannelStore.send(msg);
|
|
52
|
-
}
|
|
53
|
-
}).pipe(Effect.withSpan('sendToAppHost'), Effect.orDie);
|
|
54
|
-
const copyToClipboard = (text) => Effect.sync(() => {
|
|
55
|
-
navigator.clipboard.writeText(text);
|
|
56
|
-
});
|
|
57
|
-
return {
|
|
58
|
-
responsePubSub,
|
|
59
|
-
sendToAppHost,
|
|
60
|
-
appHostId,
|
|
61
|
-
copyToClipboard,
|
|
62
|
-
isLeader,
|
|
63
|
-
};
|
|
64
|
-
}).pipe(Effect.orDie);
|
|
65
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/devtools-bridge/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAElF,OAAO,EAAE,+BAA+B,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAA;AAG3G,yEAAyE;AACzE,+FAA+F;AAC/F,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EACvC,MAAM,EACN,gBAAgB,EAChB,OAAO,EACP,SAAS,GAOV,EAAqE,EAAE,CACtE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,gCAAgC,CAAC;QACvD,QAAQ,EAAE,UAAU;QACp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