Problem/Motivation

A polyfill for Array.includes() is needed for Internet Explorer 11 and Opera Mini.

This is one of the three polyfills from #3076171: Provide a new library to replace jQuery UI autocomplete and we are now addressing each in their own issue.

Note: While it is currently a nice-to-have, it will be necessary for the new Autocomplete issue #3076171: Provide a new library to replace jQuery UI autocomplete to land as it includes a library that uses a non-polyfilled Array.includes. It's also a nice way to phase out the indexOf hack, which won't be necessary in Drupal 10 since IE11 won't be supported.

Issue fork drupal-3239500

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hooroomoo created an issue. See original summary.

hooroomoo’s picture

Issue summary: View changes

hooroomoo’s picture

Issue summary: View changes
hooroomoo’s picture

StatusFileSize
new5.28 MB

Usage of polyfill with messages feature in Olivero

hooroomoo’s picture

Status: Active » Needs review
bnjmnm’s picture

Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs change record

This needs a change record and two small bits of feedback addressed, but otherwise looking good!

hooroomoo’s picture

StatusFileSize
new1.39 MB

Updated with 2 usages of polyfill in messages feature in Olivero

hooroomoo’s picture

Issue tags: -Needs change record

Added change record

hooroomoo’s picture

Status: Needs work » Needs review
bnjmnm’s picture

Status: Needs review » Reviewed & tested by the community

#5 includes an example of the polyfill working, the CR and add-to-somehwere (Olivero) implementation look good, and it follows the familiar pattern of polyfills based on MDN snippets added to core.

lauriii’s picture

Status: Reviewed & tested by the community » Needs review
bnjmnm’s picture

Version: 9.3.x-dev » 9.4.x-dev
bnjmnm’s picture

Status: Needs review » Reviewed & tested by the community

Bringing back the RTBC first applied in #11, but addressing @lauriii's feedback from the MR:

The polyfill here seems slightly different from what is behind this link. Was there some reason the code needed to be changed?

The @see link now points to a polyfill that matches the one in use - the only differences are changes to pass eslint that have no functionality differences. The polyfill itself continues to be the one that was manually reviewed in this issue, and still looks like it works well.

  • catch committed b615dbd on 10.0.x
    Issue #3239500 by hooroomoo, bnjmnm, lauriii: Add Array.includes...

  • catch committed f5a452b on 9.4.x
    Issue #3239500 by hooroomoo, bnjmnm, lauriii: Add Array.includes...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 10.0.x and cherry-picked to 9.4.x, thanks!

I'm leaving this in 9.4.x for now, but if we wanted to get autocomplete into 9.3.x as experimental I think we could backport these then.

Status: Fixed » Closed (fixed)

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

quietone’s picture

Published change record.