-
Are the minimum required browser versions documented somewhere? I am getting Sentry errors from this Valibot code, because
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi @mrankine! I'm Dosu and I’m helping the valibot team. Valibot does not currently document minimum supported browser versions or provide guidance on polyfills for Object.hasOwn. The codebase uses Object.hasOwn directly, which is only available in browsers that support ECMAScript 2022 and newer. If you need to support older browsers, you will need to add a polyfill for Object.hasOwn yourself. The maintainer's general stance is to rely on modern JavaScript features and expect users to manage polyfills or upgrade their environments as needed. There are plans to improve documentation around runtime requirements in the future, but nothing is published yet citation. For a polyfill, you can use: if (!Object.hasOwn) {
Object.hasOwn = function(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
};
} This will ensure compatibility in environments where Object.hasOwn is not available. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Hi @mrankine! I'm Dosu and I’m helping the valibot team.
Valibot does not currently document minimum supported browser versions or provide guidance on polyfills for Object.hasOwn. The codebase uses Object.hasOwn directly, which is only available in browsers that support ECMAScript 2022 and newer. If you need to support older browsers, you will need to add a polyfill for Object.hasOwn yourself. The maintainer's general stance is to rely on modern JavaScript features and expect users to manage polyfills or upgrade their environments as needed. There are plans to improve documentation around runtime requirements in the future, but nothing is published yet citation.
For a polyfill, you can use: