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
API changes
Data model changes
Comments
Comment #2
rajab natshahComment #3
rajab natshahComment #5
vikashsoni commented@RajabNatshah tested and verify patch
thanks for the patch
Comment #7
smustgrave commentedThis 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.
Comment #8
liam morlandPlease put the patch into an issue fork and merge request.
Comment #10
rajab natshahComment #11
avpaderno