-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix(hosting-overview-refinements): fix rendering atomic website as simple #93843
fix(hosting-overview-refinements): fix rendering atomic website as simple #93843
Conversation
Jetpack Cloud live (direct link)
Automattic for Agencies live (direct link)
|
This PR modifies the release build for the following Calypso Apps: For info about this notification, see here: PCYsg-OT6-p2
To test WordPress.com changes, run |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~174 bytes added 📈 [gzipped])
Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~32 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
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.
I did a quick assessment to determine if #93503 might have fixed this bug, but I don't think it did.
I also left some comments yesterday on Slack. This review follows up on those comments and adds another idea.
@nightnei, let's also merge trunk
into this before the next review, since there might be some conflicts to resolve.
export const queryKeyForAllSitesWithThemeSlug = [ | ||
USE_SITE_EXCERPTS_QUERY_KEY, | ||
SITE_EXCERPT_REQUEST_FIELDS, | ||
SITE_EXCERPT_REQUEST_OPTIONS, | ||
[], | ||
'all', | ||
[], | ||
[ 'theme_slug' ], | ||
]; | ||
|
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.
Closing the loop: I mentioned on Slack that I think we should replace this with a getUseSiteExcerptsQueryKey
function. That function should be used internally in useSiteExcerptsQuery
and when invalidating the query.
@@ -91,8 +94,11 @@ const HostingFeatures = () => { | |||
|
|||
if ( siteTransferData?.status === transferStates.COMPLETED ) { | |||
dispatch( fetchAtomicTransfer( siteId ) as unknown as AnyAction ); | |||
queryClient.invalidateQueries( { | |||
queryKey: queryKeyForAllSitesWithThemeSlug, |
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.
We should use getUseSiteExcerptsQueryKey
here. @nightnei and I discussed how we can ensure that we target the exact same query key that's used in client/hosting/sites/components/sites-dashboard.tsx
, but I think we should consider not doing that.
By specifying a shorter key when invalidating queries, react-query
will invalidate all queries with longer keys matching that prefix. For example, if we invalidate the key ['sites']
, queries for ['sites', 'all']
will also be invalidated.
This seems like an appropriate case to make use of that. We can invalidate all useSiteExcerptsQuery
instances where site_visibility === all
and just not specify additional_fields
and additional_options
.
Thoughts, @nightnei?
Related to https://github.com/Automattic/dotcom-forge/issues/8771
Why are these changes being made?
When a site becomes atomic and we redirect a user from "Hosting Features" to "Hosting Overview" - we can notice that we have fglash of incorrect state of UI - initially we see UI from Atomic website and then i an few seconds we see incorrect UI, for Simple site (but the site is Atomic).
Testing Instructions
Before testing, recommend watching this video and reading the description there p1724404907834529/1724373252.261939-slack-C06ELHR6L9J
A4A tests
https://agencies.automattic.com/
Sites
in left sidebarhttp://calypso.localhost:3000/hosting-features/<COPYED_DOMAIN_IN_7TH_STEP>
Manually turning on Hosting Features
Starter
planA
during testing)B
during testing, we will use it in the end for testing)Upgrade now
and proceed with upgradingC
during testing, we will use it in the end for testing), so that you will have the next tabsB
andC
:A
clickActivate now
and proceed