Add a core_version_requirement directive to typed_data.info.yml, and update composer.json drupal core requirement to support D9 installs.
As a maintainer of Salesforce module - a downstream dependency on typed_data module - I'm prepping for Drupal 9.
For this effort, I'm enabling automated testing against Drupal 9.0.x, but in order to do so I need to be able to composer-install all my dependenies.
Adding core_version_requirements and updating composer.json makes this possible.
This may lead to additional patches, but this is the first, simplest.
Comments
Comment #2
aaronbaumanComment #3
tr commentedWell, it is not possible in general for contributed modules to support both Drupal 8 and Drupal 9 at this point in time because Drupal deprecated things in D8.8 that are removed in D9, but we must still use the deprecated functions in contrib because Drupal 8.7 is still supported for another 6 months.
Drupal core does not supply the tools for contrib to support D9 and D8.7 at the same time, so we have to wait until D8.7 is no longer supported before we can support both D8 and D9. (Unless we write and maintain our own BC layer for these removed functions, which I'm not going to do. This should be done by core so that EVERY contrib module can use the BC layer, rather than requiring each and every contrib module do implement their own.)
For typed_data, we are only affected in one place that I know of, see #3096756: setExpectedException() is deprecated : Remove support for PHPUnit 4 when Drupal 8.8 becomes the lowest supported version. But even this means that if we want to be testable in D9 we have to throw away D8.7 support right now. And D8.7 or less is still used by more than 70% of existing Drupal sites last I checked.
Comment #4
aaronbaumanMakes sense, thank you for the explainer.
I will hold off on D9 prep until 8.9.0
Comment #5
tr commentedI put in a hack to get around the issue mentioned in #3. Basically, in the tests I did "if D8 then do something, elseif D9 do something different". It's not pretty, I'm not happy that I had to do that, and the hack will be removed as soon as D8.8 is the lowest supported version of core.
But it did allow typed_data to become D9 compatible right now. This module is currently being tested against D9.0, with all tests passing, so you should now be able to do the same!
Comment #6
aaronbaumanthank you for the update