Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Drop more usages of Serializable#30286
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
OskarStark commentedFeb 18, 2019
Typo: |
ec32e2d to6162229Comparealexpott commentedFeb 19, 2019
Drupal extends |
nicolas-grekas commentedFeb 19, 2019
@alexpott thanks, then the plan for Drupal should be to stop calling |
Uh oh!
There was an error while loading.Please reload this page.
37674f1 to66b50bfCompare
fabpot left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I would remove the possibility to serialize a Kernel as I don't see (anymore) the use cases.
966d44a to856ae9fComparenicolas-grekas commentedFeb 23, 2019
Actually, that's not possible: the kernel is serialized in FrameworkBundle for insulated tests, see
|
856ae9f to05d6475Comparefabpot commentedMar 4, 2019
Thank you@nicolas-grekas. |
This PR was merged into the 4.3-dev branch.Discussion----------Drop more usages of Serializable| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | no| Deprecations? | yes| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -When the serialized payload of some class is used for ephemeral needs, my proposal here is to drop implementing `Serializable` and provide a deprecation layer based on `__sleep` to still call the `serialize`/`unserialize` methods. This means that at the behavior level, we provide BC, and at the payload level, we don't.That leaves us with only two "not ephemeral" use cases:- `Route` and `CompilerRoute` instances are serialized by Drupal. We'd better not break such existing payloads without being sure it's ok for Drupal (ping@alexpott). My proposal in this PR is to schedule the BC break for Symfony 5, and ask Drupal (and others) to add a check in their unserialization logic so that they are able to recompile the cached list of routes if unserialize fails due to this change. They could alternatively implement `Serializable` on their own, without calling `parent::(un)serialize()`.- `TokenInterface` from `Security` - for this one, I have no idea yet, except either plan for breaking BC at the payload level (which would mean invalidating all sessions when moving to SF5) - or create a new interface if we think breaking sessions is not reasonable. For now, I've kept using `Serializable`, which could be also fine keeping if we mark the corresponding method `final` to forceWDYT?Commits-------05d6475 Drop more usages of Serializable
Tobion commentedJun 5, 2019
…(Tobion)This PR was merged into the 4.3 branch.Discussion----------[Routing] revert deprecation of Serializable in routing| Q | A| ------------- | ---| Branch? | 4.3| Bug fix? | no| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks? | no <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets || License | MIT| Doc PR |we still need to implement Serializable as long as we support PHP < 7.4. otherwise serialized data in php 7.2 would not work anymore when people upgrade to php 7.4. see discussion in#31792 (comment)partly reverts#30286Commits-------d32a295 [Routing] revert deprecation of Serializable in routing
This PR was merged into the 5.0-dev branch.Discussion----------[Routing] remove deprecations| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no <!-- please update src/**/CHANGELOG.md files -->| BC breaks? | yes <!-- seehttps://symfony.com/bc -->| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->| Tests pass? | yes <!-- please add some, will be required by reviewers -->| Fixed tickets || License | MIT| Doc PR |Ref.#30249,#30286,#24894Commits-------5beb5f8 [Routing] remove deprecations
Uh oh!
There was an error while loading.Please reload this page.
When the serialized payload of some class is used for ephemeral needs, my proposal here is to drop implementing
Serializableand provide a deprecation layer based on__sleepto still call theserialize/unserializemethods. This means that at the behavior level, we provide BC, and at the payload level, we don't.That leaves us with only two "not ephemeral" use cases:
RouteandCompilerRouteinstances are serialized by Drupal. We'd better not break such existing payloads without being sure it's ok for Drupal (ping@alexpott). My proposal in this PR is to schedule the BC break for Symfony 5, and ask Drupal (and others) to add a check in their unserialization logic so that they are able to recompile the cached list of routes if unserialize fails due to this change. They could alternatively implementSerializableon their own, without callingparent::(un)serialize().TokenInterfacefromSecurity- for this one, I have no idea yet, except either plan for breaking BC at the payload level (which would mean invalidating all sessions when moving to SF5) - or create a new interface if we think breaking sessions is not reasonable. For now, I've kept usingSerializable, which could be also fine keeping if we mark the corresponding methodfinalto forceWDYT?