Problem/Motivation

Having a performance coverage issue of 100% not used CSS from the

Node preview component CSS style

node.preview.css
On anonymous users or when not previewing a node

Steps to reproduce

Switch off CSS and JavaScript aggregation and advanced aggregations
Find Unused JavaScript And CSS With The Coverage Tab

Proposed resolution

Load only on node preview for logged in users
The Drupal core node module has a drupal.node.preview but themes are not overriding or extending the library

drupal.node.preview:
  version: VERSION
  css:
    theme:
      css/node.preview.css: {}
  js:
    node.preview.js: {}
  dependencies:
    - core/jquery
    - core/jquery.once
    - core/drupal
    - core/drupal.dialog
    - core/drupal.form

The Stable Drupal core theme is doing

libraries-override:
  node/drupal.node.preview:
    css:
      theme:
        css/node.preview.css: css/node/node.preview.css

The Olivero Drupal core front-end theme is doing

libraries-extend:
  node/drupal.node.preview:
    - olivero/drupal.node.preview

Having the Olivero libraries extend way

Remaining tasks

  • Fix
  • Performance coverage test
  • Functional test
  • Review
  • Release

User interface changes

  • None

API changes

  • None

Data model changes

  • None
CommentFileSizeAuthor
#2 3209709-2.patch1.19 KBrajab natshah

Issue fork bartik-3209709

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

RajabNatshah created an issue. See original summary.

rajab natshah’s picture

StatusFileSize
new1.19 KB
rajab natshah’s picture

Assigned: rajab natshah » Unassigned
Status: Active » Needs review
Issue tags: +Page loading performance, +Performance, +performance coverage

Version: 9.1.x-dev » 9.3.x-dev

Drupal 9.1.10 (June 4, 2021) and Drupal 9.2.10 (November 24, 2021) were the last bugfix releases of those minor version series. Drupal 9 bug reports should be targeted for the 9.3.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

vikashsoni’s picture

@RajabNatshah tested and verify patch
thanks for the patch

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Project: Drupal core » Bartik
Version: 9.4.x-dev » 1.0.2
Component: Bartik theme » Look and Feel

This issue is being reviewed by the kind folks in Slack, #need-reveiw-queue. We are working to keep the size of Needs Review queue [2700+ issues] to around 200, following Review a patch or merge require as a guide.

Thank you for the work on this!

This appears to be very specific to the bartik theme and unfortunately bartik has been removed in Drupal 10 and moved to contrib project. So moving to over there will hopefully it will have a better chance.

liam morland’s picture

Version: 1.0.2 » 1.0.x-dev
Status: Needs review » Needs work

Please put the patch into an issue fork and merge request.

rajab natshah’s picture

Status: Needs work » Needs review
avpaderno’s picture

Title: Fix Bartik Drupal core theme performance coverage for Node preview component CSS style loaded for anonymous users » Fix performance coverage for Node preview component CSS style loaded for anonymous users