Sharing block: ensure that we do not load resources on the frontend unless needed #34108
Labels
[Block] Sharing Buttons
[Feature] Sharing
Post sharing, sharing buttons
[Focus] Performance
[Pri] Normal
[Type] Enhancement
Changes to an existing feature — removing, adding, or changing parts of it
The Sharing Buttons block currently requires the
Sharing_Service
class:jetpack/projects/plugins/jetpack/extensions/blocks/sharing-buttons/sharing-buttons.php
Line 15 in bb1b509
As a result, the sharing buttons' CSS gets enqueued, even if you haven't set up any buttons yet.
https://github.com/jeherve/jetpack/blob/193e017dbfbfbdd2b78dd5f843357d1d04892c38/projects/plugins/jetpack/modules/sharedaddy/sharing-service.php#L907-L908
As we continue to iterate on the new block, we'll need to ensure we do not needlessly enqueue those styles.
Epic: #19694
The text was updated successfully, but these errors were encountered: