swarpc 0.6.0 → 0.7.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.
Files changed (46) hide show
  1. package/README.md +44 -0
  2. package/dist/src/client.d.ts +22 -0
  3. package/dist/src/client.d.ts.map +1 -0
  4. package/dist/src/client.js +159 -0
  5. package/dist/src/index.d.ts +4 -0
  6. package/dist/src/index.d.ts.map +1 -0
  7. package/dist/src/index.js +2 -0
  8. package/dist/src/log.d.ts +20 -0
  9. package/dist/src/log.d.ts.map +1 -0
  10. package/dist/src/log.js +45 -0
  11. package/dist/src/server.d.ts +15 -0
  12. package/dist/src/server.d.ts.map +1 -0
  13. package/dist/src/server.js +132 -0
  14. package/dist/src/types.d.ts +260 -0
  15. package/dist/src/types.d.ts.map +1 -0
  16. package/dist/src/types.js +28 -0
  17. package/dist/src/utils.d.ts.map +1 -0
  18. package/dist/{utils.js → src/utils.js} +0 -6
  19. package/dist/tests/core.procedures.d.ts +45 -0
  20. package/dist/tests/core.procedures.d.ts.map +1 -0
  21. package/dist/tests/core.procedures.js +49 -0
  22. package/dist/tests/core.test.d.ts +2 -0
  23. package/dist/tests/core.test.d.ts.map +1 -0
  24. package/dist/tests/core.test.js +100 -0
  25. package/dist/tests/core.worker.d.ts +2 -0
  26. package/dist/tests/core.worker.d.ts.map +1 -0
  27. package/dist/tests/core.worker.js +30 -0
  28. package/dist/vite.config.d.ts +3 -0
  29. package/dist/vite.config.d.ts.map +1 -0
  30. package/dist/vite.config.js +7 -0
  31. package/package.json +10 -6
  32. package/src/client.ts +245 -0
  33. package/src/index.ts +3 -0
  34. package/src/log.ts +62 -0
  35. package/src/server.ts +193 -0
  36. package/src/types.ts +66 -12
  37. package/src/utils.ts +0 -6
  38. package/dist/swarpc.d.ts +0 -25
  39. package/dist/swarpc.d.ts.map +0 -1
  40. package/dist/swarpc.js +0 -264
  41. package/dist/types.d.ts +0 -114
  42. package/dist/types.d.ts.map +0 -1
  43. package/dist/types.js +0 -8
  44. package/dist/utils.d.ts.map +0 -1
  45. package/src/swarpc.ts +0 -359
  46. /package/dist/{utils.d.ts → src/utils.d.ts} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"swarpc.d.ts","sourceRoot":"","sources":["../src/swarpc.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,EAML,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,YAAY,CAAA;AAGnB,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE3E;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,UAAU,SAAS,aAAa,EACrD,UAAU,EAAE,UAAU,EACtB,EAAE,MAAM,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GACnC,YAAY,CAAC,UAAU,CAAC,CAuG1B;AA+FD;;;;;;;GAOG;AACH,wBAAgB,MAAM,CAAC,UAAU,SAAS,aAAa,EACrD,UAAU,EAAE,UAAU,EACtB,EAAE,MAAM,EAAE,KAAU,EAAE,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;CAAO,GAC1E,YAAY,CAAC,UAAU,CAAC,CA0D1B"}
package/dist/swarpc.js DELETED
@@ -1,264 +0,0 @@
1
- import { type } from "arktype";
2
- import { zImplementations, zProcedures, } from "./types.js";
3
- import { findTransferables } from "./utils.js";
4
- /**
5
- * Creates a sw&rpc server instance.
6
- * @param procedures procedures the server will implement
7
- * @param param1 various options
8
- * @param param1.worker if provided, the server will use this worker to post messages, instead of sending it to all clients
9
- * @returns a SwarpcServer instance. Each property of the procedures map will be a method, that accepts a function implementing the procedure. There is also .start(), to be called after implementing all procedures.
10
- */
11
- export function Server(procedures, { worker } = {}) {
12
- // Initialize the instance.
13
- // Procedures and implementations are stored on properties with symbol keys,
14
- // to avoid any conflicts with procedure names, and also discourage direct access to them.
15
- const instance = {
16
- [zProcedures]: procedures,
17
- [zImplementations]: {},
18
- start: (self) => { },
19
- };
20
- // Set all implementation-setter methods
21
- for (const functionName in procedures) {
22
- instance[functionName] = ((implementation) => {
23
- if (!instance[zProcedures][functionName]) {
24
- throw new Error(`No procedure found for function name: ${functionName}`);
25
- }
26
- instance[zImplementations][functionName] = implementation;
27
- });
28
- }
29
- // Define payload schema for incoming messages
30
- const PayloadSchema = type.or(...Object.entries(procedures).map(([functionName, { input }]) => ({
31
- functionName: type(`"${functionName}"`),
32
- requestId: type("string >= 1"),
33
- input,
34
- })));
35
- instance.start = (self) => {
36
- // Used to post messages back to the client
37
- const postMessage = async (data) => {
38
- const transfer = data.autotransfer === "never" ? [] : findTransferables(data);
39
- if (worker) {
40
- self.postMessage(data, { transfer });
41
- }
42
- else {
43
- await self.clients.matchAll().then((clients) => {
44
- clients.forEach((client) => client.postMessage(data, { transfer }));
45
- });
46
- }
47
- };
48
- // Listen for messages from the client
49
- self.addEventListener("message", async (event) => {
50
- // Decode the payload
51
- const { functionName, requestId, input } = PayloadSchema.assert(event.data);
52
- l.server.debug(requestId, `Received request for ${functionName}`, input);
53
- // Get autotransfer preference from the procedure definition
54
- const { autotransfer = "output-only" } = instance[zProcedures][functionName];
55
- // Shorthand function with functionName, requestId, etc. set
56
- const postMsg = async (data) => postMessage({
57
- by: "sw&rpc",
58
- functionName,
59
- requestId,
60
- autotransfer,
61
- ...data,
62
- });
63
- // Prepare a function to post errors back to the client
64
- const postError = async (error) => postMsg({
65
- error: {
66
- message: "message" in error ? error.message : String(error),
67
- },
68
- });
69
- // Retrieve the implementation for the requested function
70
- const implementation = instance[zImplementations][functionName];
71
- if (!implementation) {
72
- await postError("No implementation found");
73
- return;
74
- }
75
- // Call the implementation with the input and a progress callback
76
- await implementation(input, async (progress) => {
77
- l.server.debug(requestId, `Progress for ${functionName}`, progress);
78
- await postMsg({ progress });
79
- })
80
- // Send errors
81
- .catch(async (error) => {
82
- l.server.error(requestId, `Error in ${functionName}`, error);
83
- await postError(error);
84
- })
85
- // Send results
86
- .then(async (result) => {
87
- l.server.debug(requestId, `Result for ${functionName}`, result);
88
- await postMsg({ result });
89
- });
90
- });
91
- };
92
- return instance;
93
- }
94
- /**
95
- * Generate a random request ID, used to identify requests between client and server.
96
- * @returns a 6-character hexadecimal string
97
- */
98
- function generateRequestId() {
99
- return Math.random().toString(16).substring(2, 8).toUpperCase();
100
- }
101
- /**
102
- * Pending requests are stored in a map, where the key is the request ID.
103
- * Each request has a set of handlers: resolve, reject, and onProgress.
104
- * This allows having a single listener for the client, and having multiple in-flight calls to the same procedure.
105
- */
106
- const pendingRequests = new Map();
107
- // Have we started the client listener?
108
- let _clientListenerStarted = false;
109
- /**
110
- * Starts the client listener, which listens for messages from the sw&rpc server.
111
- * @param worker if provided, the client will use this worker to listen for messages, instead of using the service worker
112
- * @returns
113
- */
114
- async function startClientListener(worker, hooks = {}) {
115
- if (_clientListenerStarted)
116
- return;
117
- // Get service worker registration if no worker is provided
118
- if (!worker) {
119
- const sw = await navigator.serviceWorker.ready;
120
- if (!sw?.active) {
121
- throw new Error("[SWARPC Client] Service Worker is not active");
122
- }
123
- if (!navigator.serviceWorker.controller) {
124
- l.client.warn("", "Service Worker is not controlling the page");
125
- }
126
- }
127
- const w = worker ?? navigator.serviceWorker;
128
- // Start listening for messages
129
- l.client.debug("", "Starting client listener on", w);
130
- w.addEventListener("message", (event) => {
131
- // Get the data from the event
132
- const eventData = event.data || {};
133
- // Ignore other messages that aren't for us
134
- if (eventData?.by !== "sw&rpc")
135
- return;
136
- // We don't use a arktype schema here, we trust the server to send valid data
137
- const { functionName, requestId, ...data } = eventData;
138
- // Sanity check in case we somehow receive a message without requestId
139
- if (!requestId) {
140
- throw new Error("[SWARPC Client] Message received without requestId");
141
- }
142
- // Get the associated pending request handlers
143
- const handlers = pendingRequests.get(requestId);
144
- if (!handlers) {
145
- throw new Error(`[SWARPC Client] ${requestId} has no active request handlers`);
146
- }
147
- // React to the data received: call hook, call handler,
148
- // and remove the request from pendingRequests (unless it's a progress update)
149
- if ("error" in data) {
150
- hooks.error?.(functionName, new Error(data.error.message));
151
- handlers.reject(new Error(data.error.message));
152
- pendingRequests.delete(requestId);
153
- }
154
- else if ("progress" in data) {
155
- hooks.progress?.(functionName, data.progress);
156
- handlers.onProgress(data.progress);
157
- }
158
- else if ("result" in data) {
159
- hooks.success?.(functionName, data.result);
160
- handlers.resolve(data.result);
161
- pendingRequests.delete(requestId);
162
- }
163
- });
164
- _clientListenerStarted = true;
165
- }
166
- /**
167
- *
168
- * @param procedures procedures the client will be able to call
169
- * @param param1 various options
170
- * @param param1.worker if provided, the client will use this worker to post messages.
171
- * @param param1.hooks hooks to run on messages received from the server
172
- * @returns a sw&rpc client instance. Each property of the procedures map will be a method, that accepts an input and an optional onProgress callback.
173
- */
174
- export function Client(procedures, { worker, hooks = {} } = {}) {
175
- // Store procedures on a symbol key, to avoid conflicts with procedure names
176
- const instance = { [zProcedures]: procedures };
177
- for (const functionName of Object.keys(procedures)) {
178
- if (typeof functionName !== "string") {
179
- throw new Error(`[SWARPC Client] Invalid function name, don't use symbols`);
180
- }
181
- // Set the method on the instance
182
- // @ts-expect-error
183
- instance[functionName] = (async (input, onProgress = () => { }) => {
184
- // Validate the input against the procedure's input schema
185
- procedures[functionName].input.assert(input);
186
- // Ensure that we're listening for messages from the server
187
- await startClientListener(worker, hooks);
188
- // If no worker is provided, we use the service worker
189
- const w = worker ?? (await navigator.serviceWorker.ready.then((r) => r.active));
190
- if (!w) {
191
- throw new Error("[SWARPC Client] No active service worker found");
192
- }
193
- return new Promise((resolve, reject) => {
194
- if (!worker && !navigator.serviceWorker.controller)
195
- l.client.warn("", "Service Worker is not controlling the page");
196
- const requestId = generateRequestId();
197
- // Store promise handlers (as well as progress updates handler)
198
- // so the client listener can resolve/reject the promise (and react to progress updates)
199
- // when the server sends messages back
200
- pendingRequests.set(requestId, { resolve, onProgress, reject });
201
- // Post the message to the server
202
- l.client.debug(requestId, `Requesting ${functionName} with`, input);
203
- w.postMessage({ functionName, input, requestId }, {
204
- transfer: procedures[functionName].autotransfer === "always"
205
- ? findTransferables(input)
206
- : [],
207
- });
208
- });
209
- });
210
- }
211
- return instance;
212
- }
213
- /**
214
- * Convenience shortcuts for logging.
215
- */
216
- const l = {
217
- server: {
218
- debug: logger("debug", "server"),
219
- info: logger("info", "server"),
220
- warn: logger("warn", "server"),
221
- error: logger("error", "server"),
222
- },
223
- client: {
224
- debug: logger("debug", "client"),
225
- info: logger("info", "client"),
226
- warn: logger("warn", "client"),
227
- error: logger("error", "client"),
228
- },
229
- };
230
- /**
231
- * Creates partially-applied logging functions given the first 2 args
232
- * @param severity
233
- * @param side
234
- * @returns
235
- */
236
- function logger(severity, side) {
237
- return (rqid, message, ...args) => log(severity, side, rqid, message, ...args);
238
- }
239
- /**
240
- * Send log messages to the console, with a helpful prefix.
241
- * @param severity
242
- * @param side
243
- * @param rqid request ID
244
- * @param message
245
- * @param args passed to console methods directly
246
- */
247
- function log(severity, side, rqid, message, ...args) {
248
- const prefix = "[" +
249
- ["SWARPC", side, rqid ? `%c${rqid}%c` : ""].filter(Boolean).join(" ") +
250
- "]";
251
- const prefixStyles = rqid ? ["color: cyan;", "color: inherit;"] : [];
252
- if (severity === "debug") {
253
- console.debug(prefix, ...prefixStyles, message, ...args);
254
- }
255
- else if (severity === "info") {
256
- console.info(prefix, ...prefixStyles, message, ...args);
257
- }
258
- else if (severity === "warn") {
259
- console.warn(prefix, ...prefixStyles, message, ...args);
260
- }
261
- else if (severity === "error") {
262
- console.error(prefix, ...prefixStyles, message, ...args);
263
- }
264
- }
package/dist/types.d.ts DELETED
@@ -1,114 +0,0 @@
1
- import type { Type } from "arktype";
2
- /**
3
- * A procedure declaration
4
- */
5
- export type Procedure<I extends Type, P extends Type, S extends Type> = {
6
- /**
7
- * ArkType type for the input (first argument) of the procedure, when calling it from the client.
8
- */
9
- input: I;
10
- /**
11
- * ArkType type for the data as the first argument given to the `onProgress` callback
12
- * when calling the procedure from the client.
13
- */
14
- progress: P;
15
- /**
16
- * ArkType type for the output (return value) of the procedure, when calling it from the client.
17
- */
18
- success: S;
19
- /**
20
- * When should the procedure automatically add ArrayBuffers and other transferable objects
21
- * to the [transfer list](https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope/postMessage#transfer)
22
- * when sending messages, both from the client to the server and vice versa.
23
- *
24
- * Transferring objects can improve performance by avoiding copies of large objects,
25
- * but _moves_ them to the other context, meaning that they cannot be used in the original context after being sent.
26
- *
27
- * 'output-only' by default: only transferables sent from the server to the client will be transferred.
28
- */
29
- autotransfer?: "always" | "never" | "output-only";
30
- };
31
- /**
32
- * An implementation of a procedure
33
- */
34
- export type ProcedureImplementation<I extends Type, P extends Type, S extends Type> = (input: I["inferOut"], onProgress: (progress: P["inferIn"]) => void) => Promise<S["inferIn"]>;
35
- /**
36
- * Declarations of procedures by name.
37
- */
38
- export type ProceduresMap = Record<string, Procedure<Type, Type, Type>>;
39
- /**
40
- * Implementations of procedures by name
41
- */
42
- export type ImplementationsMap<Procedures extends ProceduresMap> = {
43
- [F in keyof Procedures]: ProcedureImplementation<Procedures[F]["input"], Procedures[F]["progress"], Procedures[F]["success"]>;
44
- };
45
- /**
46
- * Declaration of hooks to run on messages received from the server
47
- */
48
- export type Hooks<Procedures extends ProceduresMap> = {
49
- /**
50
- * Called when a procedure call has been successful.
51
- */
52
- success?: <Procedure extends keyof ProceduresMap>(procedure: Procedure, data: Procedures[Procedure]["success"]["inferOut"]) => void;
53
- /**
54
- * Called when a procedure call has failed.
55
- */
56
- error?: <Procedure extends keyof ProceduresMap>(procedure: Procedure, error: Error) => void;
57
- /**
58
- * Called when a procedure call sends progress updates.
59
- */
60
- progress?: <Procedure extends keyof ProceduresMap>(procedure: Procedure, data: Procedures[Procedure]["progress"]["inferOut"]) => void;
61
- };
62
- export type PayloadHeader<PM extends ProceduresMap, Name extends keyof PM = keyof PM> = {
63
- by: "sw&rpc";
64
- functionName: Name & string;
65
- requestId: string;
66
- autotransfer: PM[Name]["autotransfer"];
67
- };
68
- export type PayloadCore<PM extends ProceduresMap, Name extends keyof PM = keyof PM> = {
69
- input: PM[Name]["input"]["inferOut"];
70
- } | {
71
- progress: PM[Name]["progress"]["inferOut"];
72
- } | {
73
- result: PM[Name]["success"]["inferOut"];
74
- } | {
75
- error: {
76
- message: string;
77
- };
78
- };
79
- /**
80
- * The effective payload as sent by the server to the client
81
- */
82
- export type Payload<PM extends ProceduresMap, Name extends keyof PM = keyof PM> = PayloadHeader<PM, Name> & PayloadCore<PM, Name>;
83
- /**
84
- * A procedure's corresponding method on the client instance -- used to call the procedure
85
- */
86
- export type ClientMethod<P extends Procedure<Type, Type, Type>> = (input: P["input"]["inferIn"], onProgress?: (progress: P["progress"]["inferOut"]) => void) => Promise<P["success"]["inferOut"]>;
87
- /**
88
- * Symbol used as the key for the procedures map on the server instance
89
- */
90
- export declare const zImplementations: unique symbol;
91
- /**
92
- * Symbol used as the key for the procedures map on instances
93
- */
94
- export declare const zProcedures: unique symbol;
95
- /**
96
- * The sw&rpc client instance, which provides methods to call procedures
97
- */
98
- export type SwarpcClient<Procedures extends ProceduresMap> = {
99
- [zProcedures]: Procedures;
100
- } & {
101
- [F in keyof Procedures]: ClientMethod<Procedures[F]>;
102
- };
103
- /**
104
- * The sw&rpc server instance, which provides methods to register procedure implementations,
105
- * and listens for incoming messages that call those procedures
106
- */
107
- export type SwarpcServer<Procedures extends ProceduresMap> = {
108
- [zProcedures]: Procedures;
109
- [zImplementations]: ImplementationsMap<Procedures>;
110
- start(self: Window): void;
111
- } & {
112
- [F in keyof Procedures]: (impl: ProcedureImplementation<Procedures[F]["input"], Procedures[F]["progress"], Procedures[F]["success"]>) => void;
113
- };
114
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,I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ACV,CAAA"}
package/dist/types.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Symbol used as the key for the procedures map on the server instance
3
- */
4
- export const zImplementations = Symbol("SWARPC implementations");
5
- /**
6
- * Symbol used as the key for the procedures map on instances
7
- */
8
- export const zProcedures = Symbol("SWARPC procedures");
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAiBA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,GAAG,YAAY,EAAE,CAsB5D"}