-
Notifications
You must be signed in to change notification settings - Fork 2k
Dashboard v2: Implement WP version settings #103560
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
base: trunk
Are you sure you want to change the base?
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: App Entrypoints (~8746 bytes removed 📉 [gzipped])
Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. 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. |
12291bf
to
114c38f
Compare
114c38f
to
30f4fc6
Compare
@@ -86,6 +86,26 @@ export const fetchPHPVersion = async ( id: string ): Promise< string | undefined | |||
} ); | |||
}; | |||
|
|||
export const fetchWordPressVersion = async ( siteIdOrSlug: string ): Promise< string > => { | |||
return wpcom.req.get( { | |||
path: `/sites/${ siteIdOrSlug }/hosting/wp-version`, |
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 couldn't find any docs to this endpoint. Can you share if you have a link that I missed?
Does it just return latest
or beta
? Do we need these labels (in design spec or if we deem them useful)?
Can we get this info and the WP version from a single place?
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.
There's a whole project for this feature: pesfPa-qt-p2.
Yes, the endpoint just return either latest
or beta
. Also, this is how it looks in dashboard v1:

I'm really hesitant to change the endpoint (it would break v1 or whatnot) or the core design of this feature for now... porting features to v2 and changing the functionalities should be different activities.
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.
porting features to v2 and changing the functionalities should be different activities.
Agreed, but we should track what we can improve and/or simplify. I might be missing context, but I think we should consider getting WP info from a single endpoint (probably remove this one and update the calls of v1).
Additionally, not for this PR, we might want to revisit the design for this and add some help text about the options.
@@ -0,0 +1,5 @@ | |||
import { Site } from '../../data/types'; | |||
|
|||
export function canUpdateWordPressVersion( site: Site ) { |
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.
Why is this not a "feature", why should we check the "type" of site?
import { __ } from '@wordpress/i18n'; | ||
import type { Site } from '../data/types'; | ||
|
||
export function getWordPressVersionTagName( versionTag: string ) { |
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.
Does this function bring any value, it feels we can just use the strings inline where it's currently used.
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.
Not really 100% sure either to be honest, the only difference is that it's translated 🤔
Part of DOTCOM-13166
Proposed Changes
This PR implements the WordPress version settings in dashboard v2.
Simple and Atomic sites
Staging sites
Testing Instructions
Pre-merge Checklist