How to best recompile subtheme?

Created on 1 November 2023, over 1 year ago

Problem/Motivation

It says under each release, for example Bootstrap5 3.0.10 :

Note: make sure you recompile subtheme.

What is the recommended method to do this?

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Active

Version

3.0

Component

Documentation

Created by

🇩🇰Denmark ressa Copenhagen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ressa
  • 🇩🇰Denmark ressa Copenhagen
  • 🇮🇳India lalit-jangir

    Hi @ressa,
    you can have a look on Development and patching section of README.md file of theme. It've instructions to compile SCSS and JS of theme.

  • 🇩🇰Denmark ressa Copenhagen

    Thanks for the link @lalit-jangir, which does describe how to recompile a subtheme.

    My title and question was not quite precise though, sorry about that.

    What I am really looking for is a more practical step-by-step write up of how to do the entire process of updating a sub-theme. And recompiling could be part of this. I'll update the title and Issue Summary :-)

  • 🇮🇳India ravi kant Jaipur

    The Base theme is 'Bootstrap5' in sub theme so all updated files will be use in subtheme. Also cannot upgrade sub-theme directly due to every thing in sub-theme is custom. So if website is breaking after upgrade base theme then the issues will be fix manually by debug and according to Readme file or release note.

  • 🇩🇰Denmark ressa Copenhagen

    Thanks, but I think the task is to document the actual steps, to ideally make it easier to update a sub-theme, with a step-by-step repeatable process.

  • Status changed to Postponed: needs info over 1 year ago
  • 🇦🇺Australia VladimirAus Brisbane, Australia

    Thanks for the detailed question @ressa.
    With bootstrap 5 se switched to starterkit approach .
    See section titled " Tracking upstream changes " how they check for changes between core and overriden templates.

    However, I presume that when you clone template to your subtheme, you will be modifying it.

    I agree that there is not much visibility on how different template from original, but in my oponion: this is responsibility of the developer to be aware of the changes.

    So if you want to update the documentation, I would mention

    • compare twig templates between bootstrap5 and your them theme
    • recompile SASS
  • 🇩🇰Denmark ressa Copenhagen

    Thanks for the link @VladimirAus, that section gives really useful information on how to track changes between sub-themes' foundations.

    To help updating Bootstrap5, wouldn't it be great to add a new field in the *.info.yml file?

    generator: bootstrap5:4.0.0-alpha1

    Then, the user can diff to see the difference:

    git diff '4.0.0-alpha1' '4.0.3' -- bootstrap5

    And, sure we as developers copy out and modify template files, but that's the final piece of the puzzle, since now you as a user know which original template files have changed, and be aware of.

    I have updated the Issue Summary with a proposed solution, what do you think about it?

  • 🇺🇸United States bunthorne

    I created a subtheme with hardly any customization in it from a Bootstrap5 version that was 9/10 compatible. Now my Bootstrap5 version is compatible with 11, but the subtheme still kicks out on the Upgrade Status report as incompatible.
    Do I just need to manually update the info.yml file, or should I generate a new subtheme and then copy over any changes I made?

  • 🇦🇺Australia VladimirAus Brisbane, Australia

    @bunthorne, you need to check what Upgrade Status is reporting.
    Most likely you need to bump core_version_requirement in your info.yml subtheme to match Drupal version compatibility.

  • 🇺🇸United States rhovland Oregon

    Comparing template changes between the 3.x and 4.x branch is as easy as cloning the module's git repo and then running the following in the cloned folder:
    git diff 3.0.x 4.0.x -- templates/

    So far only changes to content/media.html.twig

  • 🇧🇪Belgium tvb

    What fixed issues in my case after upgrading bootstrap5 from 3.0.10 to 4.0.3: if you use stylesheets-remove in your subtheme info.yml to not load specific bootstrap5 CSS files, replace it with libraries-override.

    It fixed a number of issues, and no recompiling required.

Production build 0.71.5 2024