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
Promote fetchLinkSuggestions to non-experimental API w/out hard deprecation #41183
base: trunk
Are you sure you want to change the base?
Promote fetchLinkSuggestions to non-experimental API w/out hard deprecation #41183
Conversation
Size Change: +45 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
deprecated( 'wp.coreData.__experimentalFetchLinkSuggestions', { | ||
since: '6.1', | ||
alternative: 'wp.coreData.fetchLinkSuggestions', | ||
} ); |
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.
deprecated( 'wp.coreData.__experimentalFetchLinkSuggestions', { | |
since: '6.1', | |
alternative: 'wp.coreData.fetchLinkSuggestions', | |
} ); | |
deprecated( 'wp.coreData.__experimentalFetchLinkSuggestions', { | |
since: '6.1', | |
version: '6.2', | |
alternative: 'wp.coreData.fetchLinkSuggestions', | |
} ); |
Thanks for proposing this alternative and for your well reasoned arguments about why it might be necessary.
Please could I check - are you suggesting that we support this prefixed version indefinitely?
I understand the arguments around soft deprecation and backwards compatibility in WordPress. However, it does set a precedent that any future experimental APIs should also be handled thus and therefore will remain in the codebase forever.
The contract was always "these are experimental and might be changed without warning". That is undermined slightly by how long the API has been experimental, but the expectations were set out in the project.
Perhaps a good middle ground would be using the version
argument:
Version in which the feature will be removed.
This means we will remove the __experimental
code in 6.2
(docs). That addresses both:
- the concern around bloating the codebase.
- the concern about hard deprecating APIs that have been around for a long time.
It affords folks time to update their codebases whilst also retaining the spirit of the __experimental
contract.
What do you think @youknowriad @mtias?
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.
Yes, I am proposing this be maintained well in to the future.
I disagree that was the contract in WordPress Core, it was only the contract in the plugin.
This strategy won’t be applied in Core because it’s very important that we continue to maintain the user trust with auto-updates and there’s no intention in changing that in the future.
Original emphasis, source
As I mentioned on #40316, this lose of faith in auto-updates is happening.
We, WordPress Committers, made a mistake exposing the experimental APIs in WordPress Core. I deliberately use the word "we" because that includes me for not monitoring editor commits as closely as I could have prior to my role on the release squad for WP 6.0.
What?
Identical goal to #40052.
This PR adds a soft deprecation to prevent sites breaking in 3c21c52 -- everything else is from @getdave's original pull request.
Why?
The developer API has been stable for some time and treated as such by Gutenberg, WordPress Core and third-party plugin developers.
Moving straight to hard deprecation will break sites and goes against the WP policy of not breaking backward compatibility.
How?
All renaming code is taken from #40052.
In addition it adds a deprecated.js file within the core-data package for maintaining
__experimentalFetchLinkSuggestions
.I've listed the deprecated
since
tag as 6.1 as it appears deprecations use the WP version rather than the plugin version. Please correct me if this is incorrect.Testing Instructions
Per #40052, additionally:
wp.coreData.__experimentalFetchLinkSuggestions()
is exposed in the consolewp.coreData.__experimentalFetchLinkSuggestions( 'sample' );
in the console throws a deprecation warningwp.coreData.__experimentalFetchLinkSuggestions( 'sample' );
in the console returns the same results as the unprefixed functionScreenshots or screencast