@luma.gl/engine 9.4.0-beta.7 → 9.4.1
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/animation-loop/animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/animation-loop.js +19 -6
- package/dist/animation-loop/animation-loop.js.map +1 -1
- package/dist/animation-loop/make-animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/make-animation-loop.js +3 -1
- package/dist/animation-loop/make-animation-loop.js.map +1 -1
- package/dist/dist.dev.js +19 -7
- package/dist/dist.min.js +4 -4
- package/dist/index.cjs +19 -7
- package/dist/index.cjs.map +1 -1
- package/package.json +4 -4
- package/src/animation-loop/animation-loop.ts +20 -7
- package/src/animation-loop/make-animation-loop.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@luma.gl/engine",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.1",
|
|
4
4
|
"description": "3D Engine Components for luma.gl",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"prepublishOnly": "npm run build-minified-bundle && npm run build-dev-bundle"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@luma.gl/core": "~9.4.0
|
|
44
|
-
"@luma.gl/shadertools": "~9.4.0
|
|
43
|
+
"@luma.gl/core": "~9.4.0",
|
|
44
|
+
"@luma.gl/shadertools": "~9.4.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@math.gl/core": "^4.1.0",
|
|
@@ -49,5 +49,5 @@
|
|
|
49
49
|
"@probe.gl/log": "^4.1.1",
|
|
50
50
|
"@probe.gl/stats": "^4.1.1"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "4cc2344475ef7b1f2753e088f17fc2e6c5946ce7"
|
|
53
53
|
}
|
|
@@ -144,8 +144,15 @@ export class AnimationLoop {
|
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
reportError(error: Error): void {
|
|
147
|
-
this.props.onError(error);
|
|
148
147
|
this._error = error;
|
|
148
|
+
this.props.onError(error);
|
|
149
|
+
if (
|
|
150
|
+
this.props.onError === AnimationLoop.defaultAnimationLoopProps.onError &&
|
|
151
|
+
typeof window !== 'undefined' &&
|
|
152
|
+
typeof ErrorEvent !== 'undefined'
|
|
153
|
+
) {
|
|
154
|
+
window.dispatchEvent(new ErrorEvent('error', {error, message: error.message}));
|
|
155
|
+
}
|
|
149
156
|
}
|
|
150
157
|
|
|
151
158
|
/** Flags this animation loop as needing redraw */
|
|
@@ -228,17 +235,17 @@ export class AnimationLoop {
|
|
|
228
235
|
stop() {
|
|
229
236
|
// console.debug(`Stopping ${this.constructor.name}`);
|
|
230
237
|
if (this._running) {
|
|
238
|
+
const animationProps = this.animationProps;
|
|
231
239
|
// call callback
|
|
232
240
|
// If stop is called immediately, we can end up in a state where props haven't been initialized...
|
|
233
|
-
if (this.animationProps && !this._error) {
|
|
234
|
-
this.props.onFinalize(this.animationProps);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
241
|
this._cancelAnimationFrame();
|
|
238
242
|
this._nextFramePromise = null;
|
|
239
243
|
this._resolveNextFrame = null;
|
|
240
244
|
this._running = false;
|
|
241
245
|
this._lastFrameTime = 0;
|
|
246
|
+
if (animationProps) {
|
|
247
|
+
this.props.onFinalize(animationProps);
|
|
248
|
+
}
|
|
242
249
|
}
|
|
243
250
|
return this;
|
|
244
251
|
}
|
|
@@ -358,8 +365,14 @@ export class AnimationLoop {
|
|
|
358
365
|
if (!this._running) {
|
|
359
366
|
return;
|
|
360
367
|
}
|
|
361
|
-
|
|
362
|
-
|
|
368
|
+
try {
|
|
369
|
+
this.redraw(time, animationFrame ?? null);
|
|
370
|
+
this._requestAnimationFrame();
|
|
371
|
+
} catch (error) {
|
|
372
|
+
const renderError = error instanceof Error ? error : new Error(String(error));
|
|
373
|
+
this.reportError(renderError);
|
|
374
|
+
this.stop();
|
|
375
|
+
}
|
|
363
376
|
}
|
|
364
377
|
|
|
365
378
|
// Called on each frame, can be overridden to call onRender multiple times
|
|
@@ -62,7 +62,9 @@ export function makeAnimationLoop(
|
|
|
62
62
|
// biome-ignore lint/suspicious/noConsole: fallback logging before rendering the in-canvas error banner.
|
|
63
63
|
console.error(error);
|
|
64
64
|
renderLoop = null;
|
|
65
|
-
|
|
65
|
+
const initializationError = error instanceof Error ? error : new Error(String(error));
|
|
66
|
+
setError(animationProps.animationLoop.device, initializationError);
|
|
67
|
+
animationProps.animationLoop.reportError(initializationError);
|
|
66
68
|
animationProps.animationLoop.stop();
|
|
67
69
|
return null;
|
|
68
70
|
}
|