Replies: 3 comments 2 replies
-
I find it concerning that there are many polyfills missing in nextJs, when it is claimed that:
https://nextjs.org/docs/basic-features/supported-browsers-features I also want to question that adding polyfills to
So from my understanding, all browsers that are more modern than Edge 16, Firefox 60, Chrome 61, Safari 10.1 would only get the polyfills from
I've stumbled upon this because one of our users was using Safari 15.1, where So, I'm really confused by this behaviour and I hope that I am missing something obvious, because adding more polyfills to |
Beta Was this translation helpful? Give feedback.
-
+1 landed here after realizing |
Beta Was this translation helpful? Give feedback.
-
For // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- Polyfill for older browsers eg. Safari 15.1
if (typeof window !== 'undefined' && !Array.prototype.findLastIndex) {
// eslint-disable-next-line no-extend-native -- Polyfill for older browsers eg. Safari 15.1
Array.prototype.findLastIndex = function (callback, thisArg) {
for (let index = this.length - 1; index >= 0; index--) {
if (callback.call(thisArg, this[index], index, this)) return index;
}
return -1;
};
} If you need ES3 compatibility for ancient browsers or other environments, @ljharb created a polyfill |
Beta Was this translation helpful? Give feedback.
-
Goals
findLast
andfindLastIndex
.Non-Goals
No response
Background
We used
findLastIndex
in our code and came across in production that some mobile phones doesn't support this feature. Polyfill.io doesn't contain it as well.Proposal
I want to do the following:
Beta Was this translation helpful? Give feedback.
All reactions