-
Notifications
You must be signed in to change notification settings - Fork 2k
Dashboard v2: Implement PHP version settings #103668
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
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 (~257 bytes added 📈 [gzipped]) Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~18 bytes removed 📉 [gzipped]) Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. 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. |
taipeicoder
left a comment
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.
Needs rebasing, but otherwise looks good to me.
|
Nevermind, missed the issue linked in description. |
| fields: [ 'version' ], | ||
| }; | ||
|
|
||
| const isDirty = formData.version !== 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.
Nit: Would it make sense to name version to currentVersion for better readability, and in case formData.version is deconstructed?
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.
Good idea, done!
| loader: async ( { params: { siteSlug } } ) => { | ||
| const site = await queryClient.ensureQueryData( siteQuery( siteSlug ) ); | ||
| if ( canUpdatePHPVersion( site ) ) { | ||
| return await queryClient.ensureQueryData( sitePHPVersionQuery( siteSlug ) ); |
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.
Nit: no need to return anything
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.
Addressing it in #103702
| } ); | ||
| }; | ||
|
|
||
| const renderForm = () => { |
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 an inline function? I've always found these weird. Why not render it in canUpdate ? ... : ...? Or make a new component if it needs to be reusable?
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 think it's just a matter of taste; I just find it's easier to read / follow instead of a giant ternary :)
Maybe @taipeicoder can update it when you implement the upsell 🙈
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.
It's fine, I just don't often see it I guess :)
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.
Addressing it in #103702
Part of DOTCOM-13239
Proposed Changes
This PR implements Settings -> PHP as follows.
Simple sites
In simple sites, we don't know the PHP version, and we don't advertise it. See discussion: p1747972441625309-slack-C08JZTRS6NA
The upsell will be handled separately as DOTCOM-13292.
Atomic sites
We show a warning badge if the version is not the recommended one.
While working on it, I found that the "Select item" placeholder option in the
<select>is still selectable... filed DOTCOM-13298.Pre-merge Checklist