Problem/Motivation

As part of #3067216: [meta] Deprecate (in 8.8) and remove (in 9.0) polyfills that are no longer needed the matchMedia asset library was marked deprecated in 8.8.
see: #3086369: Deprecate matchMedia
All files and usage of matchMedia should be removed in Drupal 9.

Proposed resolution

Remove matchMedia from 9.0.x
Existing change record: matchMedia is deprecated

Remaining tasks

  1. Post patch removing matchMedia

User interface changes

None

API changes

Data model changes

Release notes snippet

Included in the release notes for #3089469: Remove html5shiv in Drupal 9 - intentionally not copied here to avoid duplication-confusion.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zrpnr created an issue. See original summary.

zrpnr’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
6.56 KB

Removed matchmedia files and core asset libraries in ckeditor, toolbar, seven and claro.
Removed deprecation messages in DeprecationListenerTrait
Updated IS to point to existing CR.

bnjmnm’s picture

Issue summary: View changes
Status: Needs review » Needs work

Looks like "matchMedia" can be removed from the "globals": property in the eslint configs.

To err on the side of caution and to ease the workload of potential future reviewers: I looked a bit further into the warning that can be found at https://caniuse.com/#feat=matchmedia, which states

MediaQueryList.addEventListener doesn't work in Safari and IE

I confirmed that MediaQueryList.addEventListener was not part of the functionality covered by the matchMedia polyfill, so removing it will not impact IE11/Safari in any way. In those browsers, MediaQueryList.addEventListener did not work regardless of the polyfill's presence.

zrpnr’s picture

Status: Needs work » Needs review
FileSize
6.87 KB
250 bytes

I confirmed that MediaQueryList.addEventListener was not part of the functionality covered by the matchMedia polyfill, so removing it will not impact IE11/Safari in any way.

Thanks for doing this additional due diligence @bnjmnm!
I removed the global matchMedia from the .eslintrc file.

bnjmnm’s picture

Status: Needs review » Reviewed & tested by the community

#4 takes care of everything I could spot, RTBC.

nod_’s picture

Gábor Hojtsy’s picture

Fix credits.

Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Sitting in person with @nod, who reviewed and nodded that this looked right.

  • Gábor Hojtsy committed bb8122c on 9.0.x
    Issue #3089472 by zrpnr, nod_, bnjmnm: Remove matchmedia in Drupal 9
    
Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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