@rive-app/webgl-single 2.23.1 → 2.23.2
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/package.json +1 -1
- package/rive.d.ts +1 -0
- package/rive.js +34 -6
- package/rive.js.map +1 -1
- package/rive_advanced.mjs.d.ts +2 -2
package/package.json
CHANGED
package/rive.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ export declare class RuntimeLoader {
|
|
|
73
73
|
static getInstance(callback: RuntimeCallback): void;
|
|
74
74
|
static awaitInstance(): Promise<rc.RiveCanvas>;
|
|
75
75
|
static setWasmUrl(url: string): void;
|
|
76
|
+
static getWasmUrl(): string;
|
|
76
77
|
}
|
|
77
78
|
export declare enum StateMachineInputType {
|
|
78
79
|
Number = 56,
|
package/rive.js
CHANGED
|
@@ -4050,7 +4050,7 @@ Ge();
|
|
|
4050
4050
|
/* 2 */
|
|
4051
4051
|
/***/ ((module) => {
|
|
4052
4052
|
|
|
4053
|
-
module.exports = JSON.parse('{"name":"@rive-app/webgl-single","version":"2.23.
|
|
4053
|
+
module.exports = JSON.parse('{"name":"@rive-app/webgl-single","version":"2.23.2","description":"Rive\'s webgl based web api with bundled wasm.","main":"rive.js","homepage":"https://rive.app","repository":{"type":"git","url":"https://github.com/rive-app/rive-wasm/tree/master/js"},"keywords":["rive","animation"],"author":"Rive","contributors":["Luigi Rosso <luigi@rive.app> (https://rive.app)","Maxwell Talbot <max@rive.app> (https://rive.app)","Arthur Vivian <arthur@rive.app> (https://rive.app)","Umberto Sonnino <umberto@rive.app> (https://rive.app)","Matthew Sullivan <matt.j.sullivan@gmail.com> (mailto:matt.j.sullivan@gmail.com)"],"license":"MIT","files":["rive.js","rive.js.map","rive.d.ts","rive_advanced.mjs.d.ts"],"typings":"rive.d.ts","dependencies":{},"browser":{"fs":false,"path":false}}');
|
|
4054
4054
|
|
|
4055
4055
|
/***/ }),
|
|
4056
4056
|
/* 3 */
|
|
@@ -4715,20 +4715,44 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
4715
4715
|
(_a = RuntimeLoader.callBackQueue.shift()) === null || _a === void 0 ? void 0 : _a(RuntimeLoader.runtime);
|
|
4716
4716
|
}
|
|
4717
4717
|
})
|
|
4718
|
-
.catch(function () {
|
|
4718
|
+
.catch(function (error) {
|
|
4719
|
+
// Capture specific error details
|
|
4720
|
+
var errorDetails = {
|
|
4721
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || "Unknown error",
|
|
4722
|
+
type: (error === null || error === void 0 ? void 0 : error.name) || "Error",
|
|
4723
|
+
// Some browsers may provide additional WebAssembly-specific details
|
|
4724
|
+
wasmError: error instanceof WebAssembly.CompileError ||
|
|
4725
|
+
error instanceof WebAssembly.RuntimeError,
|
|
4726
|
+
originalError: error,
|
|
4727
|
+
};
|
|
4728
|
+
// Log detailed error for debugging
|
|
4729
|
+
console.debug("Rive WASM load error details:", errorDetails);
|
|
4719
4730
|
// In case unpkg fails, or the wasm was not supported, we try to load the fallback module from jsdelivr.
|
|
4720
4731
|
// This `rive_fallback.wasm` is compiled to support older architecture.
|
|
4721
4732
|
// TODO: (Gordon): preemptively test browser support and load the correct wasm file. Then use jsdelvr only if unpkg fails.
|
|
4722
4733
|
var backupJsdelivrUrl = "https://cdn.jsdelivr.net/npm/".concat(package_json__WEBPACK_IMPORTED_MODULE_1__.name, "@").concat(package_json__WEBPACK_IMPORTED_MODULE_1__.version, "/rive_fallback.wasm");
|
|
4723
4734
|
if (RuntimeLoader.wasmURL.toLowerCase() !== backupJsdelivrUrl) {
|
|
4724
|
-
console.warn("Failed to load WASM from ".concat(RuntimeLoader.wasmURL, ", trying jsdelivr as a backup"));
|
|
4735
|
+
console.warn("Failed to load WASM from ".concat(RuntimeLoader.wasmURL, " (").concat(errorDetails.message, "), trying jsdelivr as a backup"));
|
|
4725
4736
|
RuntimeLoader.setWasmUrl(backupJsdelivrUrl);
|
|
4726
4737
|
RuntimeLoader.loadRuntime();
|
|
4727
4738
|
}
|
|
4728
4739
|
else {
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
|
|
4740
|
+
var errorMessage = [
|
|
4741
|
+
"Could not load Rive WASM file from ".concat(RuntimeLoader.wasmURL, " or ").concat(backupJsdelivrUrl, "."),
|
|
4742
|
+
"Possible reasons:",
|
|
4743
|
+
"- Network connection is down",
|
|
4744
|
+
"- WebAssembly is not supported in this environment",
|
|
4745
|
+
"- The WASM file is corrupted or incompatible",
|
|
4746
|
+
"\nError details:",
|
|
4747
|
+
"- Type: ".concat(errorDetails.type),
|
|
4748
|
+
"- Message: ".concat(errorDetails.message),
|
|
4749
|
+
"- WebAssembly-specific error: ".concat(errorDetails.wasmError),
|
|
4750
|
+
"\nTo resolve, you may need to:",
|
|
4751
|
+
"1. Check your network connection",
|
|
4752
|
+
"2. Set a new WASM source via RuntimeLoader.setWasmUrl()",
|
|
4753
|
+
"3. Call RuntimeLoader.loadRuntime() again",
|
|
4754
|
+
].join("\n");
|
|
4755
|
+
console.error(errorMessage);
|
|
4732
4756
|
}
|
|
4733
4757
|
});
|
|
4734
4758
|
};
|
|
@@ -4756,6 +4780,10 @@ var RuntimeLoader = /** @class */ (function () {
|
|
|
4756
4780
|
RuntimeLoader.setWasmUrl = function (url) {
|
|
4757
4781
|
RuntimeLoader.wasmURL = url;
|
|
4758
4782
|
};
|
|
4783
|
+
// Gets the current wasm url
|
|
4784
|
+
RuntimeLoader.getWasmUrl = function () {
|
|
4785
|
+
return RuntimeLoader.wasmURL;
|
|
4786
|
+
};
|
|
4759
4787
|
// Flag to indicate that loading has started/completed
|
|
4760
4788
|
RuntimeLoader.isLoading = false;
|
|
4761
4789
|
// List of callbacks for the runtime that come in while loading
|