-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove IE8-10 JavaScript polyfills, helpers, config #3570
Conversation
a955136
to
99c28cf
Compare
99c28cf
to
f63b6b8
Compare
f63b6b8
to
227b9aa
Compare
/** | ||
* TODO: Ideally this would be a NodeList.prototype.forEach polyfill | ||
* This seems to fail in IE8, requires more investigation. | ||
* See: https://github.com/imagitama/nodelist-foreach-polyfill | ||
* | ||
* @deprecated Will be made private in v5.0 | ||
* @template {Node} ElementType | ||
* @param {NodeListOf<ElementType>} nodes - NodeList from querySelectorAll() | ||
* @param {(value: ElementType, index: number, nodes: NodeListOf<ElementType>) => void} callback - Callback function to run for each node | ||
* @returns {void} | ||
*/ | ||
export function nodeListForEach (nodes, callback) { | ||
if (window.NodeList.prototype.forEach) { | ||
return nodes.forEach(callback) | ||
} | ||
for (var i = 0; i < nodes.length; i++) { | ||
callback.call(window, nodes[i], i, nodes) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/govuk-frontend/src/govuk/components/error-summary/error-summary.mjs
Show resolved
Hide resolved
227b9aa
to
90e040a
Compare
90e040a
to
0a96bad
Compare
@querkmachine I've rebased on top of #3559 to avoid Review app conditional comment conflicts etc Think we're looking good? |
@@ -41,7 +41,7 @@ module.exports = { | |||
extends: [ | |||
'plugin:@typescript-eslint/recommended', | |||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | |||
'plugin:es-x/restrict-to-es3' | |||
'plugin:es-x/restrict-to-es5' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can raise this even higher once IE11 is prevented from loading JS
https://eslint-community.github.io/eslint-plugin-es-x/#presets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't gone through it with the finest of combs, but what's here works and looks proper to me. On the off chance we missed anything, we have ample time to fix it up.
8586ba4
to
1593117
Compare
d736de5
to
6202660
Compare
0a96bad
to
f7948c3
Compare
6202660
to
78f4120
Compare
f7948c3
to
d2ca164
Compare
78f4120
to
9862a1e
Compare
Swaps the `addEventListener()` (IE8 only) example for `closest()`
d2ca164
to
1df7e0e
Compare
Remove IE8-10 JavaScript polyfills, helpers, config
This PR unblocks #3279 by removing Rollup
{ legacy: true }
so we can pick up:Similar to #3559 this PR also tackles IE8-10 JavaScript things:
nodeListForEach
helper function #3466