Drupal 10 was recently released, and the momentum hasn’t stopped there. New features and API improvements are already landing, ready for Drupal 10.1.x.
Third and Grove’s resident core committer takes a look ahead.
Views responsive grid
This feature is already available in Drupal 10.0.0, but it couldn’t be added to Drupal 9.5 due to Internet Explorer 11 support, so if you haven’t updated to Drupal 10, you won’t have seen it yet. Responsive grid allows you to specify the maximum number of columns, the minimum grid cell width and the gutter spacing. When the grid cells resize to a point where they’re below the minimum width, the grid will reflow to have fewer columns. Alternatively, the grid will expand to fit as many columns as permitted while keeping the grid width above the minimum value. This saves time for developers and website owners by enabling them to configure a feature that previously required custom code or contributed modules in just a couple of minutes.
- Before, aggregates had to be built by the main page request.This resulted in stampedes on cold caches since no page could be served until aggregates were built and for individual pages could take hundreds of milliseconds to execution time.
In Drupal 10.1, completely rewritten aggregation generation logic solves both of these issues.
- Aggregates are now built by a dedicated route, with the main request only responsible for generating the aggregate URL based on libraries, theme, language and grouping logic. This change resolves the cold cache stampede as well as making things more robust against race conditions
Constructor property promotion
When writing new Drupal code, one of the most annoying things can be the amount of boilerplate required when defining a constructor. Property declarations which are almost identical to @param documentation.
Since Drupal 10 requires PHP 8.1, we can get rid of most of that boilerplate, so that exactly the same constructor looks like this instead:
Much more compact with the same amount of actual implementation. This has already been adopted for new code, there’s a bit more involved to apply it to existing code.
Since Drupal 8.0, Drupal has used annotations, a parseable code comment format, for defining metadata, for example for entity types. PHP 8 ships with attributes - native support for the same kinds of metadata, with less parsing overhead. Drupal 10 doesn’t yet support attributes, but we’re hoping to in Drupal 10.1 or as soon as possible, so we can start transitioning away from annotations before the libraries we rely on for parsing drop support for it.
Tidier issue queues
Drupal’s bugsmash and needs review queue initiatives have been making great progress triaging Drupal’s very long backlog. We’ve gone from around 7,000 bug reports to just over 5,000, and from around 2,700 issues needing review to around 250. Issues that have been stalled for years have been moved on and in some cases fixed. If you’d like to see old issues closed, get involved!
Join our mailing list and you can stay this informed all the time.
Don't be a stranger.
Keep up to date by signing up for our newsletter. It’ll be fun, we promise.