[wp-trac] [WordPress Trac] #52098: Twenty Twenty-One: IE specific polyfills are loaded in all browsers

WordPress Trac noreply at wordpress.org
Fri Dec 18 00:07:14 UTC 2020


#52098: Twenty Twenty-One: IE specific polyfills are loaded in all browsers
-----------------------------+--------------------------------------
 Reporter:  ismail.elkorchi  |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Bundled Theme    |     Version:  5.6
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  javascript, performance
-----------------------------+--------------------------------------

Comment (by peterwilsoncc):

 I've created a proof of concept [https://github.com/WordPress/wordpress-
 develop/pull/826 pull request for the script loader]:

 * The `twenty-twenty-one-ie11-polyfills` asset becomes a loader with a
 `null` source (similar to how core used to do jQuery)
 * A new script is registered with the actual source linked, `twenty-
 twenty-one-ie11-polyfills-asset`
 * I've used the loader pattern to:
   - avoid breaking backward-compatibility with any child themes that are
 using `twenty-twenty-one-ie11-polyfills` as a dependency
   - avoid having to double up on the pollyfill script for both the
 responsive embeds and primary navigation script

 Sorry about any confusion around using `$is_IE` for scripts vs styles.

 @poena Would you or the TT1 team mind taking a look at the PR and let me
 know if you'd prefer a different approach or I've missed a required test?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52098#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list