Skip to content

Bundling Front-end Assets #5445

@mtias

Description

@mtias

Related core ticket: https://core.trac.wordpress.org/ticket/50328.

Explore ways in which front-end styles for blocks could be assembled based on which blocks are used in a given page response.

Note: this is a deviation from how themes and resources have operated so far, since a theme usually adds a single stylesheet including all possible HTML a user might add, as well as handling for widgets, etc, that might never be present on a page.

The granularity of blocks, and our ability to tell on the server which blocks are being used, should open up opportunities for being more intelligent about enqueueing these assets.

Considerations

This would need to have proper hooks for disabling and extending, as there will be issues with async loading of content (like infinite scroll) and caching mechanisms if the bundle is dynamic.

Furthermore, it should at least consider how theme supplied styles for blocks might interop. See #5360

Metadata

Metadata

Assignees

Labels

FrameworkIssues related to broader framework topics, especially as it relates to javascriptNeeds DevReady for, and needs developer efforts[Status] In ProgressTracking issues with work in progress[Type] OverviewComprehensive, high level view of an area of focus often with multiple tracking issues[Type] PerformanceRelated to performance efforts

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions