Skip to content
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

Environment Badge: add Store Sandbox dev helper #91653

Merged
merged 11 commits into from
Jun 12, 2024

Conversation

michaeldcain
Copy link
Member

@michaeldcain michaeldcain commented Jun 10, 2024

This adds a Store Sandbox dev helper to the environment badge in development and wpcalypso environments. It shows the current Store Sandbox status and allows the user to toggle Store Sandbox on/off.

Screenshot 2024-06-10 at 11 04 36 PM

Requires: D151699-code
See: https://github.com/Automattic/payments-shilling/issues/2466
Fixes: https://github.com/Automattic/payments-shilling/issues/2863

To test:

  • with D151699-code applied, sandbox public-api.wordpress.com
  • visit calypso.localhost:3000
  • hover over the environment badge
  • verify that you see the Store Sandbox helper
  • if Store Sandbox is enabled (via the constant, cookie, or guest ticket method), verify that the Store Sandbox label is red
  • if Store Sandbox is disabled, verify that the label matches the other dev helpers
  • hover over the dev helper
  • use the toggle to turn on/off Store Sandbox

@michaeldcain michaeldcain requested a review from a team June 10, 2024 21:36
@michaeldcain michaeldcain self-assigned this Jun 10, 2024
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 10, 2024
@matticbot
Copy link
Contributor

matticbot commented Jun 10, 2024

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~1598 bytes added 📈 [gzipped])

name                   parsed_size           gzip_size
entry-stepper              +1018 B  (+0.0%)     +283 B  (+0.0%)
entry-main                 +1018 B  (+0.1%)     +282 B  (+0.1%)
entry-login                 +888 B  (+0.1%)     +192 B  (+0.0%)
entry-subscriptions         +312 B  (+0.0%)     +175 B  (+0.0%)
entry-domains-landing       +312 B  (+0.0%)     +111 B  (+0.1%)
entry-browsehappy           +312 B  (+0.1%)     +111 B  (+0.2%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Async-loaded Components (~14718 bytes added 📈 [gzipped])

name                                         parsed_size         gzip_size
async-load-calypso-lib-store-sandbox-helper     +50689 B  (new)   +14718 B  (new)

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.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@michaeldcain michaeldcain marked this pull request as ready for review June 11, 2024 03:27
Copy link
Contributor

@DavidRothstein DavidRothstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great! Just left a couple inline comments.

This adds a Store Sandbox dev helper to the environment badge in development and wpcalypso environments.

What is the final set of environments it should be enabled on?

Definitely it's needed in staging (though I guess you wanted to hold off on that for now until the feature is fully ready to "launch"?). For the other environments, it's clearly valuable, but they are publicly accessible and people can access those environments without being proxied, in which case the toggle won't actually work. Maybe it's good as long as we do a followup to show people the status but disable the toggle when it can't be used.

client/lib/store-sandbox-helper/index.tsx Show resolved Hide resolved
client/lib/store-sandbox-helper/index.tsx Show resolved Hide resolved
@matticbot
Copy link
Contributor

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • notifications
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/dev-helper-store-sandbox on your sandbox.

@michaeldcain michaeldcain merged commit bf8a94a into trunk Jun 12, 2024
11 checks passed
@michaeldcain michaeldcain deleted the add/dev-helper-store-sandbox branch June 12, 2024 20:46
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants