Problem/Motivation
AFAICT we're replacing our
protected $supportedInterfaceOrClasswith Symfony's public function getSupportedTypes(?string $format): array.
If that is the case can/should we try to deprecate our class property $supportedInterfaceOrClass?
From #3338328-24: Update to Symfony 6.3
Details https://symfony.com/blog/new-in-symfony-6-3-performance-improvements#imp...
Proposed resolution
- remove property definition in core and throw deprecation message
- add a deprecation test and make sure all normalizers are fixed
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #23 | 3360124-23.patch | 28.09 KB | andypost |
| #23 | interdiff.txt | 1.28 KB | andypost |
| #12 | 3360124-12.patch | 28.58 KB | andypost |
Issue fork drupal-3360124
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
elberComment #5
andypostI bet it needs to convert and clean-up all usages in core
here's a different approach - removal of property definition and throwing deprecation message
Comment #6
andypostIt could use existing change record https://www.drupal.org/node/3359695 as the method now more useful
But maybe it should use parent method implementation (from Symfony)
Comment #7
andypostfix cs
Comment #8
andypostUpdated IS a bit
Comment #9
andypostFix few tests
Comment #10
andypostfix cs
Comment #11
andypostComment #12
andypostFix last tests
Comment #13
elberHi applied succesfully in drupal 11.x version
Tests are passing
Deprecations are corrects (deprecation message follows the required patters)
Property has been removed has issue's summary says
Moving to RTBC
Comment #14
catchCommitted/pushed to 11.x, thanks!
I thought about backporting this to 10.1.x but I don't think the late deprecation after beta will particularly help anyone.
Comment #15
spokjeNot seeing the push yet?
Also unsure if this needs a change record as per the tag?
Comment #17
catchI've added this issue to https://www.drupal.org/node/3359695 but I don't think we need a separate one.
Comment #18
andypostI think it needs follow-up to remove other mentions in code-comments
Comment #19
spokjeThanks @andypost. I've opened #3361401: Remove remaining occurences of ::supportedInterfaceOrClass property for that.
Comment #20
wim leersI was (pleasantly!) surprised to already see this land due to its BC break implications … but I see it landed only in
11.x! 🤯 Will this not be a problem for10.2!Comment #21
spokje- Deprecation warning is on 10.2 in the 11.x branch
- The 10.2.x branch will be branched from 11.x branch at the time of 10.2.0-alpha1, so that will "inherit"the deprecation.
I think we're good.
Comment #22
catchYes this will be in 10.2. https://www.drupal.org/about/core/blog/new-drupal-core-branching-scheme-...
I do wonder if we should consider backporting this bit (and the similar ones) to 10.1, without the deprecation message, so that contrib modules can start to use it as soon as they drop support for 10.0 and 9.5:
Moving back to 'to be ported' in case people agree.
Comment #23
andypostHere's patch #12 but without deprecation
Comment #24
spokjeTestBot is unhappy about the 9.5.x patch :/
Comment #25
andypostThe patch is for 10.1 which has SF 6.3 and can benefit from the change, 9.5 I triggered just for fun
Comment #26
spokjeThanks @andypost, I was already wondering about SF 6.3 and 9.5.x.
Also, we had a few escapees (See #3360280: Add missing ::hasCacheableSupportsMethod deprecations), may we should get those in first and then do the backport?
Nvm, outdated issue by now.
Comment #27
andypostGood idea to combine backport with polishing, we can include #3361401: Remove remaining occurences of ::supportedInterfaceOrClass property
Comment #28
smustgrave commentedSo marking as the tests seem green. Change record appears to cover what's happening too.
Comment #30
catchCommitted f3d4f1b and pushed to 10.1.x. Thanks!
Comment #32
nicxvan commentedI'd like to add some information to the change record. I got hit with a deprecation that referenced the change record associated with this issue.
https://git.drupalcode.org/project/rest_views/-/commit/69d089ef7794badda...
The change record did not seem to address this case. I'd propose updating the title to something like:
Normalizers/Denormalizers should implement ::getSupportedTypes() instead of ::hasCacheableSupportsMethod() or using protected $supportedInterfaceOrClass
Then in the change record showing a before and after:
Before
After