Problem/Motivation

Split from #2880237: [meta] Refactor system/base library.

This CSS is only used for item lists (of course) which may not be rendered on every page, leading to unused CSS and unnecessary page weight.

Steps to reproduce

Proposed resolution

Move item-list to its own library. Then attach it from template_preprocess_item_list

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3512285

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

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs work

CSS is added on https://drupal-dev.ddev.site/admin/reports/fields but doesn't actually work, maybe a weight issue?

catch’s picture

Status: Needs work » Needs review

Found the problem - claro wants to extend, not override, the library.

smustgrave made their first commit to this issue’s fork.

smustgrave’s picture

Status: Needs review » Needs work

Fixed a merge conflict but seems performance tests are failing.

catch’s picture

Updated the performance tests, but the new layout builder failures are consistent so something is going on here.

catch’s picture

Status: Needs work » Needs review

Should be green now. Looked like very complicated issues in LayoutBuilderUITest but was in fact a typo in the starterkit theme library definition.

borisson_’s picture

It is green now, and we're decreasing the page weight, that's great.
I am not sure about moving the file though, people are not supposed to reference the file by path, but it seems like it increases the likelihood this will be a breaking change?

catch’s picture

@borisson_ the moved_files definition supports libraries_override explicitly - it transparently switches the override and triggers a deprecation error. That leaves two situations where changing the file location can affect things:

1. Someone modifying the file in hook_library_info_alter() - but data structures passed to alter hooks are excluded from backwards compatibility for this reason, we'd have the same problem changing the location in a major release too.

2. Someone directly referencing the file in a separate library definition, this feels very, very unlikely because until this MR it was loaded on every request anyway, so it would result in double-loading the same file.

We've also had #3432183: Move system/base component CSS to respective libraries where they exist in core since around 10.2 or 10.3, and not had any regressions reported that I'm aware of (this is one of many follow-ups to that issue to try to finish the meta).

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for that information. Moving to rtbc based on #10.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

dcam made their first commit to this issue’s fork.

dcam’s picture

Status: Needs work » Reviewed & tested by the community

Rebased

dcam’s picture

This needed a rebase due to other commits that changed stylesheet performance metrics.

longwave made their first commit to this issue’s fork.

longwave’s picture

Status: Reviewed & tested by the community » Needs work

Looking at #3512236: Move fieldgroup CSS to its own library I think we need moved_files adding, as per #10?

catch’s picture

Issue summary: View changes
Status: Needs work » Needs review

Yes it did need that - added. Also needed a rebase.

catch’s picture

Issue tags: +frontend performance
needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

catch’s picture

Status: Needs work » Needs review

Rebased.

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Believe feedback for this one has been addressed

dcam’s picture

It needed a rebase due to ongoing changes in the performance tests. I expected the tests to fail, but apparently the new performance metrics from 11.x are still good here.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record

We need a CR and to link to it in the moved files section. Plus the deprecation version needs updating. - can be re rtbc'd once that is done.

dcam’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: -Needs change record

I created a new CR for libraries moved in 11.3.0 and made the requested changes. I'm restoring the RTBC status per #24.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 5ee49cc and pushed to 11.x. Thanks!

  • alexpott committed 5ee49cc4 on 11.x
    Issue #3512285 by catch, dcam, smustgrave, longwave, alexpott: Split...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.