-
Notifications
You must be signed in to change notification settings - Fork 295
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
Deprecate legacy functions with modern alternatives and prune dead code #2418
Comments
@aaemnnosttv Can you give some examples of which functions you're thinking about? |
@felixarntz off the top of my head: |
We actually have a number of utils which are completely unused now, such as |
IB ✅ I wonder about "annotate the getSiteKitAdminURL function with Handing this over to @aaemnnosttv as he touched the ACs most recently. @aaemnnosttv Any reason to keep that function around instead of removing it and its test file ( |
(The ACs mentioned to deprecate anything that was still being used, but in this case IB ✅ |
@tofumatt During execution I have discovered that |
In that case let's use the Better to rely on that everywhere and remove the legacy component than to keep a lot of stuff around for that one file. You can see an example of site-kit-wp/assets/js/components/higherorder/withData.js Lines 374 to 380 in fea5312
|
QA ✅Confirming all code removed as per IB Tests and VRTs all pass on |
Feature Description
There are a number of legacy functions in the codebase which have newer implementations which should be used instead for all new usage.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
getSiteKitAdminURL
- replaced byselect( CORE_SITE ).getAdminURL(...)
) should be annotated as@deprecated n.e.x.t Use x instead.
assets/js/util/index.js
Implementation Brief
Delete the following from
assets/js/util
:refresh-authentication.js
average-object-list-value.js
cache-data.js
Using
assets/js/util/index.js
delete the following functions:removeURLFallBack
removeURLParameter
getDaysBetweenDates
validateOptimizeID
Delete the following from
assets/js/util/test
:removeURLParameter.js
getDaysBetweenDates.js
validateOptimizeID.js
getSiteKitAdminURL.js
averageObjectListValue.js
In the following components remove the import of
getSiteKitAdminURL
and replace calls to it with the store equivalentuseSelect( ( select ) => select( CORE_SITE ).getAdminURL( page , args ) )
. In each case add imports foruseSelect
andCORE_SITE
:js/components/data-table
js/components/legacy-setup/SetupUsingGCP
js/components/setup/ModuleSetup
js/modules/adsense/components/dashboard/LegacyAdsenseDashboardMainSummary
In
js/util/index
remove thegetSiteKitAdminURL
function and its tests inassets/js/util/test/getSiteKitAdminURL.js
Test Coverage
Visual Regression Changes
QA Brief
As per the IB, check:
util
files have been deletedindex.js
getSiteKitAdminURL
have been replacedAlso check js and VRT tests pass.
Changelog entry
The text was updated successfully, but these errors were encountered: