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

Add initial state to the connection package #21864

Merged
merged 7 commits into from
Nov 25, 2021

Conversation

leogermani
Copy link
Contributor

@leogermani leogermani commented Nov 23, 2021

Note: This PR was originally drafted and discussed in #21745

This PR proposes a way for the Connection composer package to expose an Initial State that can be consumed by the connection JS package. This will make it easier for consumers to use the connection js package and not have to worry about its initial state.

For now this is working for the ConnectionStatus, but it can also work for the apiRoot and registrationNonce.

Changes proposed in this Pull Request:

  • Add initial state to the connection package

Jetpack product discussion

#21745

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

No

Testing instructions:

  • Build Jetpack and Backup plugins
  • Disconnect
  • Visit both plugins pages and make sure the request to v4/connection endpoint is NOT performed.
  • Go to class-jetpack-backup.php in the Backup plugin and comment out the line that adds the Connection Initial state. Refresh the page and see that now the request is performed. You can do the same with Jetpack

@leogermani leogermani added the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Nov 23, 2021
@leogermani leogermani added this to the jetpack/10.4 milestone Nov 23, 2021
@leogermani leogermani self-assigned this Nov 23, 2021
Copy link

@test-case-reminder test-case-reminder bot left a comment

Choose a reason for hiding this comment

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

Here are some suggested test cases for this PR.

Connection

  • In-place connection with free plan
  • In-place connection with paid plan
  • In-place connection with product purchase
  • Classic connection. Use Safari, or set a constant JETPACK_SHOULD_NOT_USE_CONNECTION_IFRAME to true
  • Disconnect/reconnect connection
  • Secondary user connection
  • Connection on multisite

Verify that the changes are compatible with the plugins that use the connection package.

  • WooCommerce Payments
  • Jetpack Boost
  • Previous versions of Jetpack

If you think that suggestions should be improved please edit the configuration file here. You can also modify/add test-suites to be used in the configuration file.

@matticbot
Copy link
Contributor

Caution: This PR has changes that must be merged to WordPress.com
Hello leogermani! These changes need to be synced to WordPress.com - If you 're an a11n, please commandeer and confirm D70555-code works as expected before merging this PR. Once this PR is merged, please commit the changes to WP.com. Thank you!
This revision will be updated with each commit to this PR

@github-actions github-actions bot added [JS Package] Connection [Package] Connection [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Admin Page React-powered dashboard under the Jetpack menu RNA labels Nov 23, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 23, 2021

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: December 7, 2021.
  • Scheduled code freeze: November 30, 2021.

Backup plugin:

  • Next scheduled release: December 7, 2021.
  • Scheduled code freeze: November 29, 2021.

Boost plugin:

  • Next scheduled release: November 30, 2021.
  • Scheduled code freeze: November 23, 2021.

@github-actions github-actions bot added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 23, 2021
@sdixon194 sdixon194 added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Nov 24, 2021
sergeymitr
sergeymitr previously approved these changes Nov 25, 2021
Copy link
Contributor

@sergeymitr sergeymitr left a comment

Choose a reason for hiding this comment

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

Awesome!
Works as a charm!

@sergeymitr sergeymitr added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 25, 2021
@jeherve jeherve enabled auto-merge (squash) November 25, 2021 10:45
@github-actions github-actions bot added [Package] Abtest This package no longer exists in the monorepo. Its replacement is [Package] Explat. [Package] Backup [Package] Connection UI This package no longer exists in the monorepo. [Package] Identity Crisis This package no longer exists in the monorepo. It was merged into [Package] Connection. [Package] Jitm [Package] Licensing [Package] Sync [Plugin] Boost A feature to speed up the site and improve performance. labels Nov 25, 2021
@jeherve jeherve merged commit d209233 into master Nov 25, 2021
@jeherve jeherve deleted the add/initial-state-to-connection branch November 25, 2021 10:59
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Nov 25, 2021
@github-actions
Copy link
Contributor

Great news! One last step: head over to your WordPress.com diff, D70555-code, and commit it.
Once you've done so, come back to this PR and add a comment with your changeset ID.

Thank you!

@leogermani
Copy link
Contributor Author

r235635-wpcom

davidlonjon added a commit that referenced this pull request Dec 2, 2021
* master: (22 commits)
  Update storybook monorepo to v6.4.0 (#21897)
  Refresh the site's modules and settings after successful product activation (#21886)
  Plugin Install: Bump MC stat on success or fail. (#21893)
  Nav Unification: Use correct user capability for the Inbox menu item (#21882)
  Jetpack: Extend disconnection dialog component to handle multiple steps and accept more props (#21048)
  Disable CSSTidy property shorthand optimization in the editor or headstart (#21891)
  Connection UI: Update Composer instructions in README.md (#21890)
  Partner Compatibility: Adding a unique connection screen for customers who receive a coupon from a Jetpack partner (#21813)
  Search package: move search dashboard to package - the base (#21865)
  JITM: wrap CTA below text on small viewports (#21688)
  Licensing JS Package – fix icon positioning and width (#21878)
  JITM: new JS and CSS builder (#21874)
  Support site_intent for `/me/sites` endpoint (#21880)
  Don't render Critical CSS while generating CritCSS. (#21879)
  ConnectScreen: make button full width on small screens (#21683)
  Improve the copy of the license activation banner (#21876)
  Rename Webpack-built files back from `.min.js` and remove hashes (#21748)
  Search: Migrate more helper classes to package (#21751)
  Search: migrate/add search rest API (#21584)
  Add initial state to the connection package (#21864)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Page React-powered dashboard under the Jetpack menu [JS Package] Connection [Package] Abtest This package no longer exists in the monorepo. Its replacement is [Package] Explat. [Package] Backup [Package] Connection UI This package no longer exists in the monorepo. [Package] Connection [Package] Identity Crisis This package no longer exists in the monorepo. It was merged into [Package] Connection. [Package] Jitm [Package] Licensing [Package] Sync [Plugin] Backup A plugin that allows users to save every change and get back online quickly with one-click restores. [Plugin] Boost A feature to speed up the site and improve performance. [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ RNA Touches WP.com Files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants