Slide 1

Slide 1 text

Getting ready for Drupal 11 João Ventura Drupal Developer @ “when I have free time”

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

drupal.org/u/jcnventura João Ventura Previously: ● @1xinternet ● @wunder ● @trellon Now back to 🚀 (no Drupal involved) Co-organizer of DDD Lisbon and Drupal Europe (co-)Maintainer of a few contrib modules Portuguese, living near Darmstadt, Germany, previously lived near Madrid, Spain.

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

© Al Case CC BY-NC-ND 2.0 https://www.flickr.com/photos/60035031@N06/32893514231/ © Jeff Hitchcock (CC BY 2.0) https://flic.kr/p/qLRjNu 11 10 12

Slide 6

Slide 6 text

When is the Drupal 11 release party? A: in ~82 days

Slide 7

Slide 7 text

What’s new in Drupal 11 ● Nothing! It will be the same as Drupal 10.3* ● New dependencies ○ Symfony 7 ○ jQuery 4 ○ PHPUnit 10 (testing) ● Upgraded requirements ○ PHP 8.3 🚀 ○ Composer 2.7 ○ MariaDB 10.6 or MySQL 8 or PostgreSQL 16 * deprecated modules removed

Slide 8

Slide 8 text

Upgrade to Drupal 11 ASAP? ● Maybe no ○ Sites can wait until LTS ends, and upgrade to next LTS ○ Major advantage: contrib will be ready for the upgrade. ● Maybe yes ○ New features (and new bugs) ○ What if everyone waits 2 years before upgrading contrib?

Slide 9

Slide 9 text

Drupal 11 will be released ~ July 29th 2024 Drupal core release cycle Each major will have 2 years of active support + 2 years of LTS

Slide 10

Slide 10 text

Coming soon ONLY to Drupal 11 ● Automatic updates ● Project browser ● Experience Builder ● and anything else needed for Starshot

Slide 11

Slide 11 text

Upgrade strategies ● One-off sites ● Agency Distribution / starter project ● Module maintainer Common solution: get Drupal 11 running now, and test Drupal 11.0.0-alpha1 released 1 week ago.

Slide 12

Slide 12 text

Contrib packages

Slide 13

Slide 13 text

https://dev.acquia.com/drupal11/deprecation_status ● Almost 15% already have D11 support ● 54% only need to add “|| ^11” to .info.yml ● Update bot patches for ~6% ● ~25% will need more work ● Contrib maintainers need to maintain! ● Project Update Working Group (🚑) https://www.drupal.org/project/puwg ● 25% of D9 projects never got upgraded to D10 before D9 EOL !! Current state of contrib packages

Slide 14

Slide 14 text

Upgrade tools

Slide 15

Slide 15 text

Lenient composer plugin ● Drupal 8 to Drupal 9 upgrades used the lenient composer endpoint that removed the drupal/core requirement "repositories": { "lenient": {"type": "composer", "url": "https://packages.drupal.org/lenient" } "8": {"type": "composer", "url": "https://packages.drupal.org/8" } }, ● Now replaced with the composer-drupal-lenient plugin "require": { "cweagans/composer-patches”: "^1.7”, "mglaman/composer-drupal-lenient": "^1.0" }, Same principle, but drupal/core bypass is now local. i

Slide 16

Slide 16 text

Lenient composer plugin ● allow-list for those modules/themes/profiles that composer would refuse to install due to incompatible reqs: "extra": { "drupal-lenient": { "allowed-list": [ "drupal/admin_toolbar", "drupal/token", ]}}, ● Easy way to search for those contrib packages: grep -R core_version_requirement web/*/contrib/*/*.info.yml ii

Slide 17

Slide 17 text

Upgrade bot ● Upgrade bot is a a set of static analysis tools that analyse the code of all not-yet compatible projects and generates a patch and merge request to remove most code deprecations ○ Not all deprecations ○ Now also supports changing the info.yml ● Issues can be identified by title “Automated Drupal 11 compatibility fixes for foobar” ○ Test, review and merge if maintainer ⇢ pass Go

Slide 18

Slide 18 text

Composer patches plugin ● Either created manually or from update bot "extra": { "patches": { "drupal/foobar": { "D11": “https://www.drupal.org/files/issues/2024-05-10/123–-4-drupal_11_compatibility.patch” } }}, ● Never use a merge request plain text diff to patch!! ⚠⚠ ○ Major security risk 🚨 ○ Use commit patch or upload the current state of MR

Slide 19

Slide 19 text

Drupal rector ● Install in require-dev "require-dev": { "palantirnet/drupal-rector”: "^0.20” }, ● Copy rector.php to project root cp vendor/palantirnet/drupal-rector/rector.php . ● Analyse for deprecations vendor/bin/rector process web/modules/custom/[YOUR_MODULE] --dry-run ● Apply changes vendor/bin/rector process web/modules/custom/[YOUR_MODULE]

Slide 20

Slide 20 text

Upgrade status module ● Drupal 10 module to check current status of used packages ● Install also in dev "require-dev": { "drupal/upgrade_status”: "^4.3” }, ● See https://www.drupal.org/project/upgrade_status for detailed installation instructions ● example.com/admin/reports/upgrade-status FTW!

Slide 21

Slide 21 text

DDEV ● Can’t use PHP 8.3 yet because of… ● DDEV provides docker-based local development environments ● Installation instructions: https://ddev.readthedocs.io/ ● Go back in time, and watch Mauricio’s session 2h ago

Slide 22

Slide 22 text

Makers 👍 Takers 👎👎

Slide 23

Slide 23 text

Developers ● Any error in a contrib package should be reported in the d.o issue queue ○ First, check if fix already exists ■ If merged, and works (!), mark RTBC; done ○ Create MR, patch commit diff and mark “Needs Review” ● Local patch ○ 0% chance of being merged ○ Hard to maintain ○ Effort needed

Slide 24

Slide 24 text

Maintainers ● Regularly check for RTBC issues ○ Test and merge (or ⇢ Needs work) ● Check for Upgrade Bot issue ○ Test, merge and create new D11 release ● Provide contribution credits ● Create roadmap ● Not a maintainer? Maintainer is MIA? ○ Apply to be a maintainer!

Slide 25

Slide 25 text

Agencies ● Promote open-source culture!! ● Provide paid time for contrib work ○ Developer reputation 🤩 ○ d.o/marketplace credit 🤑 ● Co-maintain or sponsor “go-to” packages ● Maintain your modules (even if no longer used…) ○ Don’t reinvent the wheel

Slide 26

Slide 26 text

Questions? Also see https://slides.com/gaborhojtsy/drupal-11-deep-dive-may-7-2024

Slide 27

Slide 27 text

Thank you! Host Partner Sponsors

Slide 28

Slide 28 text

Host Partner Sponsors