Skip to content

Reduce the amount of data Global Styles sends to the client #26802

@oandregal

Description

@oandregal

The different block editors receive data from the server via settings in the form of wp.editSite.initialize( 'edit-site-editor', settings ). This can be seen either embedded in the HTML head or directly in the corresponding store, for example, core/site-editor.

There are a couple of issues with how global-styles.php currently sends the data to the client.

  • There are some data that we may be able to calculate in the client, because it's extracted from block.json data. This is for __experimentalGlobalStylesContexts.

  • The more pressing is that we send empty data in both __experimentalFeatures and __experimentalGlobalStylesBaseStyles for each registered block, which amounts to a very noticeable number of unnecesary bits send over the wire. The reason for that is how we normalize the schema for every context. Fixed in Extract theme json processor  #26803

Captura de ecrã de 2020-11-07 13-54-23

Captura de ecrã de 2020-11-07 13-54-33

Metadata

Metadata

Assignees

Labels

Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progress[Type] PerformanceRelated to performance efforts

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions