Make WordPress Core

Opened 5 weeks ago

Closed 4 weeks ago

Last modified 3 weeks ago

#60348 closed defect (bug) (fixed)

Script Modules API: Add import map polyfill for older browsers.

Reported by: cbravobernal's profile cbravobernal Owned by: gziolo's profile gziolo
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: Script Loader Keywords: has-patch has-unit-tests commit add-to-field-guide
Focuses: Cc:

Description (last modified by cbravobernal)

Add a polyfill to make import maps compatibles with Safari versions under 15.

Syncs the changes from https://github.com/WordPress/gutenberg/pull/58263 to core.
Adds a polyfill to make import maps compatible with Safari old versions (under 15).

Trac ticket: https://core.trac.wordpress.org/ticket/60348

Attached screenshots.
https://github.com/WordPress/wordpress-develop/assets/37012961/03cb3163-c9e3-458e-a216-463ab98f5039
https://github.com/WordPress/wordpress-develop/assets/37012961/ba09e4f3-d349-4bfc-b7a3-924746abd909

Change History (15)

This ticket was mentioned in PR #5947 on WordPress/wordpress-develop by @cbravobernal.


5 weeks ago
#1

  • Keywords has-patch added

#2 @jorbin
5 weeks ago

This looks to be related to a feature added in 6.5. We generally only backport fixes for bugs introduced during that release. Why do you think it should be backported?

#3 @cbravobernal
5 weeks ago

  • Summary changed from Backport: Add import map polyfill for modules. to Add import map polyfill for modules.

With backport I meant moving code that has been in Gutenberg to Core, in 6.5.

At least we call them backports in the sync issue:
https://github.com/WordPress/gutenberg/issues/57959

If it has a different meaning in Core, I will change the title.

Modules will be available in 6.5, and would be cool to have them also working in old Safari versions.

Thanks for the info!

#4 @jorbin
5 weeks ago

  • Component changed from General to Script Loader
  • Milestone changed from Awaiting Review to 6.5

Thanks for the clarification. A backport means moving from one branch to another in core.

Adjusting the milestone and component.

#5 @cbravobernal
5 weeks ago

  • Description modified (diff)

#8 @cbravobernal
4 weeks ago

  • Summary changed from Add import map polyfill for modules. to Script Modules API: Add import map polyfill for older browsers.

@gziolo commented on PR #5947:


4 weeks ago
#9

Code-wise it seems to be ready to go. Do we have unit tests covering other polyfills? We could verify if the script prints when there are items in the import map.

#10 @luisherranz
4 weeks ago

#60232 was marked as a duplicate.

@cbravobernal commented on PR #5947:


4 weeks ago
#11

Code-wise it seems to be ready to go. Do we have unit tests covering other polyfills? We could verify if the script prints when there are items in the import map.

I will take a look at it, if not, I will check if can add unit tests to cover them.

#12 @gziolo
4 weeks ago

  • Keywords has-unit-tests commit added

#13 @gziolo
4 weeks ago

  • Owner set to gziolo
  • Resolution set to fixed
  • Status changed from new to closed

In 57492:

Script Modules API: Add import map polyfill for older browsers

Syncs the changes from https://github.com/WordPress/gutenberg/pull/58263. Adds a polyfill to make import maps compatible with unsported browsers (https://caniuse.com/import-maps).

Fixes #60348.
Props cbravobernal, jorbin, luisherranz, jonsurrell.

#15 @stevenlinx
3 weeks ago

  • Keywords add-to-field-guide added
Note: See TracTickets for help on using tickets.