Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#64173 closed defect (bug) (fixed)

Block editor: [Fix] Don't load fit text front end scripts on the editor.

Reported by: jorgefilipecosta's profile jorgefilipecosta Owned by: jorgefilipecosta's profile jorgefilipecosta
Milestone: 6.9 Priority: normal
Severity: normal Version:
Component: General Keywords: gutenberg-merge has-patch
Focuses: Cc:

Description

Tracks the fix of issue where the FitText frontend script (fit-text-frontend.js) was incorrectly being enqueued and loaded in the block editor when editing posts that contain blocks with the fitText attribute enabled. It had no big impact has the script does not do anything on the editor but still it's useless bytes we are sending.
We are enqueuing using exactly the same pattern as in other blocks, like file. image, or form I suspect in some of theses cases the front end script is also loading on the editor when it is non needed, something we can try to improve after.

Change History (3)

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


8 months ago
#1

  • Keywords has-patch added

Backports PR https://github.com/WordPress/gutenberg/pull/72842 from Gutenberg.

This PR fixes an issue where the FitText frontend script (fit-text-frontend.js) was incorrectly being enqueued and loaded in the block editor when editing posts that contain blocks with the fitText attribute enabled. It had no big impact has the script does not do anything on the editor (the classes the script searches are not there) but still it's useless bytes we are sending.
We are enqueuing using exactly the same pattern as in other blocks, like file. image, or form I suspect in some of theses cases the front end script is also loading on the editor when it is non needed, something we can try to improve after.

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

## Testing Instructions

This change is covered by automated tests in Gutenberg.
In core we should just smoke test fit text:

  • Add a paragraph with fit text on editor, verify everything works, see the post on the frontend verify fit text still works there.
  • Activate a theme with customizer support like "Twenty Sixteen", navigate on the customizer to a post with fit text verify things still work.

#4 @jorgefilipecosta
8 months ago

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

In 61115:

Block editor: Don't load fit text frontend scripts on the editor.

This commit fixes an issue where the FitText frontend script (fit-text-frontend.js) was incorrectly being enqueued and loaded in the block editor when editing posts that contain blocks with the fitText attribute enabled. It had no big impact has the script does not do anything on the editor (the classes the script searches are not there) but still it's useless bytes we are sending.

Developed in #10437.

Props jorgefilipecosta, oandregal.
Fixes #64173.

Note: See TracTickets for help on using tickets.