@dxos/client-services 0.8.4-main.bc674ce → 0.8.4-main.c351d160a8
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/lib/browser/{chunk-J33W6T4Q.mjs → chunk-SVH323CC.mjs} +688 -124
- package/dist/lib/browser/chunk-SVH323CC.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +23 -15
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/testing/index.mjs +1 -1
- package/dist/lib/node-esm/{chunk-34HKLADW.mjs → chunk-XCY7TTXS.mjs} +688 -124
- package/dist/lib/node-esm/chunk-XCY7TTXS.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +23 -15
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/testing/index.mjs +1 -1
- package/dist/types/src/packlets/logging/logging-service.d.ts +4 -0
- package/dist/types/src/packlets/logging/logging-service.d.ts.map +1 -1
- package/dist/types/src/packlets/services/feed-syncer.d.ts +59 -0
- package/dist/types/src/packlets/services/feed-syncer.d.ts.map +1 -0
- package/dist/types/src/packlets/services/feed-syncer.test.d.ts +2 -0
- package/dist/types/src/packlets/services/feed-syncer.test.d.ts.map +1 -0
- package/dist/types/src/packlets/services/platform.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-context.d.ts +1 -2
- package/dist/types/src/packlets/services/service-context.d.ts.map +1 -1
- package/dist/types/src/packlets/services/service-host.d.ts.map +1 -1
- package/dist/types/src/packlets/spaces/data-space.d.ts.map +1 -1
- package/dist/types/src/packlets/worker/worker-runtime.d.ts +11 -3
- package/dist/types/src/packlets/worker/worker-runtime.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +1 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +43 -43
- package/src/packlets/logging/logging-service.ts +4 -0
- package/src/packlets/services/feed-syncer.test.ts +340 -0
- package/src/packlets/services/feed-syncer.ts +330 -0
- package/src/packlets/services/platform.ts +7 -1
- package/src/packlets/services/service-context.ts +84 -11
- package/src/packlets/services/service-host.ts +5 -3
- package/src/packlets/spaces/data-space.ts +3 -0
- package/src/packlets/worker/worker-runtime.ts +13 -5
- package/src/packlets/worker/worker-session.ts +4 -4
- package/src/version.ts +1 -1
- package/dist/lib/browser/chunk-J33W6T4Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-34HKLADW.mjs.map +0 -7
|
@@ -37,6 +37,7 @@ export type CreateSessionProps = {
|
|
|
37
37
|
appPort: RpcPort;
|
|
38
38
|
systemPort: RpcPort;
|
|
39
39
|
shellPort?: RpcPort;
|
|
40
|
+
onClose?: () => Promise<void>;
|
|
40
41
|
};
|
|
41
42
|
|
|
42
43
|
export type WorkerRuntimeOptions = {
|
|
@@ -50,7 +51,11 @@ export type WorkerRuntimeOptions = {
|
|
|
50
51
|
*/
|
|
51
52
|
automaticallyConnectWebrtc?: boolean;
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
/**
|
|
55
|
+
* Optional SQLite layer for Effect. Defaults to LocalSqliteOpfsLayer.
|
|
56
|
+
* For testing in Node.js, use `sqliteLayerMemory` from `@dxos/sql-sqlite/platform`.
|
|
57
|
+
*/
|
|
58
|
+
sqliteLayer?: Layer.Layer<SqlClient.SqlClient | SqlExport.SqlExport, unknown>;
|
|
54
59
|
};
|
|
55
60
|
|
|
56
61
|
/**
|
|
@@ -87,16 +92,19 @@ export class WorkerRuntime {
|
|
|
87
92
|
releaseLock,
|
|
88
93
|
onStop,
|
|
89
94
|
automaticallyConnectWebrtc = true,
|
|
90
|
-
|
|
95
|
+
sqliteLayer,
|
|
91
96
|
}: WorkerRuntimeOptions) {
|
|
92
97
|
this._configProvider = configProvider;
|
|
93
98
|
this._acquireLock = acquireLock;
|
|
94
99
|
this._releaseLock = releaseLock;
|
|
95
100
|
this._onStop = onStop;
|
|
96
101
|
this._channel = channel;
|
|
102
|
+
if (sqliteLayer) {
|
|
103
|
+
log.warn('Using testing SQLite layer');
|
|
104
|
+
}
|
|
97
105
|
this._runtime = ManagedRuntime.make(
|
|
98
106
|
SqlTransaction.layer
|
|
99
|
-
.pipe(Layer.provideMerge(LocalSqliteOpfsLayer), Layer.provideMerge(Reactivity.layer))
|
|
107
|
+
.pipe(Layer.provideMerge(sqliteLayer ?? LocalSqliteOpfsLayer), Layer.provideMerge(Reactivity.layer))
|
|
100
108
|
.pipe(Layer.orDie),
|
|
101
109
|
);
|
|
102
110
|
this._clientServices = new ClientServicesHost({
|
|
@@ -105,7 +113,6 @@ export class WorkerRuntime {
|
|
|
105
113
|
},
|
|
106
114
|
runtime: this._runtime.runtimeEffect,
|
|
107
115
|
runtimeProps: {
|
|
108
|
-
enableSqlite,
|
|
109
116
|
// Auto-activate spaces that were previously active after leader changeover.
|
|
110
117
|
autoActivateSpaces: true,
|
|
111
118
|
},
|
|
@@ -178,7 +185,7 @@ export class WorkerRuntime {
|
|
|
178
185
|
/**
|
|
179
186
|
* Create a new session.
|
|
180
187
|
*/
|
|
181
|
-
async createSession({ appPort, systemPort, shellPort }: CreateSessionProps): Promise<WorkerSession> {
|
|
188
|
+
async createSession({ appPort, systemPort, shellPort, onClose }: CreateSessionProps): Promise<WorkerSession> {
|
|
182
189
|
const session = new WorkerSession({
|
|
183
190
|
serviceHost: this._clientServices,
|
|
184
191
|
appPort,
|
|
@@ -198,6 +205,7 @@ export class WorkerRuntime {
|
|
|
198
205
|
this._reconnectWebrtc();
|
|
199
206
|
}
|
|
200
207
|
}
|
|
208
|
+
await onClose?.();
|
|
201
209
|
});
|
|
202
210
|
|
|
203
211
|
await session.open();
|
|
@@ -119,7 +119,7 @@ export class WorkerSession {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
async open(): Promise<void> {
|
|
122
|
-
log
|
|
122
|
+
log('opening...');
|
|
123
123
|
await Promise.all([this._clientRpc.open(), this._iframeRpc.open(), this._maybeOpenShell()]);
|
|
124
124
|
|
|
125
125
|
// Wait until the worker's RPC service has started.
|
|
@@ -130,11 +130,11 @@ export class WorkerSession {
|
|
|
130
130
|
void this._afterLockReleases(this.lockKey, () => this.close());
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
log
|
|
133
|
+
log('opened');
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
async close(): Promise<void> {
|
|
137
|
-
log.
|
|
137
|
+
log.debug('closing...');
|
|
138
138
|
try {
|
|
139
139
|
await this.onClose.callIfSet();
|
|
140
140
|
} catch (err: any) {
|
|
@@ -142,7 +142,7 @@ export class WorkerSession {
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
await Promise.all([this._clientRpc.close(), this._iframeRpc.close()]);
|
|
145
|
-
log.
|
|
145
|
+
log.debug('closed');
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
private async _maybeOpenShell(): Promise<void> {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const DXOS_VERSION = "0.8.4-main.
|
|
1
|
+
export const DXOS_VERSION = "0.8.4-main.c351d160a8";
|