-
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
Remove unused legacy JS code after removal of legacy components and data API #3646
Comments
@felixarntz I added ACs here to move this forward as it seems fairly straightforward in its purpose 🙂 Let me know if there's anything else missing when you get back! |
From what I can see, the entirely of Are all of the legacy notifications set to go? I didn't think they were and couldn't find a ticket saying so, but maybe I missed it. 😅 |
@tofumatt good catch – this is actually something that seems to have been missed when removing the dataAPI. Legacy notifications are still relevant and don't have a replacement yet so we need to keep these around for now. Regarding the action you referenced, this can be removed and the total can be fetched right away as there is no longer a collective batch request that is needed to wait for site-kit-wp/assets/js/components/legacy-notifications/notification-counter.js Lines 60 to 62 in d77d4fc
This error message still needs to come from the server though to map the error code we get in the URL to the error message by the oAuth client site-kit-wp/includes/Core/Authentication/Authentication.php Lines 795 to 800 in 03a2586
If it was only used in the client, we could maybe move this to the client side but that's a bit out of scope for this issue, although something to potentially consider in the future. As noted in the TODO comment there, we can't do that without also changing the default returned by the datapoint handler on the server side as it currently defaults to web context only if not provided. This issue is about removing unused JS so I would say this is probably out of scope, but it looks like a safe change to make. @felixarntz ?
Not sure why this was added but I'm guessing due to the use of the Even if that were removed, we wouldn't remove the index module for a module because it provides important exports (e.g.
As mentioned before the
As mentioned above, we should remove the use of the unused action from this component but the counter module and legacy notifications |
Ah, I thought that Should be ready for another look, thanks! 👍🏻 |
IB ✅ |
@tofumatt @aaemnnosttv IB also LGTM from my end - I think it's reasonable to make the one Tag Manager API change as well, even though that is technically a breaking change on the server-side since we're changing the default. Should be okay this time though. |
@ivankruchkoff, please, add QAB. |
QA ✅
|
Now that all legacy widget components have been removed (see #1997 and #2077) and the legacy data API as well (see #2258), we should go through the JS codebase again (after a similar issue earlier, #2418) and look for unused code that can be removed.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Most of the definition here will be searching through the codebase.
addAction
andaddFilter
to make sure any remaining uses are still valid/data
REST endpoint are removed (e.g in E2E request interception - search forv1/data
)TODO
comments to ensure there are none left in the code that are actionable related to the removed legacy widgets and dataAPIImplementation Brief
(See #3799 for a PR that removes request interception in E2E tests as a starting point for this issue.)
v1/data
API callsusageContext
param fromcontrolCallback
inassets/js/modules/tagmanager/datastore/containers.js
. This also involves changing both instances of$usage_context = $data['usageContext'] ?: self::USAGE_CONTEXT_WEB;
in/Users/matt/Projects/site-kit-wp/includes/Modules/Tag_Manager.php
to be$usage_context = $data['usageContext'] ?: array( self::USAGE_CONTEXT_WEB, self::USAGE_CONTEXT_AMP );
includes/Modules/Tag_Manager.php
, routeGET:tag-permission
, always set$container_id = $data['containerID'];
tests/e2e/specs/modules/search-console/dashboard-date-range.test.js
(TODO The module pages use the Widget API.
)assets/js/components/SignIn.js
addAction
andaddFilter
calls:addFilter( 'googlesitekit.AdSenseDashboardZeroData', 'googlesitekit.AdSenseDashboardZeroDataRefactored'
assets/js/components/legacy-notifications/notification-counter
to callgetTotalNotifications()
immediately oncomponentDidMount()
—remove theaddAction()
andremoveAction()
calls.Test Coverage
Visual Regression Changes
QA Brief
assets/js/components/SignIn.js
is gone.Changelog entry
The text was updated successfully, but these errors were encountered: