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

Calypsoify: Remove unnecessary redirect #17286

Merged
merged 2 commits into from
Sep 28, 2020

Conversation

tyxla
Copy link
Member

@tyxla tyxla commented Sep 28, 2020

Currently, if we've specified ?calypsoify=1 or ?calypsoify=0, we redirect after we set the user meta.

While this works, a redirect here is really unnecessary, because we can just enable or disable the flag if this argument is set.

A redirect was needed in the original internal plugin version because it works with cookies; while here, we just set a user meta.

This PR removes the redirect and sets the is_calypsoify_enabled module flag early enough so we could benefit from it without a redirect.

The reason to remove this is outlined in p4TIVU-9p3-p2 - this extra redirect increases the time for Calypsoified editor to load in Calypso. By removing the redirect, we're increasing the perceived performance of the Calypsoified block editor in Calypso.

Changes proposed in this Pull Request:

  • Calypsoify: Remove unnecessary redirect and set is_calypsoify_enabled flag early

Jetpack product discussion

This is related to a similar optimization we're doing on the WP.com side of Calypsoify: D50124-code

Does this pull request change what data or activity we track or use?

No, this change doesn't change any data that we track or use.

Testing instructions:

  • Start testing with on a Jetpack or Atomic test site.
  • Load a wp-admin page with the calypsoify query parameter set as 1, such as /wp-admin/plugins.php?calypsoify=1 and verify you get a calypsoified view.
  • Load a wp-admin page with the calypsoify query parameter set as 0, such as /wp-admin/plugins.php?calypsoify=0 and verify you get a default, non-calypsoified wp-admin view.
  • After each of the calypsoify query param test steps above, remove the calypsoify parameter, and try again. Verify you can see the same you were seeing with the parameter.
  • After you've visited the URL with calypsoify enabled ?calypsoify=1, load /wp-admin and verify you no longer get Calypsoify. A redirect should follow, that is expected behavior here 😉

Proposed changelog entry for your changes:

  • Calypsoify: Remove unnecessary redirect and set is_calypsoify_enabled flag early.

Currently, if we've specified `?calypsoify=1` or `?calypsoify=0`, we redirect after we set the user meta.

While this works, a redirect here is really unnecessary, because we can just enable or disable the flag if this argument is set. 

A redirect was needed in the original internal plugin version, because it works with cookies; while here, we just set a user meta.
@tyxla tyxla added [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it [Focus] Performance [Status] Needs Review To request a review from Crew. Label will be renamed soon. [Feature] Calypsoify labels Sep 28, 2020
@tyxla tyxla added this to the 9.0 milestone Sep 28, 2020
@tyxla tyxla requested review from a team September 28, 2020 10:52
@tyxla tyxla self-assigned this Sep 28, 2020
@tyxla tyxla requested a review from a team September 28, 2020 10:56
@tyxla
Copy link
Member Author

tyxla commented Sep 28, 2020

cc @Automattic/jetpack-crew - I've added this under the 9.0 milestone, but if it's too late for that, it should be fine to move it to 9.1. Thanks 🙌

@jetpackbot
Copy link

Scheduled Jetpack release: October 6, 2020.
Scheduled code freeze: September 29, 2020

E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-17286

Thank you for the great PR description!

When this PR is ready for review, please apply the [Status] Needs Review label. If you are an a11n, please have someone from your team review the code if possible. The Jetpack team will also review this PR and merge it to be included in the next Jetpack release.

Generated by 🚫 dangerJS against 20a0679

Copy link
Member

@mmtr mmtr left a comment

Choose a reason for hiding this comment

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

Works as advertised 👍

@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Sep 28, 2020
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

This tests well for me. 🚢

@jeherve jeherve merged commit acfd448 into master Sep 28, 2020
@jeherve jeherve deleted the update/calypsoify-remove-redirect branch September 28, 2020 16:55
@matticbot matticbot added [Status] Needs Changelog and removed [Status] Ready to Merge Go ahead, you can push that green button! labels Sep 28, 2020
@tyxla
Copy link
Member Author

tyxla commented Sep 29, 2020

Thanks, Miguel and Jeremy 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Calypsoify [Focus] Performance [Type] Enhancement Changes to an existing feature — removing, adding, or changing parts of it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants