WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 22 months ago

#44551 closed defect (bug) (fixed)

Inline scripts should be printed for sourceless scripts

Reported by: bpayton Owned by: SergeyBiryukov
Milestone: 5.0 Priority: normal
Severity: normal Version: 4.9.7
Component: Script Loader Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

Today, inline scripts aren't printed for sourceless scripts, but inline styles are printed for sourceless styles.

It would be helpful to fix this for inline scripts.

This issue came up while exploring an approach to loading polyfills (feature tests + implementations) for Gutenberg.

I have a patch with unit tests and will post momentarily.

Attachments (1)

44551.diff (4.4 KB) - added by bpayton 2 years ago.
fix and unit tests

Download all attachments as: .zip

Change History (9)

@bpayton
2 years ago

fix and unit tests

#1 @bpayton
2 years ago

  • Keywords has-patch has-unit-tests added

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


2 years ago

#3 @SergeyBiryukov
2 years ago

  • Milestone changed from Awaiting Review to 4.9.9
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#4 @SergeyBiryukov
2 years ago

In 43564:

Script/Style Dependencies: Simplify some logic in WP_Styles::do_item().

Combine repetitive assignments, make the code more consistent with WP_Scripts::do_item().

See #44551.

#5 @SergeyBiryukov
2 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 43565:

Script/Style Dependencies: Make sure that inline scripts for handles without a source are printed.

See [36550] for WP_Styles.

Props bpayton.
Fixes #44551.

#6 @SergeyBiryukov
2 years ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for 4.9.9 consideration.

#7 @pento
23 months ago

  • Keywords fixed-major removed
  • Milestone changed from 4.9.9 to 5.0

#8 @pento
22 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 43788:

Script/Style Dependencies: Make sure that inline scripts for handles without a source are printed.

See [36550] for WP_Styles.

Merges [43565] to the 5.0 branch.

Props bpayton.
Fixes #44551.

Note: See TracTickets for help on using tickets.