Experiment to speed up deeplink connection from WP.com#2375
Experiment to speed up deeplink connection from WP.com#2375katinthehatsite wants to merge 1 commit intotrunkfrom
Conversation
📊 Performance Test ResultsComparing 11f9f3b vs trunk site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change |
|
The code needs to be polished quite a bit so I am leaving this PR as a draft. What I am looking for is the feedback on the approach before adding any further polishing touches - does it make sense? is there a different way we could optimize the speed of connection that could be simpler? One thing I dislike is creating a "fictional" site object that could potentially cause racing conditions and similar issues. Any opinions are welcome! One option as an alternative that comes to mind could be adding a loading state to Sync tab if the user is connecting a site from deeplink and it is taking time. This way, they could have a visual indication of what is happening and this could be a simple and fast improvement in terms of the UX. |
sejas
left a comment
There was a problem hiding this comment.
Thanks for exploring how to speed up the deeplink connection.
In general the approach makes sense to me. Loading an optimistic connection until we fetch more information.
My concern is if we display wrong data, like isStaging, or isPressable. With the current flow where the user purchase a new site, those will always be false, but in the future we could add more deeplinks in Calypso.
What if we show a loading skeleton until we fetch the information?
As mentioned below, we can optimize the fetch call to get only the information for that specific site.
| } | ||
|
|
||
| // Fetch full site data in background (don't await - parallel operation) | ||
| const refetchPromise = refetchWpComSites(); |
There was a problem hiding this comment.
Another optimization could be fetching only the information of the remoteSiteId. Currently fetching all the sites takes longer, specially for Automatticians.
| const minimalSite: SyncSite = { | ||
| id: remoteSiteId, | ||
| localSiteId: studioSiteId, | ||
| name: siteName || 'Loading site...', // Use provided name or placeholder |
There was a problem hiding this comment.
We need to translate the placeholder.
Related issues
Related to STU-1173
Proposed Changes
This PR explores the speeding up of the deeplink connection from WP.com e.g. connecting a WP.com site and opening a modal. In this PR, I am using an optimistic connection approach:
Testing Instructions
SynctabPublish sitebutton displays in the top right cornerPublish sitebuttonSynctabLoading site...placeholder and no URL in theSynctab (because we need to pass these from Calypso and that needs to be done in the separate PR)Pushmodal is openPre-merge Checklist