Problem/Motivation
Symfony 6.3 will be released in May 2023. Drupal 10.1 will be released in June 2023. We should aim to be on Symfony 6.3 for the release of Drupal 10.1.
Steps to reproduce
Proposed resolution
Start updating now to Symfony 6.3 to see what deprecations, if any, we need to fix.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #52 | 3338328-52.patch | 107.59 KB | spokje |
| #52 | interdiff.47-52.txt | 9.81 KB | spokje |
Issue fork drupal-3338328
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:
- 3338328-update-to-symfony
changes, plain diff MR !3907
Comments
Comment #2
longwaveComment #4
jungleRerolled and removed "minimum-stability": "beta" from two components' composer.json file.
Comment #6
longwaveThis revealed no new deprecations yet, so I think we can just leave this for a month or more.
Comment #7
longwaveLet's try again.
Comment #8
longwaveComment #9
longwaveSymfony\Component\Validator\Context\ExecutionContextInterface has added return types. The methods are tagged @internal so Symfony can do this in a minor, but we extend it anyway, so we have to match.
This also reminded me of #3258407: Remove unused Symfony 2.x methods from ExecutionContext
Comment #10
spokjeAdding the deprecation skip from #3351556-8: Update dependencies for Drupal 10.1/Add deprecation silencer on Drupal 10.0 to this patch would help reduce the noise?
Comment #11
andyposthttps://github.com/symfony/symfony/releases/tag/v6.3.0-BETA1
Comment #12
spokjeComment #13
spokjeComment #14
spokjeAs said by @longwave in #7:
So I added the return type PHPStan wanted.
Let's see where that gets us.
Comment #15
longwaveThanks! No need to postpone now the beta is out - we can release Drupal 10.1.0-beta1 on a beta or RC of Symfony.
Comment #17
spokjeSo what's our strategy here?
- Ignore all deprecations with one "mega" reg-ex in
core/.deprecation-ignore.txt- Ignore all deprecations with their own reg-ex in
core/.deprecation-ignore.txt, so we can tackle them individually in issues- Try to fix all and everything in here?
Comment #18
andypostLooks like this changes will break a lot of contrib as well, having tons of deprecation messages is worst we can expect in 10.1 release
As I got the most serious effect will get serializers (adding array return type)
The most useless (counterproductive) is void types
Comment #19
spokjeSo...
IIRC, adding a return type is a BC Break
Adding an explicit
@return voidmakes coder sad:If there is no return value for a function, there must not be a @return tagLooks like we need to ignore a lot of deprecation messages until D11?
Comment #20
longwaveWe need to check what will happen to subclasses in contrib/custom code - we need to ensure they are notified correctly so they can add the return types now, and then we can do the same in Drupal 11. Not sure whether that means adding exact deprecation skips, or using @return and adding ignores for Coder, or something else.
Comment #21
catchFor the normalizers/denormalizers I would think we can probably make the change directly since those aren't supposed to be extended, but whether that is actually true or not is a different question.
Comment #22
spokjehttp://codcontrib.hank.vps-private.net/search?text=Drupal%5Cserializatio...
Third normalizer I've randoml put through Hank has 2 Contrib Module extending it.
Comment #24
spokjeThe Symfony PR about this can be found here: https://github.com/symfony/symfony/pull/49291
Added a (very naive) MR for this.
AFAICT we're replacing our
with Symfony's
public function getSupportedTypes(?string $format): array.If that is the case can/should we try to deprecate our class property
$supportedInterfaceOrClass?Two more questions in the MR.
Comment #25
spokjehttps://github.com/symfony/symfony/releases/tag/v6.3.0-BETA2, updated MR.
Comment #26
andypostMR is not mergeable somehow
Comment #27
spokjeSorry, crappy rebaser at weekend work there...
Should be fixed now.
Comment #28
spokjeLooks like this is what's left when I aggregate the deprecation messages.
Comment #29
wim leers~90% of the changes in the current MR are for https://symfony.com/blog/new-in-symfony-6-3-performance-improvements#imp....
Symfony is now doing what we've been wanting since 2018 — see #3022583: [META] Normalization System: clean up/speed up/provide schema. Then Symfony shipped
CacheableSupportsMethodInterfacewhich was a step in the right direction — see #3031214-19: Introduce "deterministic" normalizers and #3252872: Use CacheableSupportsMethodInterface for performance improvement in normalizers.Now it's finally doing the sensible thing for serializing any slightly complex data structure, of which Drupal has plenty 😅
Great! 👍
Based on https://github.com/symfony/symfony/pull/49291's profiling, I expect this to make complex JSON:API responses significantly faster.
Comment #30
gábor hojtsyTagging for release notes and highlights for at least the JSON:API speed improvement.
Comment #31
andypostAttempt to fix doc-blocks
Comment #32
andypostWorkaround for phpcs
Comment #34
andypost2 more validators fixed, tests should be green but that means that not all validators are covered by tests
Comment #35
smustgrave commentedThis appears to be adding a ton of deprecation. Should there be an Omni change record for them? Also a ton of phpcs ignore lines. Should that rule just be disabled?
Comment #36
catchAgreed with #35, however I think we should open a follow-up to deal with the phpcs issue and just press ahead with ignoring here.
Tagging for
Let's open a follow-up, not sure that rule is actually useful if we have to be able to add these.
A single change record for ::hasCacheableSupportsMethod() seems OK although afaict it's really an upstream Symfony deprecation rather than ours, still useful to have the trigger_eror() though.
Comment #37
catchIf we just need the change record here then this is probably more 'needs review'.
Comment #38
spokjeI (maybe) see some more NW items:
- What about the open threads on the MR?
- What about
Comment #39
catchAdded the change record.
I'm getting confused between the patch and MR.
__NAMESPACE__ vs __CLASS__ this should be __CLASS__ I think.
Deprecating the property I also think we should move to a follow-up since we'll need to decide whether to deprecate or just remove the properties on normalizers.
I think this will be moved vs added boilerplate in the long run so better to just implement the method now.
Comment #40
andypostIt needs own issue for coder to dig if the rule valuable
But as this deprecation (requirement to add void) coming from SF at means all validators (at least) need to add this doc-block or :void to method which is no-go as API break
that's why doc-block update needs rector rule or kinda
Comment #41
smustgrave commentedChange record looks good.
Only other thing I see #34 mentions not all validators are covered. Should we open up follow ups for the ones not covered?
Comment #42
andypostRE #41 I'm sure yes, not every validator used in tests but will fire for contrib/custom code
Comment #43
smustgrave commentedOpened #3360103: Missing test coverage for some validators
Comment #44
effulgentsia commentedA reroll was needed due to #3358323: Update dependencies for Drupal 10.1. Here it is. The way I made it was by applying #34 but without the changes to composer.lock, CoreRecommended/composer.json, and PinnedDevDependencies/composer.json, followed by running
composer update drupal/core symfony/*.AFAICT, this is a clean reroll and ends up with the same state as #34 did. However, marking this as Needs Review so that someone else validates that.
Comment #45
smustgrave commentedCompared with the version numbers in #34 and reroll seems good.
Comment #46
catchStill think __NAMESPACE__ needs to be __CLASS__ in the deprecation messages?
Opened #3360124: Deprecate ::supportedInterfaceOrClass property on normalizer/denormalizers for the supportedInterfaceOrClass deprecation.
Comment #47
effulgentsia commentedOr even better, __METHOD__? This patch changes to that, moves the word "instead" to the end of the sentence, and links to the change record.
Comment #48
andypost++ to #47
Should we wait for next beta?
Comment #49
smustgrave commentedShould 10.2.x be an option now?
https://www.drupal.org/about/core/policies/core-release-cycles/schedule says the branch was created.
Comment #50
spokjeUnsure why we ended up in patch-land after starting out as an MR, but closed MR to prevent confusion.
Comment #52
spokjehttps://github.com/symfony/symfony/releases/tag/v6.3.0-BETA3
Comment #53
catchThis looks good.
We're holding off tagging the beta until this lands since having it in the beta is more likely to flush out anything unexpected affecting contrib.
I opened #3360152: Consider disabling the Drupal.Commenting.FunctionComment.VoidReturn rule for the @return void issue.
Comment #54
spokjehttps://git.drupalcode.org/project/drupal/-/merge_requests/3907#note_172971
(@catch in #39)
I think this needs to be done before we're ready for an RTBC, or am I reading this wrong and can this be done in a follow-up?
Comment #55
catchI opened #3360124: Deprecate ::supportedInterfaceOrClass property on normalizer/denormalizers for that.
Comment #56
spokjeThanks @catch, updated CR to the latest state of the patch.
I think this is now truly RTBC.
Comment #57
andypost+1 rtbc! All followups exist and beta3 happened
@Spokje I did switch to patch because there was broken UI to queue tests for MR for a few days.
Comment #58
spokjeThanks for clearing that up @andypost, I knew "something" was wrong, since you're normally not the one to switch between patches and MRs. :)
Comment #61
catchI RTBCed this but there's been +1s since then so I think I'm OK to commit it.
Committed/pushed to 11.x and cherry-picked to 10.1.x, thanks!
Comment #62
andypostCR could be published! Thank you!
Comment #63
effulgentsia commentedI published the CR.
Comment #64
andypostRC1 is out https://github.com/symfony/symfony/releases/tag/v6.3.0-RC1
Comment #65
andypostFiled #3361949: Update to Symfony 6.3 RC1