Skip to content

[FrameworkBundle] Deprecate setting the collect_serializer_data to false #60069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 31, 2025

Conversation

mtarld
Copy link
Contributor

@mtarld mtarld commented Mar 28, 2025

Q A
Branch? 7.3
Bug fix? no
New feature? no
Deprecations? yes
Issues
License MIT

Then, in 8.1, we'll be able to deprecate this option to finally remove it in 9.0

@nicolas-grekas
Copy link
Member

What's the rational? Didn't we add the option because the overhead was significant? Did anything change?

@mtarld mtarld force-pushed the feat/collect-serializer-data branch from f842425 to 5cf77b8 Compare March 28, 2025 08:56
@mtarld mtarld requested a review from chalasr as a code owner March 28, 2025 08:56
@mtarld
Copy link
Contributor Author

mtarld commented Mar 28, 2025

Back in time, we added that flag to prevent apps that were injecting concrete implementations instead of interfaces to break when upgrading to 6.1.

IIRC, there was no relation with any overhead at that time.

For the record, users doing:

public function __construct(ObjectNormalizer $normalizer) {}

instead of:

public function __construct(#[Autowire('...')] NormalizerInterface $normalizer) {}

had broken app when enabling the debug. That was why we have hidden the decoration behind a flag.

@mtarld
Copy link
Contributor Author

mtarld commented Mar 28, 2025

But maybe at least we can change the default? So that we can remove the recipe definition at some point?

Which means:

  • requiring to define explicitly the value in 7.3
  • change the default in 8.0

WDYT?

@mtarld
Copy link
Contributor Author

mtarld commented Mar 28, 2025

Here is the PR introducing the flag: #46625

@chalasr
Copy link
Member

chalasr commented Mar 28, 2025

Indeed, adding this option was a quick fix. It isn't meant to stay

@mtarld
Copy link
Contributor Author

mtarld commented Mar 28, 2025

There are still few tests to fix for information

@fabpot
Copy link
Member

fabpot commented Mar 28, 2025

Why not deprecate the option instead?

@mtarld
Copy link
Contributor Author

mtarld commented Mar 28, 2025

Because the actual default value is false, and I want to have a true in the end, I think the steps should be:

  • deprecate not setting the value to true (7.3)
  • deprecate the config option (8.1) - as it'll be true for sure
  • remove the config option (9.0)

Deprecating the config option directly (and therefore removing it in 8.0) will not allow users to adapt their code first.

But it may be ok for such a change. WDYT?

@chalasr
Copy link
Member

chalasr commented Mar 28, 2025

Deprecating the option sounds good to me. The notice is what will actually urge people to fix their code so that it works with the serializer collector, no matter if it's about changing the default or removing that option. I think the latter gives enough time, no need for more.

@mtarld mtarld force-pushed the feat/collect-serializer-data branch 2 times, most recently from fcf4b27 to 2f40ad4 Compare March 29, 2025 10:15
@mtarld
Copy link
Contributor Author

mtarld commented Mar 29, 2025

The related tests are fixed now.

@mtarld mtarld force-pushed the feat/collect-serializer-data branch from 2f40ad4 to fda5371 Compare March 31, 2025 09:03
@nicolas-grekas
Copy link
Member

@chalasr if you mean deprecating the option whatever the value, then I don't agree: this would annoy people that just updated their recipe / created a new project since 6.1, while at the same time create a migration risk, with a leaky BC layer.

@chalasr
Copy link
Member

chalasr commented Mar 31, 2025

Fair enough

@nicolas-grekas
Copy link
Member

In the upgrade note, it might be nice to tell about what you wrote in #60069 (comment) BTW.

@mtarld mtarld force-pushed the feat/collect-serializer-data branch from fda5371 to 29c7562 Compare March 31, 2025 15:28
@mtarld
Copy link
Contributor Author

mtarld commented Mar 31, 2025

@mtarld mtarld force-pushed the feat/collect-serializer-data branch from 29c7562 to 408d09a Compare March 31, 2025 15:34
@nicolas-grekas
Copy link
Member

Thank you @mtarld.

@nicolas-grekas nicolas-grekas merged commit 58a14ab into symfony:7.3 Mar 31, 2025
10 checks passed
@mtarld mtarld deleted the feat/collect-serializer-data branch March 31, 2025 15:47
@fabpot fabpot mentioned this pull request May 2, 2025
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull request May 28, 2025
…ializer_data` option (xabbuh)

This PR was merged into the 7.3 branch.

Discussion
----------

[FrameworkBundle] fix default value for the `collect_serializer_data` option

If I don't miss anything, symfony/symfony#60069 didn't change the default value.

Commits
-------

4545364 fix default value for the "collect_serializer_data" option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy