What is new in D9?
También puede leer este artículo en español.
The official launch of Drupal 9 was this past Wednesday June 3rd, with it, a new step in the evolution of this CMS was made. This new version doesn’t bring new features, but the updates it has are really visible for Drupal developers because now it offers a more secure system with updated dependencies and an API easier to work with.
The end of D7
With Drupal 9 here, it's impossible not to talk about those sites which are still using Drupal 7. Now we’re two versions ahead of it and, for a couple of months, it has been well known that its end of life will be in December 2021, that means 18 months from now approximately. During this time, Drupal 7 will still receive security and bug fixes support, though the recommendation in general is to use this time for migrating to Drupal 8 or 9.
The migration from Drupal 7 to 8 or 9 is considered to be the last big jump that should be made, it's like this because when Drupal changed from 7 to 8 a complete rebuild was made, that means, a whole new branch was created for Drupal 8 and it was developed over there, completely independent from Drupal 7.
To execute the Drupal migration from 7 to 8 or 9, it is recommended to use Upgrade Status, Drupal Module Upgrader and Migrate Suite:
- Upgrade status: this is a module that allows us to know the state of our contrib modules and themes, it helps us know if there are already compatible versions with D8/9 or if there is any module that may replace the respective functionality.
- Drupal module upgrader: this module generates changes in our custom modules to make them D8 and D9 compatible.
- Migrate suite: this is part of Drupal core and it lets us execute the content migrations.
Innovation in Drupal
The migration processes from a major Drupal version to another are usually large, expensive and complex. The change from Drupal 7 to 8 doesn’t escape from this, though, from now on these kind of changes will not be like that because of a new innovation process that has been put in place, it eliminates a big part of that complexity and that’s the main feature of this Drupal 9 launch.
As previously stated, the change from Drupal 7 to 8 was a complete rebuild so a new branch was created and D8 was developed there. Starting with D9 that’s different because now every new version will be built over the previous one, so it will deliver the same features and new stuff.
This new innovation process in Drupal is made thanks to the adoption of three mechanisms:
- Semantic versioning: it helps differentiate the launch of new features from bug fixes, this makes it easy to add new features and improvements to the API keeping backwards compatibility,
- scheduled launches: the launch cycle from Drupal has changed, now new features are going to be released every six months, with this new value is delivered to users and feedback is received quicker,
- experimental projects: they allow users to access unfinished features in advance in order for them to provide feedback quickly and to adjust the direction taken in each project.
Why Drupal 9?
You may ask, if this is the current state and the first release of D9 doesn’t have any different feature than Drupal 8.9.0, then why launch D9? Well, this is basically because D9 comes with all its dependencies updated so it includes Symfony 4, Twig 2, CKEditor 4 and the use of JQuery UI is completely removed from the API. Another of the changes that includes the D9 launch is that all deprecated code from D8 has been removed.
If this is not a good enough reason to migrate, we have the Drupal 8 end of life date being the same as the one for D7. That means December 2021 which is when Symfony 3 ends its life too. That’s why from now and until then, D8 will just have security and bug fixing support.
How do we move to D9 if we’re already on D8?
Dries Buytaert mentions “The big deal about Drupal 9 is… that it should not be a big deal”, that means that D9 shouldn’t actually be a big problem, the migration shouldn’t be as complex as with previous updates and also should be smooth and pretty straightforward, only stuff needed is to:
- Make sure our environment is D9 compatible, that means to confirm we have PHP 7.3, Drush 10 and MySql 5.7.8,
- have D8 core completely updated,
- update our contrib themes and modules to their D9 compatible versions,
- delete the use of API deprecated functions from our custom code, and
- finally, update Drupal core to version 9.
Earlier, I mentioned the Upgrade Status module as a tool to get prepared for the migration from D7 to 8/9, but on its D8 version it also allows us to see the state of our modules and know if they are D9 compatible. Another useful tool in the D8 to 9 transition is the module drupal rector, which automates the creation of D9 compatible code. Finally, another recommendation is that once we have all our code updated and D9 compatible, we should run our automated tests against D9.
Projects state
In previous updates, one of the biggest worries of the users was: "when are the modules going to be available for the new version?" For the launch of D9 the community started working on this with months of anticipation, in fact this year there were a couple of massive events in which users gathered to work together porting modules. The first of these events was held on April 28th and the second was on May 22nd and 23rd. As a result of these efforts, in the launch day we had already 95% of the top 100 projects completely D9 compatible.
The future
New features are going to be released each six months, for example the Olivero theme will be released in december and work on Claro as an administration theme is being made. More information about Drupal 9 can be found here.
I highly recommend taking a look at the slides from @gaborhojtsy for more information, they are pretty clear and have lots of links to other related resources, also, they were used by the community in multiple D9 launch celebrations around the world this week.
Thanks for reading!
This post was first published in https://dev.to/dharizza/what-s-new-in-d9-3mn7