@xeonr/renderer-sdk 1.1.0 → 1.3.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.
- package/dist/client.d.ts +32 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +78 -1
- package/dist/client.js.map +1 -1
- package/dist/react/index.d.ts +1 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/useRendererClient.d.ts +9 -0
- package/dist/react/useRendererClient.d.ts.map +1 -1
- package/dist/react/useRendererClient.js +80 -18
- package/dist/react/useRendererClient.js.map +1 -1
- package/dist/react/useReportFatalError.d.ts +37 -0
- package/dist/react/useReportFatalError.d.ts.map +1 -0
- package/dist/react/useReportFatalError.js +71 -0
- package/dist/react/useReportFatalError.js.map +1 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +91 -1
- package/src/react/index.ts +1 -0
- package/src/react/useRendererClient.ts +95 -21
- package/src/react/useReportFatalError.tsx +71 -0
- package/src/types.ts +19 -0
package/dist/client.d.ts
CHANGED
|
@@ -7,6 +7,15 @@ export interface RendererClientOptions {
|
|
|
7
7
|
* If omitted, all origins are accepted (suitable for local dev).
|
|
8
8
|
*/
|
|
9
9
|
targetOrigin?: string;
|
|
10
|
+
/**
|
|
11
|
+
* How long after init to wait for `signalReady()` before auto-acking
|
|
12
|
+
* anyway, in milliseconds. Only honored when the renderer's
|
|
13
|
+
* `config.json` has `deferReady: true`. Default 30000 (30s).
|
|
14
|
+
* Matches the host bridge's 10s init-timeout × ~3 — enough headroom
|
|
15
|
+
* for slow data fetches without leaving the user staring at a
|
|
16
|
+
* loading overlay indefinitely.
|
|
17
|
+
*/
|
|
18
|
+
readyTimeoutMs?: number;
|
|
10
19
|
}
|
|
11
20
|
type InitCallback = (payload: InitPayload) => void;
|
|
12
21
|
type ThemeCallback = (theme: 'light' | 'dark') => void;
|
|
@@ -45,11 +54,17 @@ export declare class RendererClient {
|
|
|
45
54
|
private currentConfig;
|
|
46
55
|
private currentTheme;
|
|
47
56
|
private currentApiBaseUrl;
|
|
57
|
+
private currentEntrypoint;
|
|
48
58
|
private currentPath;
|
|
59
|
+
private currentConnected;
|
|
49
60
|
private listener;
|
|
50
61
|
private errorListener;
|
|
51
62
|
private rejectionListener;
|
|
52
63
|
private hashChangeListener;
|
|
64
|
+
private ackDeferred;
|
|
65
|
+
private ackSent;
|
|
66
|
+
private readyTimeoutMs;
|
|
67
|
+
private readyTimeoutHandle;
|
|
53
68
|
private readyRetryInterval;
|
|
54
69
|
private readyRetryTimeout;
|
|
55
70
|
private historyPatched;
|
|
@@ -107,6 +122,14 @@ export declare class RendererClient {
|
|
|
107
122
|
getTheme(): 'light' | 'dark';
|
|
108
123
|
/** Get the current hash path (e.g. '/settings/advanced'). */
|
|
109
124
|
getPath(): string;
|
|
125
|
+
/** Has the init message been processed? Late subscribers (e.g. a
|
|
126
|
+
* second `useRendererClient` mount after init landed) read this to
|
|
127
|
+
* seed their initial state without waiting for the next onInit. */
|
|
128
|
+
isConnected(): boolean;
|
|
129
|
+
/** Which HTML entrypoint was loaded (dashboard or portal). */
|
|
130
|
+
getEntrypoint(): 'dashboard' | 'portal' | null;
|
|
131
|
+
/** Base URL for upl.im API calls, as supplied by the host. */
|
|
132
|
+
getApiBaseUrl(): string | null;
|
|
110
133
|
/**
|
|
111
134
|
* Returns an API adapter compatible with `getUploadClientWithEnv()` from `@xeonr/uploads-sdk`.
|
|
112
135
|
* Handles authentication and automatic token refresh via the host bridge.
|
|
@@ -126,6 +149,15 @@ export declare class RendererClient {
|
|
|
126
149
|
private stopReadyRetry;
|
|
127
150
|
private handleMessage;
|
|
128
151
|
private handleInit;
|
|
152
|
+
/**
|
|
153
|
+
* Post the deferred ack so the host overlay dismisses. No-op once
|
|
154
|
+
* the ack has been sent (the host-side bridge tolerates duplicates
|
|
155
|
+
* but we suppress them here for cleanliness). When `deferReady` was
|
|
156
|
+
* not set on construction this is also a no-op — the SDK already
|
|
157
|
+
* acked synchronously on init.
|
|
158
|
+
*/
|
|
159
|
+
signalReady(): void;
|
|
160
|
+
private sendAck;
|
|
129
161
|
private handleThemeUpdate;
|
|
130
162
|
private handleTokenRefresh;
|
|
131
163
|
private handleGenerateTokenResult;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EASX,iBAAiB,EACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhH,MAAM,WAAW,qBAAqB;IACrC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EASX,iBAAiB,EACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhH,MAAM,WAAW,qBAAqB;IACrC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,KAAK,YAAY,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;AACnD,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;AACvD,KAAK,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;AAChE,KAAK,gBAAgB,GAAG,CAAC,IAAI,EAAE,MA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,IAAI,MAAM,GAAG,IAAI;IAI9B;;;;;;;;;;;OAWG;IACH,aAAa,IAAI,kBAAkB;IAsBnC,gDAAgD;IAChD,OAAO,IAAI,IAAI;IA0Cf,OAAO,CAAC,KAAK;IAgCb,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,aAAa;IAuBrB,OAAO,CAAC,UAAU;IAoDlB;;;;;;OAMG;IACH,WAAW,IAAI,IAAI;IAKnB,OAAO,CAAC,OAAO;IAUf,OAAO,CAAC,iBAAiB;IAOzB,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,yBAAyB;IAQjC,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,aAAa;IAkBrB,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,UAAU;IAKlB;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,iBAAiB;IA0BzB;;;;;;;OAOG;IACH,WAAW,CAAC,IAAI,EAAE,iBAAiB,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI;CAQ3D"}
|
package/dist/client.js
CHANGED
|
@@ -32,11 +32,20 @@ export class RendererClient {
|
|
|
32
32
|
currentConfig = null;
|
|
33
33
|
currentTheme = 'light';
|
|
34
34
|
currentApiBaseUrl = null;
|
|
35
|
+
currentEntrypoint = null;
|
|
35
36
|
currentPath = '/';
|
|
37
|
+
currentConnected = false;
|
|
36
38
|
listener = null;
|
|
37
39
|
errorListener = null;
|
|
38
40
|
rejectionListener = null;
|
|
39
41
|
hashChangeListener = null;
|
|
42
|
+
// `signalReady` machinery — see `deferReady` in RendererClientOptions.
|
|
43
|
+
// `ackDeferred` is set at construction; `ackSent` flips when we
|
|
44
|
+
// actually post the ack so signalReady stays idempotent.
|
|
45
|
+
ackDeferred = false;
|
|
46
|
+
ackSent = false;
|
|
47
|
+
readyTimeoutMs = 30_000;
|
|
48
|
+
readyTimeoutHandle = null;
|
|
40
49
|
readyRetryInterval = null;
|
|
41
50
|
readyRetryTimeout = null;
|
|
42
51
|
historyPatched = false;
|
|
@@ -49,6 +58,13 @@ export class RendererClient {
|
|
|
49
58
|
apiAdapter = null;
|
|
50
59
|
constructor(options) {
|
|
51
60
|
this.targetOrigin = options?.targetOrigin ?? '*';
|
|
61
|
+
// `ackDeferred` is decided by config.json (read in handleInit)
|
|
62
|
+
// rather than the constructor — the SDK can't know which mode
|
|
63
|
+
// the renderer wants until init lands, but that's fine because
|
|
64
|
+
// the ack itself only fires after init anyway.
|
|
65
|
+
if (typeof options?.readyTimeoutMs === 'number' && options.readyTimeoutMs > 0) {
|
|
66
|
+
this.readyTimeoutMs = options.readyTimeoutMs;
|
|
67
|
+
}
|
|
52
68
|
this.setup();
|
|
53
69
|
}
|
|
54
70
|
// ---------------------------------------------------------------------------
|
|
@@ -161,6 +177,20 @@ export class RendererClient {
|
|
|
161
177
|
getPath() {
|
|
162
178
|
return this.currentPath;
|
|
163
179
|
}
|
|
180
|
+
/** Has the init message been processed? Late subscribers (e.g. a
|
|
181
|
+
* second `useRendererClient` mount after init landed) read this to
|
|
182
|
+
* seed their initial state without waiting for the next onInit. */
|
|
183
|
+
isConnected() {
|
|
184
|
+
return this.currentConnected;
|
|
185
|
+
}
|
|
186
|
+
/** Which HTML entrypoint was loaded (dashboard or portal). */
|
|
187
|
+
getEntrypoint() {
|
|
188
|
+
return this.currentEntrypoint;
|
|
189
|
+
}
|
|
190
|
+
/** Base URL for upl.im API calls, as supplied by the host. */
|
|
191
|
+
getApiBaseUrl() {
|
|
192
|
+
return this.currentApiBaseUrl;
|
|
193
|
+
}
|
|
164
194
|
/**
|
|
165
195
|
* Returns an API adapter compatible with `getUploadClientWithEnv()` from `@xeonr/uploads-sdk`.
|
|
166
196
|
* Handles authentication and automatic token refresh via the host bridge.
|
|
@@ -197,6 +227,10 @@ export class RendererClient {
|
|
|
197
227
|
destroy() {
|
|
198
228
|
this.destroyed = true;
|
|
199
229
|
this.stopReadyRetry();
|
|
230
|
+
if (this.readyTimeoutHandle) {
|
|
231
|
+
clearTimeout(this.readyTimeoutHandle);
|
|
232
|
+
this.readyTimeoutHandle = null;
|
|
233
|
+
}
|
|
200
234
|
if (this.listener) {
|
|
201
235
|
window.removeEventListener('message', this.listener);
|
|
202
236
|
this.listener = null;
|
|
@@ -304,6 +338,8 @@ export class RendererClient {
|
|
|
304
338
|
this.currentConfig = payload.config;
|
|
305
339
|
this.currentTheme = payload.theme;
|
|
306
340
|
this.currentApiBaseUrl = payload.apiBaseUrl;
|
|
341
|
+
this.currentEntrypoint = payload.entrypoint;
|
|
342
|
+
this.currentConnected = true;
|
|
307
343
|
// Apply initial path from host URL fragment
|
|
308
344
|
if (payload.initialPath) {
|
|
309
345
|
this.suppressHashChange = true;
|
|
@@ -319,7 +355,48 @@ export class RendererClient {
|
|
|
319
355
|
for (const cb of this.initCallbacks) {
|
|
320
356
|
cb(payload);
|
|
321
357
|
}
|
|
322
|
-
//
|
|
358
|
+
// Ack semantics — driven by the renderer's config.json
|
|
359
|
+
// (`deferReady` field). Declaring it in config rather than as a
|
|
360
|
+
// constructor option keeps all renderer metadata in one place
|
|
361
|
+
// (alongside permissions / sandbox / connectHosts / buildHash)
|
|
362
|
+
// and avoids a code-vs-config-disagreement footgun.
|
|
363
|
+
this.ackDeferred = payload.config?.deferReady === true;
|
|
364
|
+
if (!this.ackDeferred) {
|
|
365
|
+
this.sendAck();
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
this.readyTimeoutHandle = setTimeout(() => {
|
|
369
|
+
if (this.destroyed || this.ackSent)
|
|
370
|
+
return;
|
|
371
|
+
// Best-effort log so an operator can spot the late ack
|
|
372
|
+
// in dev tools; production console noise is acceptable
|
|
373
|
+
// here because this only fires when something is wrong.
|
|
374
|
+
console.warn('[uplim] signalReady() not called within ' +
|
|
375
|
+
this.readyTimeoutMs + 'ms — auto-acking so the host overlay can dismiss.');
|
|
376
|
+
this.sendAck();
|
|
377
|
+
}, this.readyTimeoutMs);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* Post the deferred ack so the host overlay dismisses. No-op once
|
|
382
|
+
* the ack has been sent (the host-side bridge tolerates duplicates
|
|
383
|
+
* but we suppress them here for cleanliness). When `deferReady` was
|
|
384
|
+
* not set on construction this is also a no-op — the SDK already
|
|
385
|
+
* acked synchronously on init.
|
|
386
|
+
*/
|
|
387
|
+
signalReady() {
|
|
388
|
+
if (this.destroyed || this.ackSent || !this.ackDeferred)
|
|
389
|
+
return;
|
|
390
|
+
this.sendAck();
|
|
391
|
+
}
|
|
392
|
+
sendAck() {
|
|
393
|
+
if (this.ackSent)
|
|
394
|
+
return;
|
|
395
|
+
this.ackSent = true;
|
|
396
|
+
if (this.readyTimeoutHandle) {
|
|
397
|
+
clearTimeout(this.readyTimeoutHandle);
|
|
398
|
+
this.readyTimeoutHandle = null;
|
|
399
|
+
}
|
|
323
400
|
this.postToHost({ type: 'uplim:ack' });
|
|
324
401
|
}
|
|
325
402
|
handleThemeUpdate(message) {
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAiBlF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,cAAc;IAClB,YAAY,CAAS;IACrB,aAAa,GAAmB,EAAE,CAAC;IACnC,cAAc,GAAoB,EAAE,CAAC;IACrC,cAAc,GAAoB,EAAE,CAAC;IACrC,iBAAiB,GAAuB,EAAE,CAAC;IAE3C,YAAY,GAAkB,IAAI,CAAC;IACnC,qBAAqB,GAAkB,IAAI,CAAC;IAC5C,YAAY,GAAyB,IAAI,CAAC;IAC1C,oBAAoB,GAAyB,IAAI,CAAC;IAClD,aAAa,GAA0B,IAAI,CAAC;IAC5C,YAAY,GAAqB,OAAO,CAAC;IACzC,iBAAiB,GAAkB,IAAI,CAAC;IACxC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AAC,SAAS;gBAAE,OAAO;YAC3B,kEAAkE;YAClE,8DAA8D;YAC9D,oDAAoD;YACpD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,IAAI;gBAC7B,IAAI,EAAE,YAAY;gBAClB,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,gBAAgB;gBAC1C,KAAK,EAAE,KAAK,CAAC,QAAQ;oBACpB,CAAC,CAAC,MAAM,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,IAAI,GAAG,IAAI,KAAK,CAAC,KAAK,IAAI,GAAG,EAAE;oBACrE,CAAC,CAAC,EAAE;aACL,CAAC;YACF,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACnC,CAAC,CAAC;QACF,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QAErD,IAAI,CAAC,iBAAiB,GAAG,CAAC,KAA4B,EAAE,EAAE;YACzD,IAAI,IAAI,CAAC,SAAS;gBAAE,OAAO;YAC3B,IAAI,CAAC,WAAW,CAAC,qBAAqB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QACvD,CAAC,CAAC;QACF,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,IAAI,CAAC,iBAAiB,CAAC,CAAC;IACvE,CAAC;IAED;;;;;;;OAOG;IACH,WAAW,CAAC,IAAuB,EAAE,MAAe;QACnD,IAAI,CAAC;YACJ,MAAM,GAAG,GAAuB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YAChE,eAAe,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACzC,CAAC;QAAC,MAAM,CAAC;YACR,oCAAoC;QACrC,CAAC;IACF,CAAC;CACD"}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { useRendererClient } from './useRendererClient.js';
|
|
|
2
2
|
export type { UseRendererClientOptions, UseRendererClientResult } from './useRendererClient.js';
|
|
3
3
|
export { RendererErrorBoundary } from './RendererErrorBoundary.js';
|
|
4
4
|
export type { RendererErrorBoundaryProps } from './RendererErrorBoundary.js';
|
|
5
|
+
export { useReportFatalError } from './useReportFatalError.js';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,YAAY,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,YAAY,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/react/index.js
CHANGED
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -32,6 +32,15 @@ export interface UseRendererClientResult {
|
|
|
32
32
|
requestToken: () => void;
|
|
33
33
|
/** Request the host to close this renderer (modal mode). */
|
|
34
34
|
close: () => void;
|
|
35
|
+
/**
|
|
36
|
+
* When the renderer's `config.json` has `deferReady: true`, call
|
|
37
|
+
* this once the renderer's data is loaded and the UI is ready to
|
|
38
|
+
* be visible. The host overlay stays up until this fires (or until
|
|
39
|
+
* the SDK's safety timeout elapses — see
|
|
40
|
+
* `RendererClientOptions.readyTimeoutMs`). No-op when `deferReady`
|
|
41
|
+
* isn't set in config.
|
|
42
|
+
*/
|
|
43
|
+
markReady: () => void;
|
|
35
44
|
/** The underlying RendererClient instance for advanced use. */
|
|
36
45
|
client: RendererClient;
|
|
37
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRendererClient.d.ts","sourceRoot":"","sources":["../../src/react/useRendererClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAe,MAAM,aAAa,CAAC;AAEjH,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;CAAG;
|
|
1
|
+
{"version":3,"file":"useRendererClient.d.ts","sourceRoot":"","sources":["../../src/react/useRendererClient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAe,MAAM,aAAa,CAAC;AAEjH,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;CAAG;AAiF1E,MAAM,WAAW,uBAAuB;IACvC,kDAAkD;IAClD,SAAS,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,2CAA2C;IAC3C,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IACpC,4CAA4C;IAC5C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,kDAAkD;IAClD,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,8BAA8B;IAC9B,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,wDAAwD;IACxD,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B,yDAAyD;IACzD,UAAU,EAAE,WAAW,GAAG,QAAQ,GAAG,IAAI,CAAC;IAC1C,qCAAqC;IACrC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,0EAA0E;IAC1E,UAAU,EAAE,kBAAkB,CAAC;IAC/B,oGAAoG;IACpG,IAAI,EAAE,MAAM,CAAC;IAEb,kDAAkD;IAClD,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,gDAAgD;IAChD,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,4DAA4D;IAC5D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB;;;;;;;OAOG;IACH,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB,+DAA+D;IAC/D,MAAM,EAAE,cAAc,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,uBAAuB,CAqF7F"}
|
|
@@ -1,5 +1,60 @@
|
|
|
1
|
-
import { useState,
|
|
1
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
2
2
|
import { RendererClient } from '../client.js';
|
|
3
|
+
// One RendererClient per page. Multiple `useRendererClient()` calls
|
|
4
|
+
// (different components subscribing to the same state) all share the
|
|
5
|
+
// singleton — previously each call spawned its own client, which
|
|
6
|
+
// caused duplicate `window.error` / `unhandledrejection` listeners
|
|
7
|
+
// (so every crash got reported N times), duplicate `uplim:ready`
|
|
8
|
+
// pings, and state divergence between instances.
|
|
9
|
+
//
|
|
10
|
+
// Page lifetime: the iframe is full-reloaded for HMR / test, so the
|
|
11
|
+
// module-level singleton lives exactly as long as it should. SDK-level
|
|
12
|
+
// HMR (developer working on the SDK in monorepo, hot-replacing this
|
|
13
|
+
// module) is handled via `import.meta.hot.dispose` at the bottom of
|
|
14
|
+
// the file.
|
|
15
|
+
let sharedClient = null;
|
|
16
|
+
let sharedClientOptionsKey = null;
|
|
17
|
+
function optionsKey(options) {
|
|
18
|
+
if (!options)
|
|
19
|
+
return '';
|
|
20
|
+
// Stable order so { a, b } and { b, a } produce the same key. Used
|
|
21
|
+
// only for the dev-mode mismatch warning — never for behavior.
|
|
22
|
+
const entries = Object.entries(options).sort(([a], [b]) => a.localeCompare(b));
|
|
23
|
+
return JSON.stringify(entries);
|
|
24
|
+
}
|
|
25
|
+
function getSharedClient(options) {
|
|
26
|
+
if (sharedClient) {
|
|
27
|
+
const key = optionsKey(options);
|
|
28
|
+
// Best-effort dev nudge: if a later mount passes different
|
|
29
|
+
// options than the first one, those options are silently
|
|
30
|
+
// ignored. Only flag when keys differ AND the later caller
|
|
31
|
+
// passed non-empty options (passing nothing is the common
|
|
32
|
+
// case for downstream subscribers).
|
|
33
|
+
if (key && sharedClientOptionsKey !== null && key !== sharedClientOptionsKey) {
|
|
34
|
+
// eslint-disable-next-line no-console
|
|
35
|
+
console.warn('[uplim] useRendererClient called with different options after first call; ' +
|
|
36
|
+
'later options are ignored (the client is a per-page singleton).');
|
|
37
|
+
}
|
|
38
|
+
return sharedClient;
|
|
39
|
+
}
|
|
40
|
+
sharedClient = new RendererClient(options);
|
|
41
|
+
sharedClientOptionsKey = optionsKey(options);
|
|
42
|
+
return sharedClient;
|
|
43
|
+
}
|
|
44
|
+
// SDK-dev HMR cleanup: when this module is hot-replaced (e.g. someone
|
|
45
|
+
// editing the SDK with the renderer harness running), detach the old
|
|
46
|
+
// client's listeners before the new module evaluates. Prod / non-HMR
|
|
47
|
+
// builds skip the entire block — `import.meta.hot` is undefined.
|
|
48
|
+
const maybeHot = import.meta.hot;
|
|
49
|
+
if (maybeHot) {
|
|
50
|
+
maybeHot.dispose(() => {
|
|
51
|
+
if (sharedClient) {
|
|
52
|
+
sharedClient.destroy();
|
|
53
|
+
sharedClient = null;
|
|
54
|
+
sharedClientOptionsKey = null;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
3
58
|
/**
|
|
4
59
|
* Apply the host's theme to the renderer document. Two distinct effects:
|
|
5
60
|
*
|
|
@@ -42,22 +97,22 @@ function applyThemeToDocument(theme) {
|
|
|
42
97
|
* ```
|
|
43
98
|
*/
|
|
44
99
|
export function useRendererClient(options) {
|
|
45
|
-
const
|
|
46
|
-
//
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const [connected, setConnected] = useState(
|
|
52
|
-
const [scope, setScope] = useState(
|
|
53
|
-
const [renderingType, setRenderingType] = useState(
|
|
54
|
-
const [token, setToken] = useState(
|
|
55
|
-
const [tokenExpiresAt, setTokenExpiresAt] = useState(
|
|
56
|
-
const [theme, setTheme] = useState(
|
|
57
|
-
const [config, setConfig] = useState(
|
|
58
|
-
const [entrypoint, setEntrypoint] = useState(
|
|
59
|
-
const [apiBaseUrl, setApiBaseUrl] = useState(
|
|
60
|
-
const [path, setPath] = useState(
|
|
100
|
+
const client = getSharedClient(options);
|
|
101
|
+
// Initial state read directly from the client — handles late
|
|
102
|
+
// subscribers (a second `useRendererClient` mount that happens
|
|
103
|
+
// after init has already fired). Without this, the late mount
|
|
104
|
+
// would sit at `connected: false` forever because onInit only
|
|
105
|
+
// fires for NEW init events, not for already-received state.
|
|
106
|
+
const [connected, setConnected] = useState(() => client.isConnected());
|
|
107
|
+
const [scope, setScope] = useState(() => client.getScope());
|
|
108
|
+
const [renderingType, setRenderingType] = useState(() => client.getRenderingType());
|
|
109
|
+
const [token, setToken] = useState(() => client.getToken());
|
|
110
|
+
const [tokenExpiresAt, setTokenExpiresAt] = useState(() => client.getTokenExpiresAt());
|
|
111
|
+
const [theme, setTheme] = useState(() => client.getTheme());
|
|
112
|
+
const [config, setConfig] = useState(() => client.getConfig());
|
|
113
|
+
const [entrypoint, setEntrypoint] = useState(() => client.getEntrypoint());
|
|
114
|
+
const [apiBaseUrl, setApiBaseUrl] = useState(() => client.getApiBaseUrl());
|
|
115
|
+
const [path, setPath] = useState(() => client.getPath());
|
|
61
116
|
useEffect(() => {
|
|
62
117
|
const unsubInit = client.onInit((payload) => {
|
|
63
118
|
setConnected(true);
|
|
@@ -88,13 +143,20 @@ export function useRendererClient(options) {
|
|
|
88
143
|
unsubTheme();
|
|
89
144
|
unsubToken();
|
|
90
145
|
unsubNavigate();
|
|
91
|
-
|
|
146
|
+
// NB: do NOT destroy() here — the client is a per-page
|
|
147
|
+
// singleton, not a per-component instance. Component
|
|
148
|
+
// unmounts (route changes / strict-mode double-mount /
|
|
149
|
+
// React render-time tearing) shouldn't kill the shared
|
|
150
|
+
// state. The iframe full-reload tears the singleton down
|
|
151
|
+
// implicitly when the page goes away; SDK-level HMR is
|
|
152
|
+
// handled by import.meta.hot.dispose at the top of file.
|
|
92
153
|
};
|
|
93
154
|
}, [client]);
|
|
94
155
|
const methods = useMemo(() => ({
|
|
95
156
|
openUpload: (uploadId) => client.openUpload(uploadId),
|
|
96
157
|
requestToken: () => client.requestToken(),
|
|
97
158
|
close: () => client.close(),
|
|
159
|
+
markReady: () => client.signalReady(),
|
|
98
160
|
apiAdapter: client.getApiAdapter(),
|
|
99
161
|
}), [client]);
|
|
100
162
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRendererClient.js","sourceRoot":"","sources":["../../src/react/useRendererClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"useRendererClient.js","sourceRoot":"","sources":["../../src/react/useRendererClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAM9C,oEAAoE;AACpE,qEAAqE;AACrE,iEAAiE;AACjE,mEAAmE;AACnE,iEAAiE;AACjE,iDAAiD;AACjD,EAAE;AACF,oEAAoE;AACpE,uEAAuE;AACvE,oEAAoE;AACpE,oEAAoE;AACpE,YAAY;AACZ,IAAI,YAAY,GAA0B,IAAI,CAAC;AAC/C,IAAI,sBAAsB,GAAkB,IAAI,CAAC;AAEjD,SAAS,UAAU,CAAC,OAA6C;IAChE,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IACxB,mEAAmE;IACnE,+DAA+D;IAC/D,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/E,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAChC,CAAC;AAED,SAAS,eAAe,CAAC,OAA6C;IACrE,IAAI,YAAY,EAAE,CAAC;QAClB,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAChC,2DAA2D;QAC3D,yDAAyD;QACzD,2DAA2D;QAC3D,0DAA0D;QAC1D,oCAAoC;QACpC,IAAI,GAAG,IAAI,sBAAsB,KAAK,IAAI,IAAI,GAAG,KAAK,sBAAsB,EAAE,CAAC;YAC9E,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACX,4EAA4E;gB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,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QAC9B,UAAU,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC;QAC7D,YAAY,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE;QACzC,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE;QAC3B,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE;QACrC,UAAU,EAAE,MAAM,CAAC,aAAa,EAAE;KAClC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;IAEd,OAAO;QACN,SAAS;QACT,KAAK;QACL,aAAa;QACb,KAAK;QACL,cAAc;QACd,KAAK;QACL,MAAM;QACN,UAAU;QACV,UAAU;QACV,IAAI;QACJ,MAAM;QACN,GAAG,OAAO;KACV,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for surfacing async failures to `<RendererErrorBoundary>` (and from
|
|
3
|
+
* there to the host's crash overlay + telemetry).
|
|
4
|
+
*
|
|
5
|
+
* Renderers shouldn't render their own "Upload not found" / "Failed to
|
|
6
|
+
* load" inline UI — those are still crashes from a telemetry standpoint,
|
|
7
|
+
* and the host already owns a polished overlay with reload + fallback
|
|
8
|
+
* actions. This hook lets a renderer take an error caught in an async
|
|
9
|
+
* context (fetch `.catch()`, useEffect cleanup, etc.) and route it to
|
|
10
|
+
* the host instead of rendering a half-broken inline state.
|
|
11
|
+
*
|
|
12
|
+
* Pattern:
|
|
13
|
+
*
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const reportFatal = useReportFatalError();
|
|
16
|
+
* useEffect(() => {
|
|
17
|
+
* client.getUpload(...).catch(reportFatal);
|
|
18
|
+
* }, []);
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* Mechanics: we keep an error in component state. When set, the *next*
|
|
22
|
+
* render throws it — React's error-handling pipeline catches the throw
|
|
23
|
+
* and bubbles to the nearest boundary. From there
|
|
24
|
+
* `RendererErrorBoundary.componentDidCatch` reports the crash to the
|
|
25
|
+
* host and renders nothing, and the host overlay (Reload / Copy /
|
|
26
|
+
* Fallback) takes over the visible iframe area.
|
|
27
|
+
*
|
|
28
|
+
* Why state-then-throw rather than a direct `throw err`? You can't
|
|
29
|
+
* throw to React from async code — React only sees throws that happen
|
|
30
|
+
* during render or in event handlers. Routing through state ensures
|
|
31
|
+
* the throw lands inside the render phase.
|
|
32
|
+
*
|
|
33
|
+
* The returned callback is stable across renders so it's safe to drop
|
|
34
|
+
* straight into a `.catch()`.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useReportFatalError(): (err: unknown) => void;
|
|
37
|
+
//# sourceMappingURL=useReportFatalError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReportFatalError.d.ts","sourceRoot":"","sources":["../../src/react/useReportFatalError.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,mBAAmB,IAAI,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAiC5D"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Hook for surfacing async failures to `<RendererErrorBoundary>` (and from
|
|
4
|
+
* there to the host's crash overlay + telemetry).
|
|
5
|
+
*
|
|
6
|
+
* Renderers shouldn't render their own "Upload not found" / "Failed to
|
|
7
|
+
* load" inline UI — those are still crashes from a telemetry standpoint,
|
|
8
|
+
* and the host already owns a polished overlay with reload + fallback
|
|
9
|
+
* actions. This hook lets a renderer take an error caught in an async
|
|
10
|
+
* context (fetch `.catch()`, useEffect cleanup, etc.) and route it to
|
|
11
|
+
* the host instead of rendering a half-broken inline state.
|
|
12
|
+
*
|
|
13
|
+
* Pattern:
|
|
14
|
+
*
|
|
15
|
+
* ```tsx
|
|
16
|
+
* const reportFatal = useReportFatalError();
|
|
17
|
+
* useEffect(() => {
|
|
18
|
+
* client.getUpload(...).catch(reportFatal);
|
|
19
|
+
* }, []);
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* Mechanics: we keep an error in component state. When set, the *next*
|
|
23
|
+
* render throws it — React's error-handling pipeline catches the throw
|
|
24
|
+
* and bubbles to the nearest boundary. From there
|
|
25
|
+
* `RendererErrorBoundary.componentDidCatch` reports the crash to the
|
|
26
|
+
* host and renders nothing, and the host overlay (Reload / Copy /
|
|
27
|
+
* Fallback) takes over the visible iframe area.
|
|
28
|
+
*
|
|
29
|
+
* Why state-then-throw rather than a direct `throw err`? You can't
|
|
30
|
+
* throw to React from async code — React only sees throws that happen
|
|
31
|
+
* during render or in event handlers. Routing through state ensures
|
|
32
|
+
* the throw lands inside the render phase.
|
|
33
|
+
*
|
|
34
|
+
* The returned callback is stable across renders so it's safe to drop
|
|
35
|
+
* straight into a `.catch()`.
|
|
36
|
+
*/
|
|
37
|
+
export function useReportFatalError() {
|
|
38
|
+
// Generic state slot — we never read the value, only use the
|
|
39
|
+
// updater. We narrow to `never` so TypeScript stops us from
|
|
40
|
+
// accidentally using it as data anywhere.
|
|
41
|
+
const [, setState] = useState();
|
|
42
|
+
return useCallback((err) => {
|
|
43
|
+
// Functional updater throws — React invokes it during the next
|
|
44
|
+
// render attempt, which puts the throw inside the render phase
|
|
45
|
+
// where boundaries can see it.
|
|
46
|
+
setState(() => {
|
|
47
|
+
if (err instanceof Error) {
|
|
48
|
+
throw err;
|
|
49
|
+
}
|
|
50
|
+
// Wrap non-Error throws so the boundary always sees a real
|
|
51
|
+
// Error instance with a meaningful .name / .message. Without
|
|
52
|
+
// this, `client.reportCrash` would synthesise a generic
|
|
53
|
+
// 'UnknownError' which loses the original payload's shape.
|
|
54
|
+
if (typeof err === 'string') {
|
|
55
|
+
throw new Error(err);
|
|
56
|
+
}
|
|
57
|
+
if (err && typeof err === 'object' && 'message' in err && typeof err.message === 'string') {
|
|
58
|
+
const wrapped = new Error(err.message);
|
|
59
|
+
if ('name' in err && typeof err.name === 'string') {
|
|
60
|
+
wrapped.name = err.name;
|
|
61
|
+
}
|
|
62
|
+
if ('stack' in err && typeof err.stack === 'string') {
|
|
63
|
+
wrapped.stack = err.stack;
|
|
64
|
+
}
|
|
65
|
+
throw wrapped;
|
|
66
|
+
}
|
|
67
|
+
throw new Error('Unknown renderer error');
|
|
68
|
+
});
|
|
69
|
+
}, []);
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=useReportFatalError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReportFatalError.js","sourceRoot":"","sources":["../../src/react/useReportFatalError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,mBAAmB;IAClC,6DAA6D;IAC7D,4DAA4D;IAC5D,0CAA0C;IAC1C,MAAM,CAAC,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAS,CAAC;IACvC,OAAO,WAAW,CAAC,CAAC,GAAY,EAAE,EAAE;QACnC,+DAA+D;QAC/D,+DAA+D;QAC/D,+BAA+B;QAC/B,QAAQ,CAAC,GAAG,EAAE;YACb,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC;gBAC1B,MAAM,GAAG,CAAC;YACX,CAAC;YACD,2DAA2D;YAC3D,6DAA6D;YAC7D,wDAAwD;YACxD,2DAA2D;YAC3D,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;gBAC7B,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC;YACtB,CAAC;YACD,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,SAAS,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,OAAO,KAAK,QAAQ,EAAE,CAAC;gBAC3F,MAAM,OAAO,GAAG,IAAI,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBACvC,IAAI,MAAM,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;oBACnD,OAAO,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;gBACzB,CAAC;gBACD,IAAI,OAAO,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;oBACrD,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;gBAC3B,CAAC;gBACD,MAAM,OAAO,CAAC;YACf,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACR,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -32,6 +32,25 @@ export interface RendererConfig {
|
|
|
32
32
|
* republished without bumping the archive). Bounded to 64 chars.
|
|
33
33
|
*/
|
|
34
34
|
buildHash?: string;
|
|
35
|
+
/**
|
|
36
|
+
* When true, the SDK holds `uplim:ack` until the renderer explicitly
|
|
37
|
+
* calls `markReady()` from `useRendererClient()`. The host's loading
|
|
38
|
+
* overlay stays visible until that signal arrives, so the user
|
|
39
|
+
* never sees a blank canvas between bridge ack and the renderer's
|
|
40
|
+
* first paint.
|
|
41
|
+
*
|
|
42
|
+
* Leave unset (or `false`) for fast renderers where the gap is
|
|
43
|
+
* invisible — that's the right default and lowest-friction pattern
|
|
44
|
+
* (image, code, plain markdown). Set `true` when the renderer takes
|
|
45
|
+
* perceptible time to settle (large file fetch, video decode,
|
|
46
|
+
* multi-page paginate) and the blank-canvas flash is noticeable.
|
|
47
|
+
*
|
|
48
|
+
* The SDK auto-acks after 30s (configurable via
|
|
49
|
+
* `RendererClientOptions.readyTimeoutMs`) and logs a warning if
|
|
50
|
+
* `markReady()` never fires — so a forgotten signal can't trap
|
|
51
|
+
* users behind the overlay.
|
|
52
|
+
*/
|
|
53
|
+
deferReady?: boolean;
|
|
35
54
|
}
|
|
36
55
|
export type RendererPermission = 'createFolder' | 'openUpload';
|
|
37
56
|
/**
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,CAAC,CAAC;IACX,uDAAuD;IACvD,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,OAAO,CAAC,EAAE;QACT,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,cAAc,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;IACF;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,CAAC,CAAC;IACX,uDAAuD;IACvD,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,OAAO,CAAC,EAAE;QACT,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,cAAc,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;IACF;;;;;;;;;;OAUG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;;;;;OAOG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;;;;;;OAiBG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,kBAAkB,GAC3B,cAAc,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B,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;IACxB,mCAAmC;IACnC,UAAU,EAAE,WAAW,GAAG,QAAQ,CAAC;IACnC,+CAA+C;IAC/C,KAAK,EAAE,aAAa,CAAC;IACrB,4DAA4D;IAC5D,aAAa,EAAE,aAAa,CAAC;IAC7B,qCAAqC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,MAAM,EAAE,cAAc,CAAC;IACvB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -19,6 +19,16 @@ export interface RendererClientOptions {
|
|
|
19
19
|
* If omitted, all origins are accepted (suitable for local dev).
|
|
20
20
|
*/
|
|
21
21
|
targetOrigin?: string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* How long after init to wait for `signalReady()` before auto-acking
|
|
25
|
+
* anyway, in milliseconds. Only honored when the renderer's
|
|
26
|
+
* `config.json` has `deferReady: true`. Default 30000 (30s).
|
|
27
|
+
* Matches the host bridge's 10s init-timeout × ~3 — enough headroom
|
|
28
|
+
* for slow data fetches without leaving the user staring at a
|
|
29
|
+
* loading overlay indefinitely.
|
|
30
|
+
*/
|
|
31
|
+
readyTimeoutMs?: number;
|
|
22
32
|
}
|
|
23
33
|
|
|
24
34
|
type InitCallback = (payload: InitPayload) => void;
|
|
@@ -60,12 +70,21 @@ export class RendererClient {
|
|
|
60
70
|
private currentConfig: RendererConfig | null = null;
|
|
61
71
|
private currentTheme: 'light' | 'dark' = 'light';
|
|
62
72
|
private currentApiBaseUrl: string | null = null;
|
|
73
|
+
private currentEntrypoint: 'dashboard' | 'portal' | null = null;
|
|
63
74
|
private currentPath: string = '/';
|
|
75
|
+
private currentConnected = false;
|
|
64
76
|
|
|
65
77
|
private listener: ((event: MessageEvent) => void) | null = null;
|
|
66
78
|
private errorListener: ((event: ErrorEvent) => void) | null = null;
|
|
67
79
|
private rejectionListener: ((event: PromiseRejectionEvent) => void) | null = null;
|
|
68
80
|
private hashChangeListener: (() => void) | null = null;
|
|
81
|
+
// `signalReady` machinery — see `deferReady` in RendererClientOptions.
|
|
82
|
+
// `ackDeferred` is set at construction; `ackSent` flips when we
|
|
83
|
+
// actually post the ack so signalReady stays idempotent.
|
|
84
|
+
private ackDeferred = false;
|
|
85
|
+
private ackSent = false;
|
|
86
|
+
private readyTimeoutMs = 30_000;
|
|
87
|
+
private readyTimeoutHandle: ReturnType<typeof setTimeout> | null = null;
|
|
69
88
|
private readyRetryInterval: ReturnType<typeof setInterval> | null = null;
|
|
70
89
|
private readyRetryTimeout: ReturnType<typeof setTimeout> | null = null;
|
|
71
90
|
private historyPatched = false;
|
|
@@ -79,6 +98,13 @@ export class RendererClient {
|
|
|
79
98
|
|
|
80
99
|
constructor(options?: RendererClientOptions) {
|
|
81
100
|
this.targetOrigin = options?.targetOrigin ?? '*';
|
|
101
|
+
// `ackDeferred` is decided by config.json (read in handleInit)
|
|
102
|
+
// rather than the constructor — the SDK can't know which mode
|
|
103
|
+
// the renderer wants until init lands, but that's fine because
|
|
104
|
+
// the ack itself only fires after init anyway.
|
|
105
|
+
if (typeof options?.readyTimeoutMs === 'number' && options.readyTimeoutMs > 0) {
|
|
106
|
+
this.readyTimeoutMs = options.readyTimeoutMs;
|
|
107
|
+
}
|
|
82
108
|
this.setup();
|
|
83
109
|
}
|
|
84
110
|
|
|
@@ -212,6 +238,23 @@ export class RendererClient {
|
|
|
212
238
|
return this.currentPath;
|
|
213
239
|
}
|
|
214
240
|
|
|
241
|
+
/** Has the init message been processed? Late subscribers (e.g. a
|
|
242
|
+
* second `useRendererClient` mount after init landed) read this to
|
|
243
|
+
* seed their initial state without waiting for the next onInit. */
|
|
244
|
+
isConnected(): boolean {
|
|
245
|
+
return this.currentConnected;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/** Which HTML entrypoint was loaded (dashboard or portal). */
|
|
249
|
+
getEntrypoint(): 'dashboard' | 'portal' | null {
|
|
250
|
+
return this.currentEntrypoint;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** Base URL for upl.im API calls, as supplied by the host. */
|
|
254
|
+
getApiBaseUrl(): string | null {
|
|
255
|
+
return this.currentApiBaseUrl;
|
|
256
|
+
}
|
|
257
|
+
|
|
215
258
|
/**
|
|
216
259
|
* Returns an API adapter compatible with `getUploadClientWithEnv()` from `@xeonr/uploads-sdk`.
|
|
217
260
|
* Handles authentication and automatic token refresh via the host bridge.
|
|
@@ -250,6 +293,10 @@ export class RendererClient {
|
|
|
250
293
|
destroy(): void {
|
|
251
294
|
this.destroyed = true;
|
|
252
295
|
this.stopReadyRetry();
|
|
296
|
+
if (this.readyTimeoutHandle) {
|
|
297
|
+
clearTimeout(this.readyTimeoutHandle);
|
|
298
|
+
this.readyTimeoutHandle = null;
|
|
299
|
+
}
|
|
253
300
|
if (this.listener) {
|
|
254
301
|
window.removeEventListener('message', this.listener);
|
|
255
302
|
this.listener = null;
|
|
@@ -360,6 +407,8 @@ export class RendererClient {
|
|
|
360
407
|
this.currentConfig = payload.config;
|
|
361
408
|
this.currentTheme = payload.theme;
|
|
362
409
|
this.currentApiBaseUrl = payload.apiBaseUrl;
|
|
410
|
+
this.currentEntrypoint = payload.entrypoint;
|
|
411
|
+
this.currentConnected = true;
|
|
363
412
|
|
|
364
413
|
// Apply initial path from host URL fragment
|
|
365
414
|
if (payload.initialPath) {
|
|
@@ -378,7 +427,48 @@ export class RendererClient {
|
|
|
378
427
|
cb(payload);
|
|
379
428
|
}
|
|
380
429
|
|
|
381
|
-
//
|
|
430
|
+
// Ack semantics — driven by the renderer's config.json
|
|
431
|
+
// (`deferReady` field). Declaring it in config rather than as a
|
|
432
|
+
// constructor option keeps all renderer metadata in one place
|
|
433
|
+
// (alongside permissions / sandbox / connectHosts / buildHash)
|
|
434
|
+
// and avoids a code-vs-config-disagreement footgun.
|
|
435
|
+
this.ackDeferred = payload.config?.deferReady === true;
|
|
436
|
+
if (!this.ackDeferred) {
|
|
437
|
+
this.sendAck();
|
|
438
|
+
} else {
|
|
439
|
+
this.readyTimeoutHandle = setTimeout(() => {
|
|
440
|
+
if (this.destroyed || this.ackSent) return;
|
|
441
|
+
// Best-effort log so an operator can spot the late ack
|
|
442
|
+
// in dev tools; production console noise is acceptable
|
|
443
|
+
// here because this only fires when something is wrong.
|
|
444
|
+
console.warn(
|
|
445
|
+
'[uplim] signalReady() not called within ' +
|
|
446
|
+
this.readyTimeoutMs + 'ms — auto-acking so the host overlay can dismiss.',
|
|
447
|
+
);
|
|
448
|
+
this.sendAck();
|
|
449
|
+
}, this.readyTimeoutMs);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Post the deferred ack so the host overlay dismisses. No-op once
|
|
455
|
+
* the ack has been sent (the host-side bridge tolerates duplicates
|
|
456
|
+
* but we suppress them here for cleanliness). When `deferReady` was
|
|
457
|
+
* not set on construction this is also a no-op — the SDK already
|
|
458
|
+
* acked synchronously on init.
|
|
459
|
+
*/
|
|
460
|
+
signalReady(): void {
|
|
461
|
+
if (this.destroyed || this.ackSent || !this.ackDeferred) return;
|
|
462
|
+
this.sendAck();
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
private sendAck(): void {
|
|
466
|
+
if (this.ackSent) return;
|
|
467
|
+
this.ackSent = true;
|
|
468
|
+
if (this.readyTimeoutHandle) {
|
|
469
|
+
clearTimeout(this.readyTimeoutHandle);
|
|
470
|
+
this.readyTimeoutHandle = null;
|
|
471
|
+
}
|
|
382
472
|
this.postToHost({ type: 'uplim:ack' });
|
|
383
473
|
}
|
|
384
474
|
|
package/src/react/index.ts
CHANGED
|
@@ -2,3 +2,4 @@ export { useRendererClient } from './useRendererClient.js';
|
|
|
2
2
|
export type { UseRendererClientOptions, UseRendererClientResult } from './useRendererClient.js';
|
|
3
3
|
export { RendererErrorBoundary } from './RendererErrorBoundary.js';
|
|
4
4
|
export type { RendererErrorBoundaryProps } from './RendererErrorBoundary.js';
|
|
5
|
+
export { useReportFatalError } from './useReportFatalError.js';
|
|
@@ -1,10 +1,70 @@
|
|
|
1
|
-
import { useState,
|
|
1
|
+
import { useState, useEffect, useMemo } from 'react';
|
|
2
2
|
import { RendererClient } from '../client.js';
|
|
3
3
|
import type { RendererClientOptions } from '../client.js';
|
|
4
4
|
import type { RendererApiAdapter, RendererConfig, RendererScope, RenderingType, InitPayload } from '../types.js';
|
|
5
5
|
|
|
6
6
|
export interface UseRendererClientOptions extends RendererClientOptions {}
|
|
7
7
|
|
|
8
|
+
// One RendererClient per page. Multiple `useRendererClient()` calls
|
|
9
|
+
// (different components subscribing to the same state) all share the
|
|
10
|
+
// singleton — previously each call spawned its own client, which
|
|
11
|
+
// caused duplicate `window.error` / `unhandledrejection` listeners
|
|
12
|
+
// (so every crash got reported N times), duplicate `uplim:ready`
|
|
13
|
+
// pings, and state divergence between instances.
|
|
14
|
+
//
|
|
15
|
+
// Page lifetime: the iframe is full-reloaded for HMR / test, so the
|
|
16
|
+
// module-level singleton lives exactly as long as it should. SDK-level
|
|
17
|
+
// HMR (developer working on the SDK in monorepo, hot-replacing this
|
|
18
|
+
// module) is handled via `import.meta.hot.dispose` at the bottom of
|
|
19
|
+
// the file.
|
|
20
|
+
let sharedClient: RendererClient | null = null;
|
|
21
|
+
let sharedClientOptionsKey: string | null = null;
|
|
22
|
+
|
|
23
|
+
function optionsKey(options: UseRendererClientOptions | undefined): string {
|
|
24
|
+
if (!options) return '';
|
|
25
|
+
// Stable order so { a, b } and { b, a } produce the same key. Used
|
|
26
|
+
// only for the dev-mode mismatch warning — never for behavior.
|
|
27
|
+
const entries = Object.entries(options).sort(([a], [b]) => a.localeCompare(b));
|
|
28
|
+
return JSON.stringify(entries);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getSharedClient(options: UseRendererClientOptions | undefined): RendererClient {
|
|
32
|
+
if (sharedClient) {
|
|
33
|
+
const key = optionsKey(options);
|
|
34
|
+
// Best-effort dev nudge: if a later mount passes different
|
|
35
|
+
// options than the first one, those options are silently
|
|
36
|
+
// ignored. Only flag when keys differ AND the later caller
|
|
37
|
+
// passed non-empty options (passing nothing is the common
|
|
38
|
+
// case for downstream subscribers).
|
|
39
|
+
if (key && sharedClientOptionsKey !== null && key !== sharedClientOptionsKey) {
|
|
40
|
+
// eslint-disable-next-line no-console
|
|
41
|
+
console.warn(
|
|
42
|
+
'[uplim] useRendererClient called with different options after first call; ' +
|
|
43
|
+
'later options are ignored (the client is a per-page singleton).',
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
return sharedClient;
|
|
47
|
+
}
|
|
48
|
+
sharedClient = new RendererClient(options);
|
|
49
|
+
sharedClientOptionsKey = optionsKey(options);
|
|
50
|
+
return sharedClient;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// SDK-dev HMR cleanup: when this module is hot-replaced (e.g. someone
|
|
54
|
+
// editing the SDK with the renderer harness running), detach the old
|
|
55
|
+
// client's listeners before the new module evaluates. Prod / non-HMR
|
|
56
|
+
// builds skip the entire block — `import.meta.hot` is undefined.
|
|
57
|
+
const maybeHot = (import.meta as ImportMeta & { hot?: { dispose: (cb: () => void) => void } }).hot;
|
|
58
|
+
if (maybeHot) {
|
|
59
|
+
maybeHot.dispose(() => {
|
|
60
|
+
if (sharedClient) {
|
|
61
|
+
sharedClient.destroy();
|
|
62
|
+
sharedClient = null;
|
|
63
|
+
sharedClientOptionsKey = null;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
8
68
|
/**
|
|
9
69
|
* Apply the host's theme to the renderer document. Two distinct effects:
|
|
10
70
|
*
|
|
@@ -54,6 +114,15 @@ export interface UseRendererClientResult {
|
|
|
54
114
|
requestToken: () => void;
|
|
55
115
|
/** Request the host to close this renderer (modal mode). */
|
|
56
116
|
close: () => void;
|
|
117
|
+
/**
|
|
118
|
+
* When the renderer's `config.json` has `deferReady: true`, call
|
|
119
|
+
* this once the renderer's data is loaded and the UI is ready to
|
|
120
|
+
* be visible. The host overlay stays up until this fires (or until
|
|
121
|
+
* the SDK's safety timeout elapses — see
|
|
122
|
+
* `RendererClientOptions.readyTimeoutMs`). No-op when `deferReady`
|
|
123
|
+
* isn't set in config.
|
|
124
|
+
*/
|
|
125
|
+
markReady: () => void;
|
|
57
126
|
|
|
58
127
|
/** The underlying RendererClient instance for advanced use. */
|
|
59
128
|
client: RendererClient;
|
|
@@ -82,25 +151,23 @@ export interface UseRendererClientResult {
|
|
|
82
151
|
* ```
|
|
83
152
|
*/
|
|
84
153
|
export function useRendererClient(options?: UseRendererClientOptions): UseRendererClientResult {
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
//
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
const [
|
|
95
|
-
const [
|
|
96
|
-
const [
|
|
97
|
-
const [
|
|
98
|
-
const [
|
|
99
|
-
const [
|
|
100
|
-
const [
|
|
101
|
-
const [
|
|
102
|
-
const [apiBaseUrl, setApiBaseUrl] = useState<string | null>(null);
|
|
103
|
-
const [path, setPath] = useState<string>('/');
|
|
154
|
+
const client = getSharedClient(options);
|
|
155
|
+
|
|
156
|
+
// Initial state read directly from the client — handles late
|
|
157
|
+
// subscribers (a second `useRendererClient` mount that happens
|
|
158
|
+
// after init has already fired). Without this, the late mount
|
|
159
|
+
// would sit at `connected: false` forever because onInit only
|
|
160
|
+
// fires for NEW init events, not for already-received state.
|
|
161
|
+
const [connected, setConnected] = useState<boolean>(() => client.isConnected());
|
|
162
|
+
const [scope, setScope] = useState<RendererScope | null>(() => client.getScope());
|
|
163
|
+
const [renderingType, setRenderingType] = useState<RenderingType | null>(() => client.getRenderingType());
|
|
164
|
+
const [token, setToken] = useState<string | null>(() => client.getToken());
|
|
165
|
+
const [tokenExpiresAt, setTokenExpiresAt] = useState<number | null>(() => client.getTokenExpiresAt());
|
|
166
|
+
const [theme, setTheme] = useState<'light' | 'dark'>(() => client.getTheme());
|
|
167
|
+
const [config, setConfig] = useState<RendererConfig | null>(() => client.getConfig());
|
|
168
|
+
const [entrypoint, setEntrypoint] = useState<'dashboard' | 'portal' | null>(() => client.getEntrypoint());
|
|
169
|
+
const [apiBaseUrl, setApiBaseUrl] = useState<string | null>(() => client.getApiBaseUrl());
|
|
170
|
+
const [path, setPath] = useState<string>(() => client.getPath());
|
|
104
171
|
|
|
105
172
|
useEffect(() => {
|
|
106
173
|
const unsubInit = client.onInit((payload: InitPayload) => {
|
|
@@ -136,7 +203,13 @@ export function useRendererClient(options?: UseRendererClientOptions): UseRender
|
|
|
136
203
|
unsubTheme();
|
|
137
204
|
unsubToken();
|
|
138
205
|
unsubNavigate();
|
|
139
|
-
|
|
206
|
+
// NB: do NOT destroy() here — the client is a per-page
|
|
207
|
+
// singleton, not a per-component instance. Component
|
|
208
|
+
// unmounts (route changes / strict-mode double-mount /
|
|
209
|
+
// React render-time tearing) shouldn't kill the shared
|
|
210
|
+
// state. The iframe full-reload tears the singleton down
|
|
211
|
+
// implicitly when the page goes away; SDK-level HMR is
|
|
212
|
+
// handled by import.meta.hot.dispose at the top of file.
|
|
140
213
|
};
|
|
141
214
|
}, [client]);
|
|
142
215
|
|
|
@@ -144,6 +217,7 @@ export function useRendererClient(options?: UseRendererClientOptions): UseRender
|
|
|
144
217
|
openUpload: (uploadId: string) => client.openUpload(uploadId),
|
|
145
218
|
requestToken: () => client.requestToken(),
|
|
146
219
|
close: () => client.close(),
|
|
220
|
+
markReady: () => client.signalReady(),
|
|
147
221
|
apiAdapter: client.getApiAdapter(),
|
|
148
222
|
}), [client]);
|
|
149
223
|
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook for surfacing async failures to `<RendererErrorBoundary>` (and from
|
|
5
|
+
* there to the host's crash overlay + telemetry).
|
|
6
|
+
*
|
|
7
|
+
* Renderers shouldn't render their own "Upload not found" / "Failed to
|
|
8
|
+
* load" inline UI — those are still crashes from a telemetry standpoint,
|
|
9
|
+
* and the host already owns a polished overlay with reload + fallback
|
|
10
|
+
* actions. This hook lets a renderer take an error caught in an async
|
|
11
|
+
* context (fetch `.catch()`, useEffect cleanup, etc.) and route it to
|
|
12
|
+
* the host instead of rendering a half-broken inline state.
|
|
13
|
+
*
|
|
14
|
+
* Pattern:
|
|
15
|
+
*
|
|
16
|
+
* ```tsx
|
|
17
|
+
* const reportFatal = useReportFatalError();
|
|
18
|
+
* useEffect(() => {
|
|
19
|
+
* client.getUpload(...).catch(reportFatal);
|
|
20
|
+
* }, []);
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Mechanics: we keep an error in component state. When set, the *next*
|
|
24
|
+
* render throws it — React's error-handling pipeline catches the throw
|
|
25
|
+
* and bubbles to the nearest boundary. From there
|
|
26
|
+
* `RendererErrorBoundary.componentDidCatch` reports the crash to the
|
|
27
|
+
* host and renders nothing, and the host overlay (Reload / Copy /
|
|
28
|
+
* Fallback) takes over the visible iframe area.
|
|
29
|
+
*
|
|
30
|
+
* Why state-then-throw rather than a direct `throw err`? You can't
|
|
31
|
+
* throw to React from async code — React only sees throws that happen
|
|
32
|
+
* during render or in event handlers. Routing through state ensures
|
|
33
|
+
* the throw lands inside the render phase.
|
|
34
|
+
*
|
|
35
|
+
* The returned callback is stable across renders so it's safe to drop
|
|
36
|
+
* straight into a `.catch()`.
|
|
37
|
+
*/
|
|
38
|
+
export function useReportFatalError(): (err: unknown) => void {
|
|
39
|
+
// Generic state slot — we never read the value, only use the
|
|
40
|
+
// updater. We narrow to `never` so TypeScript stops us from
|
|
41
|
+
// accidentally using it as data anywhere.
|
|
42
|
+
const [, setState] = useState<never>();
|
|
43
|
+
return useCallback((err: unknown) => {
|
|
44
|
+
// Functional updater throws — React invokes it during the next
|
|
45
|
+
// render attempt, which puts the throw inside the render phase
|
|
46
|
+
// where boundaries can see it.
|
|
47
|
+
setState(() => {
|
|
48
|
+
if (err instanceof Error) {
|
|
49
|
+
throw err;
|
|
50
|
+
}
|
|
51
|
+
// Wrap non-Error throws so the boundary always sees a real
|
|
52
|
+
// Error instance with a meaningful .name / .message. Without
|
|
53
|
+
// this, `client.reportCrash` would synthesise a generic
|
|
54
|
+
// 'UnknownError' which loses the original payload's shape.
|
|
55
|
+
if (typeof err === 'string') {
|
|
56
|
+
throw new Error(err);
|
|
57
|
+
}
|
|
58
|
+
if (err && typeof err === 'object' && 'message' in err && typeof err.message === 'string') {
|
|
59
|
+
const wrapped = new Error(err.message);
|
|
60
|
+
if ('name' in err && typeof err.name === 'string') {
|
|
61
|
+
wrapped.name = err.name;
|
|
62
|
+
}
|
|
63
|
+
if ('stack' in err && typeof err.stack === 'string') {
|
|
64
|
+
wrapped.stack = err.stack;
|
|
65
|
+
}
|
|
66
|
+
throw wrapped;
|
|
67
|
+
}
|
|
68
|
+
throw new Error('Unknown renderer error');
|
|
69
|
+
});
|
|
70
|
+
}, []);
|
|
71
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -32,6 +32,25 @@ export interface RendererConfig {
|
|
|
32
32
|
* republished without bumping the archive). Bounded to 64 chars.
|
|
33
33
|
*/
|
|
34
34
|
buildHash?: string;
|
|
35
|
+
/**
|
|
36
|
+
* When true, the SDK holds `uplim:ack` until the renderer explicitly
|
|
37
|
+
* calls `markReady()` from `useRendererClient()`. The host's loading
|
|
38
|
+
* overlay stays visible until that signal arrives, so the user
|
|
39
|
+
* never sees a blank canvas between bridge ack and the renderer's
|
|
40
|
+
* first paint.
|
|
41
|
+
*
|
|
42
|
+
* Leave unset (or `false`) for fast renderers where the gap is
|
|
43
|
+
* invisible — that's the right default and lowest-friction pattern
|
|
44
|
+
* (image, code, plain markdown). Set `true` when the renderer takes
|
|
45
|
+
* perceptible time to settle (large file fetch, video decode,
|
|
46
|
+
* multi-page paginate) and the blank-canvas flash is noticeable.
|
|
47
|
+
*
|
|
48
|
+
* The SDK auto-acks after 30s (configurable via
|
|
49
|
+
* `RendererClientOptions.readyTimeoutMs`) and logs a warning if
|
|
50
|
+
* `markReady()` never fires — so a forgotten signal can't trap
|
|
51
|
+
* users behind the overlay.
|
|
52
|
+
*/
|
|
53
|
+
deferReady?: boolean;
|
|
35
54
|
}
|
|
36
55
|
|
|
37
56
|
export type RendererPermission =
|