Problem/Motivation

The polyfills in Olivero, located in polyfills.es6.js should be removed/replaced

  • JS that requires the NodeList.forEach() polyfill should use the core library instead: core/drupal.nodelist.foreach
  • The Element.matches polyfill should be moved to a new core library core/drupal.element.matches so all Core JS can use it. Reference core/misc/polyfills/nodelist.foreach.es6.js to see the preferred way to format the docs.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#2 3190268.patch2.51 KBmherchel

Comments

bnjmnm created an issue. See original summary.

mherchel’s picture

Status: Active » Needs review
StatusFileSize
new2.51 KB

Patch attached.

nod_’s picture

Status: Needs review » Reviewed & tested by the community

That works.

gauravvvv’s picture

This patch successfully removed the js/polyfills.js file and removed it from libraries.yml file and added the dependencies.
RTBC +1

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed fcbdb7b and pushed to 9.2.x. Thanks!

  • catch committed f407fad on 9.2.x
    Issue #3190268 by mherchel, bnjmnm: Move/remove JavaScript polyfills
    
catch’s picture

Just to note I was a bit confused here, because it says the polyfill could be moved to an 'element.matches' core library - but that library already exists. So the patch is fine it's just the issue summary was either out of date or didn't acknowledge that library already existing.

nod_’s picture

polyfill was added by the once library, it didn't exist at the time of issue creation

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.