How to upgrade to Gesso 5.2.4 ?

Created on 25 October 2023, about 1 year ago
Updated 25 June 2024, 5 months ago

Hello,

We have a custom theme that was developed by ForumOne using Gesso (v 5.0.9) as the starter theme several months ago.
We'd like to upgrade it to the latest Gesso version 5.2.4 so we can upgrade our sites to Drupal 10. How do I that without clobbering the templates and components in it? Would you be able to give us some advice or point us to the resources where we can upgrade it?

Thank you in advance for your help.

Regards,
-Jimmy

πŸ’¬ Support request
Status

Closed: works as designed

Version

5.2

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States jpham

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

Comments & Activities

  • Issue created by @jpham
  • Hi, Jimmy! Since Gesso is a starter theme (and not a base theme), this is no automated way to upgrade it to a new version. This is intentional because it's purpose is to be a clean starting place for creating a complex, customized theme that deviates pretty far from the original starting place.

    That said, I have been upgrading many of our implementations to either simply make them Drupal 10 compatible or to fully upgrade them to the latest release of Gesso (thereby also making them D10 compatible). I will outline a couple of approaches below that I've used, but realize while some of them are less involved than others, they are all done manually and none of them are particularly simple.

    1. You could just manually make any changes in the theme that are necessary for Drupal 10. If you have a lot of custom code in your theme, there may be additional things beyond what I'm listing and even if not I'm probably missing something, but offhand that would include things like:
    - Update the info files for the theme and gesso_helper module to list Drupal 10 under core version requirement
    - Changing any JavaScript using jQuery once to use Drupal once and updating those library dependencies.
    - Changing all instances of {% spaceless %}{% endspaceless %} to {% apply spaceless %}{% endapply %} in Twig files.
    - Using the Drupal Upgrade module to catch any changes needed in the /includes/ or /gesso_helper/ files. I don't recall if it's part of that module or something separate, but there's also a command line tool for Drupal that scans PHP files and suggests changes.

    2. You could look at particular PRs in our releases that are specific to Drupal 10 and try to replicate them. In particular, release 5.2.0 was the first to be Drupal 10 compatible so just duplicating the changes from a handful of PRs in that release should get you most of the way there. https://github.com/forumone/gesso/releases/tag/5.2.0

    The last two options are the ones I've used most, but are certainly the most involved. They both end up upgrading the current version of the theme to the latest release, but one does it all at once while the other does it in smaller chunks.

    3. Release by release. You can manually upgrade your theme from it's current release (5.0.9) to each subsequent release, one at a time until you end up at the latest one. All of the releases are listed here: https://github.com/forumone/gesso/releases

    The process I've typically followed is to the go to the next release after the one I'm on (in your case that would be 5.0.10) and then use the 'compare' button on the release or tag page to compare it to whatever release I'm currently on then change to the Files Changed tab and manually make each change. So, the first step in your case would be to compare 5.0.10 to 5.0.9 and make each file change manually shown here on the Files Changed tab: https://github.com/forumone/gesso/compare/5.0.9...5.0.10

    Since your theme has been customized, it would probably be helpful to look at the list of PR's on the release page and as you make changes somewhat wrap your head around what they're trying to accomplish in case you have additional files that might also need changes (e.g., if there's a PR that fixes all the {% spaceless %} tags in our default template, you'd probably also want to scan your custom templates for that tag).

    Once you've upgraded your theme to 5.0.10 and tested that it works, then you'd follow the same process to get to 5.0.11, then 5.1.0, etc. until you got the latest release. While a bit tedious, it can be done slowly over time and you can feel free to skip any changes that don't seem worth the effort (e.g., there's a couple of PRs that just clean up file formatting).

    A tip for simplifying this process -- instead of manually updating the package-lock.json file, once you've edited the package.json file, run `npm install --package-lock-only'. Just make sure you've run 'nvm use' first and have node version manager installed so you're running the same version as what we used to generate the file.

    And another tip... it can help to have a clone of the Gesso repo locally. That way you can switch to a particular tag and open it in a separate editor instance and quickly copy/paste any new files or files you're sure can just be copied over wholesale instead of tyring to copy their contents out of Github and properly name/rename files.

    4. Not sure I'd necessarily recommend this approach, but a way to avoid the step by step approach and just do it all in one go would be to just compare your current version to the latest release and manually make all those changes (as well as updating any of your custom files similarly). For example, this shows all changes from 5.0.9 to 5.2.4. https://github.com/forumone/gesso/compare/5.0.9...5.2.4

    That's over 300 files changed (altho a chunk of those are just file formatting changes). Typically I follow the release-by-release approach (or just jumping up 2-3 releases at a time) so I can look at the releases and their individual PRs to give me some context on why the changes were made to help me with any custom files or changes made in my custom theme. But doing it all once is an option.

    I hope some of this info is helpful. I've been upgrading Gesso for D10 quite often lately and while it's always a bit tedious and involves lots of copy/pasting, it does start to go faster once you've gotten use to the process. The quickest road to getting things working for D10 is certainly the first option, but let me know things go or if you have other questions.

  • Status changed to Closed: works as designed 5 months ago
Production build 0.71.5 2024