-
Notifications
You must be signed in to change notification settings - Fork 466
refactor: prepare deprecations for v3 removal #3400
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
Conversation
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.
Pull Request Overview
This PR prepares the WPGraphQL codebase for v3.0 by reorganizing deprecated functionality and improving deprecation warnings. The primary goal is to consolidate deprecated code and provide clearer messaging about upcoming removals to help both human developers and AI/LLM agents understand what is actually relevant in the codebase.
- Creates a new
WPGraphQL\Deprecatedclass to handle deprecated functionality registration - Moves deprecated classes to a new
/deprecateddirectory (added to Composer classmap) - Updates existing deprecation warnings to explicitly mention removal in the next major version
Reviewed Changes
Copilot reviewed 40 out of 42 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/WPGraphQL.php | Adds deprecated functionality initialization and removes inline deprecated filter |
| src/Deprecated.php | New class consolidating all deprecated type and field registrations |
| deprecated/*.php | Relocated deprecated classes with updated warning messages |
| src/Type/ObjectType/RootQuery.php | Removes deprecated postBy field registration (moved to Deprecated class) |
| src/Type/ObjectType/MenuItem.php | Removes deprecated connectedObject field (moved to Deprecated class) |
| src/Registry/TypeRegistry.php | Removes deprecated union type registrations (moved to Deprecated class) |
| src/Model/Post.php | Updates sourceUrlsBySize deprecation message |
| src/Router.php | Moves deprecated is_graphql_request method to end of class with updated warning |
| composer.json | Adds deprecated/ directory to classmap |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
Good work! Will go through more thoroughly tomorrow 🙌 |
What does this implement/fix? Explain your changes.
This PR prepares the groundwork for removing deprecated parts of the codebase in WPGraphQL v3.0,
/deprecateddirectory (added by Composer ClassMap)WPGraphQL/Deprecated.phpclass.While code quality and cleanliness have always been nice - and a lot of these removals were already slated for 3.0, the impact of having this old code on agents and LLMs is becoming a major hinderance. So isolating things now and making it clearer that these things are not actually relevant to the codebase will be immediately helpful for both humans and 🤖
Does this close any currently open issues?
Any other comments?