-
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
Monitoring: Update monitoring charts to get colors from color studio #95550
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 (~14102 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. 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. |
This should be more future-proof than assuming the values coming from color studio are hex codes.
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.
The change looks clear, and works as expected.
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 confirm I see the new colors.
I'm unsure of using chroma-js
, it adds ~14102 bytes added 📈 [gzipped]
to the loaded JS .
@matt-west, what do you think about using regular constants for those colors?
If we decide that loading that library is worth it for this use case, then we should move it to dependencies
in pacakge.json
.
@@ -260,7 +261,7 @@ | |||
"bunyan": "^1.8.15", | |||
"chalk": "^4.1.2", | |||
"check-node-version": "^4.0.2", | |||
"chroma-js": "^2.1.2", | |||
"chroma-js": "^2.6.0", |
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'm seeing chroma-js is imported as devDependencies
. They only other place it's used is in NodeJS:
wp-calypso/bin/audit-svg-colors.js
Line 18 in a54137c
const chroma = require( 'chroma-js' ); |
We can consider creating a follow-up PR and undoing the changes about |
@sejas I decided to use Ideally we’d have a function in the colour-studio package itself to generate alpha hex codes, but we’re not quite there yet. I'll create a follow-up that uses a different approach. |
Fixes https://github.com/Automattic/dotcom-forge/issues/9474
Proposed Changes
chroma
package to automatically generate transparent colors, future-proofing against future changes to the color-studio package.Left: Before | Right: After
Why are these changes being made?
Testing Instructions
/site-monitoring/[domain]