Problem/Motivation

In #3263823: Empty out and deprecate drupal libraries which are related to Internet Explorer 11 polyfills in 10.0.x for removal in 11.0.0 we removed a bunch of IE11-only polyfills.

The only thing that remained are their definitions in core/core.libraries.yml.
Their sole reason for existence was to trigger a deprecation warning for removal in 11.0.0.

Proposed resolution

Since we can now diverge between 10.3 and up and 11.x, let's remove those deprecation triggers in this issue.

Original IS below

Postponed on #3263823: Empty out and deprecate drupal libraries which are related to Internet Explorer 11 polyfills in 10.0.x for removal in 11.0.0, these should be deprecated in 9.4.x before they are removed from 10.0.x

Problem/Motivation

Drupal 10 will drop support for Internet Explorer 11: #3155358: [policy, no patch] Drop IE11 support from Drupal 10.0.x. Drupal ship with number of polyfills to accommodate JScripts lack of modern features supported by other JavaScript engines.

Proposed resolution

Based on comments in the core/misc/polyfills files, it seems like all of the polyfills in that folder could be deleted. On top of that, we have couple of polyfills in package.json. From the package.json, we could remove following packages:

  • core/css.escape
  • core/drupal.array.find
  • core/drupal.nodelist.foreach
  • core/es6-promise
  • core/picturefill
  • core/drupal.element.closest
  • core/drupal.element.matches
  • core/drupal.string.includes
  • postcss-calc
  • #3272425: Remove Details Aria Polyfill - this is broken out because it needs extensive screen reader testing

Remaining tasks

Complete the issue where these libraries are deprecated in 9.4.x
👉 #3263823: Empty out and deprecate drupal libraries which are related to Internet Explorer 11 polyfills in 10.0.x for removal in 11.0.0

Simply remove these in 10.0.x. We confirmed there is no error if a polyfill is removed even if a module/theme continues to list them as a dependency. The deprecations are available in 9.4 for those who require supporting IE11 etc and have to manually add support that D10 no longer includes.

User interface changes

API changes

Data model changes

Release notes snippet

Drupal 10 will not support Internet Explorer, which means all the polyfills necessary for IE will be removed. Existing code will not need to be changed.

Issue fork drupal-3238501

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

lauriii created an issue. See original summary.

kostyashupenko’s picture

Status: Active » Needs review
StatusFileSize
new92.33 KB
new299.98 KB

Initial two patches.
The first one without yarn build:css

longwave’s picture

+++ b/core/core.libraries.yml
@@ -22,16 +22,6 @@ ckeditor:
-css.escape:

@@ -148,12 +138,6 @@ drupal.autocomplete:
-drupal.array.find:

@@ -292,18 +276,6 @@ drupal.dropbutton:
-drupal.element.closest:
...
-drupal.element.matches:

@@ -340,16 +312,6 @@ drupal.message:
-drupal.nodelist.foreach:
...
-drupal.object.assign:

@@ -442,15 +404,6 @@ drupal.vertical-tabs:
-es6-promise:

@@ -770,18 +722,6 @@ once:
-picturefill:

Do we need to deprecate these core libraries in 9.x for removal in 10?

longwave’s picture

Title: Remove Internet Exporer 11 polyfills » Remove Internet Explorer 11 polyfills
mherchel’s picture

Issue summary: View changes

Adding some additional polyfills that can be removed.

nod_’s picture

Component: javascript » base system
Status: Needs review » Needs work
Issue tags: +JavaScript
nod_’s picture

The associated js packages needs to be removed from package.json and core/scripts/js/assets.js as well.

chi’s picture

Can we remove the `postcss-custom-properties` plugin as well?

chi’s picture

postcss-calc

I think it has nothing to do with IE 11.

kostyashupenko’s picture

Moved to gitlab.
10.0.x branch was widely updated for the past 4 months, so need to review again changes in #2 and fix remaining things

kostyashupenko’s picture

Status: Needs work » Needs review

Ready for review

nod_’s picture

umm, we're removing without deprecating first. Probably need a green light from the release managers.

nod_’s picture

Title: Remove Internet Explorer 11 polyfills » [PP-1] Remove Internet Explorer 11 polyfills
Status: Needs review » Postponed

looking at contrib usage, it's very low but I think we should still deprecate first in 9.4 before removing those libs. A followup for the deprecation should be opened.

Postponing this one, we should have the deprecations before actually removing the files.

nod_’s picture

Title: [PP-1] Remove Internet Explorer 11 polyfills » Remove Internet Explorer 11 polyfills
Status: Postponed » Needs review

A bit too quick with the postponing

mxh’s picture

Any chance to have a D10 contrib project that holds the dropped polyfills?
Edit: nevermind. Checked for my project and this is a minor thing that I can take care on my own.

cilefen’s picture

FWIW I think IE is the only remaining user of core/drupal.date. See #3256549: Deprecate core/drupal.date asset library in 9.4.0

mherchel’s picture

Issue summary: View changes
mherchel’s picture

Created a Tugboat preview of this at https://3238501-remove-polyfills-faf2jeeweess1xalhfhpahdzqo0yct0k.tugboa....

Note this is based off the Olivero tugboat db, so Olivero's and Claro are set to be the default themes. That being said, this should do well for testing.

xjm’s picture

Issue tags: +Drupal 9.4 target
xjm’s picture

Issue tags: -Drupal 9.4 target

Oops, wrong issue.

bnjmnm’s picture

Title: Remove Internet Explorer 11 polyfills » [PP-1] Remove Internet Explorer 11 polyfills
Issue summary: View changes
murilohp’s picture

Are we gonna keep the core/misc/polyfills/array.includes.js polyfill? Looking at the MR I haven't found the file being removed.

lauriii’s picture

I'm a bit confused about #23; it is saying that we could simply remove these libraries from Drupal 10.0.0 since we don't trigger errors for referencing non-existing libraries, but it still postpones this on #3263823: Empty out and deprecate drupal libraries which are related to Internet Explorer 11 polyfills in 10.0.x for removal in 11.0.0 🤔

catch’s picture

Title: [PP-1] Remove Internet Explorer 11 polyfills » Remove Internet Explorer 11 polyfills

Discussed this with @lauriii, summarised in #3263823-10: Empty out and deprecate drupal libraries which are related to Internet Explorer 11 polyfills in 10.0.x for removal in 11.0.0. Our existing deprecation policy just does not work for polyfills, because they aren't really an API as such and there is not really a replacement or anything for people to use.

Because (luckily) missing library dependencies doesn't trigger a warning, the least-disruptive option is actually to just remove these outright in 10.x without a 9.x deprecation.

Yet another option would be empty, deprecated, libraries in 10.x for removal in 11.x, but that would contradict our attempt to not add 10-for-11 deprecations in 10.0.0.

Given all that, I think we need to update the bc policy with a specific section for polyfills, but also should just go ahead and remove the definitions here with a change record.

nod_’s picture

Issue summary: View changes
Issue tags: +9.4.0 release notes

added release note text

nod_’s picture

Status: Needs review » Needs work

Overall looks good, few details

The picturefill package needs to be removed from package.json and vendor-update script. As-is vendor update crashes because it tries to copy files that do not exist in node_modules

xjm’s picture

Priority: Normal » Critical
Issue tags: +Drupal 10 beta blocker

Spokje made their first commit to this issue’s fork.

longwave’s picture

This MR touches postcss.config.js - that is actually unused so #3086931: Remove unused postcss.config.js would be good to get in as well.

spokje’s picture

Status: Needs work » Needs review
Issue tags: -9.4.0 release notes +9.5.0 release notes

So here's what I did:

- Updated MR with the latest from 10.0.x.
- As recommended by nod_ in #28 I removed picturefill from core/package.json.
- Removed stuff from core/scripts/js/vendor-update.js that's deleted in this issue. Ran it locally and it doesn't crash.
- Removed core\modules\responsive_image\js\responsive_image.ajax.es6.js and it's js counterpart, since it was only adding the now removed picturefill.
- Removed core\modules\responsive_image\responsive_image.libraries.yml since that was only adding the now removed responsive_image.ajax.es6.js.
- Removed comment and help references from core\modules\responsive_image\responsive_image.module regarding picturefill.
- Ran yarn install which made changes in core/yarn.lock.
- Since a lot of files were deleted, I recreated core/misc/cspell/dictionary.txt.
- Needed to do a yarn run build:css -- --file themes/olivero/css/base/variables.pcss.css to pass CS checks.

spokje’s picture

nod_’s picture

Haven't looked closely yet but this is looking good to me

longwave’s picture

Patch is looking good to me too, haven't tested enough to RTBC yet though. One thing I spotted:

    // Prepare the fallback image. We use the src attribute, which might cause
    // double downloads in browsers that don't support the picture tag.

If everything supports <picture> now, can we remove the fallback image in a followup?

mherchel’s picture

If everything supports
now, can we remove the fallback image in a followup?

I would say yes.

spokje’s picture

mherchel’s picture

Status: Needs review » Reviewed & tested by the community

In addition to reviewing the patch, I took Drupal on a test drive with the console open to see if there were any errors. I paid special attention to the admin interfaces that did more heavy JS stuff (media, views, tabledrag pages, etc). I performed this on Chrome, Firefox, and Safari.

I couldn't break anything (well anything new!), and the patch looks good!

  • catch committed 145d728 on 10.0.x
    Issue #3238501 by kostyashupenko, Spokje, mherchel, nod_, longwave,...
catch’s picture

Title: Remove Internet Explorer 11 polyfills » [PP-1] Remove empty and deprecated 11.0.x polyfills in 11.0.0
Version: 10.0.x-dev » 10.1.x-dev
Status: Reviewed & tested by the community » Postponed
Issue tags: -Drupal 10 beta blocker, -10.0.0 release notes

Got excited about this and committed it, but then re-read the whole issue and #3263823: Empty out and deprecate drupal libraries which are related to Internet Explorer 11 polyfills in 10.0.x for removal in 11.0.0 and reverted again.

We need to do #3263823: Empty out and deprecate drupal libraries which are related to Internet Explorer 11 polyfills in 10.0.x for removal in 11.0.0 first, so marking postponed. I unpostponed in #3238501-26: Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0 when marking the other issue duplicate, but when we went through the whole thing again and un-duplicated it, and that discussion never got back here.

Also see all the discussion in #3263823-10: Empty out and deprecate drupal libraries which are related to Internet Explorer 11 polyfills in 10.0.x for removal in 11.0.0 to #3263823-19: Empty out and deprecate drupal libraries which are related to Internet Explorer 11 polyfills in 10.0.x for removal in 11.0.0 - we ended up deciding to empty out the libraries in 10.0.x and deprecate them in 10.0.x for removal in 11.0.x

Let's get the other issue finished first, and this will end up being an 11.0.x issue once there's a branch open.

  • catch committed 1c63a97 on 10.0.x
    Revert "Issue #3238501 by kostyashupenko, Spokje, mherchel, nod_,...
catch’s picture

btw about 95% of the patch here is usable in that issue, the only difference should be leaving empty, deprecated stubs in core.libraries.yml, but all the code removal and usage removal will be 100% the same.

catch’s picture

Title: [PP-1] Remove empty and deprecated 11.0.x polyfills in 11.0.0 » [PP-1] Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0
xjm’s picture

spokje’s picture

Title: [PP-1] Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0 » Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0
Priority: Critical » Normal
Status: Postponed » Needs work
Parent issue: #3284879: [meta] Requirements for tagging Drupal 11.0.0-beta1 » #3295574: [meta] Remove deprecated classes, methods, procedural functions and code paths outside of deprecated modules on the Drupal 11 branch
spokje’s picture

Version: 10.1.x-dev » 11.0.x-dev
catch’s picture

Priority: Normal » Major
Issue tags: -JavaScript +JavaScript
gábor hojtsy’s picture

Title: Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0 » [11.x] Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0
Version: 11.0.x-dev » 11.x-dev
Issue tags: +Major version only

Updating title, tags and version number based on recent announcement at https://www.drupal.org/about/core/blog/new-drupal-core-branching-scheme-...

spokje’s picture

Title: [11.x] Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0 » Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0
Issue summary: View changes
Related issues: +#3263823: Empty out and deprecate drupal libraries which are related to Internet Explorer 11 polyfills in 10.0.x for removal in 11.0.0

Spokje changed the visibility of the branch 3238501-remove-internet-explorer to hidden.

Spokje changed the visibility of the branch 11.x to hidden.

catch’s picture

Status: Needs work » Reviewed & tested by the community

I don't think this is the last IE reference we have in core, but one less is always good, even if it's just the library remnants.

  • nod_ committed 563e61ad on 11.x
    Issue #3238501 by kostyashupenko, Spokje, mherchel, nod_, catch,...
nod_’s picture

Status: Reviewed & tested by the community » Fixed

Committed 563e61a and pushed to 11.x. Thanks!

Status: Fixed » Closed (fixed)

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