Make WordPress Core

Opened 9 months ago

Closed 8 months ago

#64429 closed defect (bug) (fixed)

Script Modules: Dependencies inherit fetchpriority from not-enqueued, registered modules

Reported by: jonsurrell Owned by: westonruter
Priority: normal Milestone: 6.9.1
Component: Script Loader Version: 6.9
Severity: normal Keywords: has-patch has-unit-tests fixed-major
Cc: Focuses: javascript

Description (last modified by westonruter)

In PR 10638 (comment), it was noticed that a script module's fetchpriority may increased to match its dependent's fetchpriority even if that module is not enqueued.

It seems that the dependency's fetchpriority should only increase when an enqueued dependent has a higher fetchpriority, not when any registered dependent has a higher fetchpriority.

[60931] added the logic for module dependencies to increase their fetch priority.

Change History (13)

#1 @jonsurrell
9 months ago

@westonruter Do you recall if this was the expected behavior?

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


9 months ago
#2

  • Keywords has-patch has-unit-tests added

#3 @westonruter
9 months ago

  • Milestone Awaiting Review7.0
  • Owner set to westonruter
  • Status newaccepted
  • Version6.9

No, this is not expected. Working on a fix.

#4 @westonruter
9 months ago

When WP_Script_Modules::print_script_module() was calculating the highest fetchpriority for its script module dependents, it was not considering whether those dependents were actually enqueued. Now it does.

Note the issue was not present for classic scripts.

Test cases have been added for scripts and script modules.

Ready for review: https://github.com/WordPress/wordpress-develop/pull/10651

#5 @jonsurrell
9 months ago

This isn't a critical issue but it was introduced in 6.9 and could be considered for a 6.9.x patch release.

#6 @westonruter
9 months ago

  • Milestone 7.06.9.1

#7 @westonruter
9 months ago

  • Description modified (diff)

#8 @westonruter
9 months ago

  • Resolutionfixed
  • Status acceptedclosed

In 61401:

Script Loader: Fix script module fetchpriority calculation when dependent with higher priority is not enqueued.

Developed in https://github.com/WordPress/wordpress-develop/pull/10651

Follow-up to [60931], [60704].

Props westonruter, jonsurrell, youknowriad.
See #61734.
Fixes #64429.

#9 @westonruter
9 months ago

  • Keywords fixed-major added
  • Resolution fixed
  • Status closedreopened

Re-opening for 6.9 backport consideration.

#10 @jonsurrell
9 months ago

  • Keywords dev-feedback added

#11 @jonsurrell
8 months ago

  • Keywords dev-feedback removed

[61401] looks good for 6.9 backport.

This ticket was mentioned in Slack in #core by jorbin. View the logs.


8 months ago

#13 @jonsurrell
8 months ago

  • Resolutionfixed
  • Status reopenedclosed

In 61506:

Script Loader: Fix script module fetchpriority calculation when dependent with higher priority is not enqueued.

Developed in https://github.com/WordPress/wordpress-develop/pull/10651

Follow-up to [60931], [60704].

Reviewed by jonsurrell.
Merges [61401] to the 6.9 branch.

Props westonruter, jonsurrell, youknowriad.
Fixes #64429. See #61734.

Note: See TracTickets for help on using tickets.