Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The polyfill added in #1077878: Add HTML5shiv to core is no longer needed by any of the browsers supported by Drupal core.
Proposed resolution
Remove the usage of html5shiv in core and mark the asset library deprecated in core.libraries.yml.
Alternatively, just mark the html5shiv asset library deprecated and continue the work in #1993334: Add HTML5shiv to Stable and Classy only
Remaining tasks
- Decide on approach
- Write patch
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#7 | interdiff_2-7.txt | 7.37 KB | zrpnr |
#7 | 3086379-7.patch | 1.52 KB | zrpnr |
#2 | 3086379-2.patch | 7.71 KB | zrpnr |
Comments
Comment #2
zrpnrThis patch marks html5shiv deprecated and removes it from core. The deprecation message points to the draft change record.
It's similar to the work in #1993334: Add HTML5shiv to Stable and Classy only but without adding anything to core themes, as well as some changes to the
AjaxPageStateTest
. I chose different libraries to test for sincedomready
should be removed in #3086375: Deprecate domready and remove usages in core.The assertions there are also updated to not use deprecated methods and I moved the non-functional second arguments to inline comments.
Comment #4
zrpnrI added a contrib module to replace this library, on recommendation from @xjm and @lauriii
https://www.drupal.org/project/html5shiv
This adds the exact library that is removed from core in this patch for any sites that still need it.
Comment #5
johnwebdev CreditAttribution: johnwebdev commentedAnything blocking there to be released as stable?
It would be nice to see the change record updated, pointing to the contrib and some simple instructions what you need to do.
Code looks good!
Comment #6
lauriiiThe module looks good. Let's release a stable version of that 👏
Comment #7
zrpnrI just was hoping to have some other eyes on it before I made a release. Thanks for reviewing!
I'll update the CR to point to the contrib module as well.
After talking with @lauriii again here is a new patch which leaves html5shiv in place in core but simply marks the library deprecated and suppresses the warning. Then it can be more safely removed in 9.
Comment #8
lauriiiReviewed code in the module and tested it manually. There are some very unlikely edge cases where the module might not work as expected, most notably if someone is not rendering the html render element but they depended on the core/html5shiv library, they wouldn't get the polyfill at all. However, given how unlikely that would be, I'd just keep the code as it is.
The patch looks good as well and will remove the usages of the deprecated library in Drupal 9. 🚢
Comment #9
xjmComment #13
xjmCommitted and pushed to 9.0.x, 8.9.x, and 8.8.x. Thanks!
Comment #14
xjmPublished the CR.