-
Notifications
You must be signed in to change notification settings - Fork 825
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
SPIKE Figure out best way to remove deprecated API from codebase and provide a transition path #10400
Comments
I've spent some time investigating this, my recommendations:
|
I think what was meant by "the symfony approach" is that any time we replace API in CMS 5, we deprecate the old API and provide its replacement in CMS 4. This means that someone on the last minor of CMS 4 can resolve all of their deprecation warnings and then when they upgrade to CMS 5 they'll have little to no changes required. |
On the whole I agree with the recommended approach - though I think we should set |
Yes that's correct about the 'not always feasible' bit. Just to clarify, part of my recommendation is to guide projects that are upgrading to put |
@silverstripe/core-team Any views on this? |
We could disable deprecation warnings globally during tests by adding something into |
Yes that makes sense
The automation portion is mostly just to add The manual work of actually updating our code to use the new API's is totally separate.
We have the "current version" set to
It's not going to be possible in many cases, because the new API won't be available in the CMS 4. The best we can really do is say "change your code to use this new API that will be available in CMS 5"
No, my experience with rector was truly awful. It's also fundamentally the wrong tool for what we're doing here. My recommendation for automation is consistently use |
That makes sense. To the extent that we're saying "this deprecated method is no longer suitable ... use this other one instead or don't use it at all", I think we should be making an effort to make sure our code doesn't rely on it. But I appreciate their will be scenarios where this is impractical. For the scenario where a test is specifically aimed at a deprecated method, could we do something like "skip this test if For CMS6, I think that we should set a clear expectation that if we mark something as deprecated, it really shouldn't be used in our own current code base anymore. |
I think those 3 cards cover all the outcomes from the SPIKE. |
All done. We have clear next steps. |
CMS 4 has many API marked for deprecations.
Objectives
Timebox
1 day
Note
Deprecation::notice()
should have a version set to 5.0.0 (i.e. the version the API will be removed in)Deprecation::notification_version('4.0.0');
in its_config.php
file. Setting this to '5.0.0' will mean any deprecation notices sent via this class will be thrown asE_USER_DEPRECATED
warnings on the front-end.Deprecation::set_enabled(true);
in their project's_config.php
file or usingSS_DEPRECATION_ENABLED="0"
in their.env
file.@deprecated
phpdoc - we will need a separate mechanism to throw warnings for these.The text was updated successfully, but these errors were encountered: