You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IMO, it should not be fixed at the package level because it means package developers need to not use latest ECMAScript features in order to maximize compatibility. But these features turn out to be very handy and efficient (in this case, more efficient than converting to an array and then reducing)
Instead, it should be the responsibility of integrators to make sure used packages are compatible with the runtime environment. In the case of browsers, this is possible thanks to polyfills: https://github.com/zloirock/core-js
see here:
https://github.com/morpho-org/sdks/blob/main/packages/blue-sdk/src/vault/Vault.ts#L263-L287
https://github.com/morpho-org/sdks/blob/main/packages/blue-sdk/src/vault/Vault.ts#L305-L319
where
Iterator.prototype.reduce
(values().reduce
) is being called.this is actually not implemented in all browsers yet:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/reduce
importantly, it is not implemented in both safari and firefox esr (128)
it would probably be good to implement the sdks without Iterator.prototype.reduce to maximize compatibility.
The text was updated successfully, but these errors were encountered: