@hyperframes/core 0.9.15 → 0.9.16

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.
@@ -2,4 +2,10 @@
2
2
  export declare function recordStartupError(error: unknown): void;
3
3
  /** Starts the warning for a scene callback that threw; the render log shows it once per render. */
4
4
  export declare const SCENE_CALLBACK_ERROR_PREFIX = "[hyperframes] scene timeline callback threw:";
5
+ /**
6
+ * A rejected `window.__hf.buildReady[key]` is the composition saying its own setup failed, so
7
+ * readiness waits (render, snapshot, check) fail with the key and reason instead of capturing an
8
+ * unbuilt scene. Returns the recorded message so a teardown can clear exactly this error.
9
+ */
10
+ export declare function recordBuildReadyRejection(key: string, error: unknown): string;
5
11
  export declare function swallow(label: string, error?: unknown): void;
@@ -50,6 +50,25 @@ export function recordStartupError(error) {
50
50
  }
51
51
  /** Starts the warning for a scene callback that threw; the render log shows it once per render. */
52
52
  export const SCENE_CALLBACK_ERROR_PREFIX = "[hyperframes] scene timeline callback threw:";
53
+ /**
54
+ * A rejected `window.__hf.buildReady[key]` is the composition saying its own setup failed, so
55
+ * readiness waits (render, snapshot, check) fail with the key and reason instead of capturing an
56
+ * unbuilt scene. Returns the recorded message so a teardown can clear exactly this error.
57
+ */
58
+ export function recordBuildReadyRejection(key, error) {
59
+ let detail = "unknown error";
60
+ try {
61
+ detail = error instanceof Error ? `${error.name}: ${error.message}` : String(error);
62
+ }
63
+ catch (err) {
64
+ swallow("runtime.buildReadyRejection", err);
65
+ }
66
+ const message = `window.__hf.buildReady[${JSON.stringify(key)}] rejected: ${detail}. ` +
67
+ `The composition reported that its own setup failed, so it cannot be rendered. Fix that ` +
68
+ `setup, or resolve the promise only once the scene is drawable.`;
69
+ window.__hfStartupError = message;
70
+ return message;
71
+ }
53
72
  export function swallow(label, error) {
54
73
  if (typeof window === "undefined")
55
74
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/core",
3
- "version": "0.9.15",
3
+ "version": "0.9.16",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -437,9 +437,9 @@
437
437
  "linkedom": "^0.18.12",
438
438
  "postcss": "^8.5.8",
439
439
  "wawoff2": "^2.0.1",
440
- "@hyperframes/lint": "0.9.15",
441
- "@hyperframes/parsers": "0.9.15",
442
- "@hyperframes/studio-server": "0.9.15"
440
+ "@hyperframes/lint": "0.9.16",
441
+ "@hyperframes/parsers": "0.9.16",
442
+ "@hyperframes/studio-server": "0.9.16"
443
443
  },
444
444
  "devDependencies": {
445
445
  "@fontsource/archivo-black": "^5.2.8",