Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
- 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.
Comment | File | Size | Author |
---|---|---|---|
#6 | core-3089472-6.patch | 7.19 KB | nod_ |
#4 | interdiff_2-4.txt | 250 bytes | zrpnr |
#4 | 3089472-4.patch | 6.87 KB | zrpnr |
#2 | 3089472-2.patch | 6.56 KB | zrpnr |
Comments
Comment #2
zrpnrRemoved matchmedia files and core asset libraries in ckeditor, toolbar, seven and claro.
Removed deprecation messages in
DeprecationListenerTrait
Updated IS to point to existing CR.
Comment #3
bnjmnmLooks 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
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.Comment #4
zrpnrThanks for doing this additional due diligence @bnjmnm!
I removed the global matchMedia from the .eslintrc file.
Comment #5
bnjmnm#4 takes care of everything I could spot, RTBC.
Comment #6
nod_rerolled
Comment #7
Gábor HojtsyFix credits.
Comment #8
Gábor HojtsySitting in person with @nod, who reviewed and nodded that this looked right.
Comment #10
Gábor Hojtsy