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

Spike: use the Blocks API instead of our AJAX APIs for the Payment Request Buttons #1573

Open
reykjalin opened this issue May 19, 2021 · 0 comments · May be fixed by #3691
Open

Spike: use the Blocks API instead of our AJAX APIs for the Payment Request Buttons #1573

reykjalin opened this issue May 19, 2021 · 0 comments · May be fixed by #3691
Assignees
Labels
component: blocks Cart and checkout blocks priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project.

Comments

@reykjalin
Copy link
Contributor

reykjalin commented May 19, 2021

The WooCommerce Blocks API has seen significant improvements since #1467 was opened, and we should try to make use of those improvements.

The Blocks API brings with it significant improvements in terms of the Checkout flow, especially in terms of UX; it's more light-weight than the current implementation; and by using the Blocks API without maintaining our own custom solution for that.

Part of what we should try to do here is to build 2 versions of our Payment Request scripts; one can be the legacy version using our AJAX APIs, and the other a newer version that entirely relies on the Blocks API. We then conditionally load the right script based on what version of WooCommerce Blocks is installed.

What we need to understand

  • How much code will have to be duplicated?
  • Will this be easier if we include the shortcode flow in the new webpack based build system?
  • Are there still limitations in the Blocks API that prevent us from fully embracing it?
  • How will this change our maintenance burden going forward?
  • Should we move some of the more complex normalization functions to JS and re-use that code across the block-based and shortcode flows?
  • Should we include some AJAX requests even though we're using the Blocks API for normalization and such?
  • Should we change how payments are processed in process_payment so they work for both the Shortcode and Blocks API flows without the need to write much JS for each type of flow?

What if something doesn't work or isn't possible?

  • Clearly document the issue; reproduction steps (if applicable), code examples, any other details that apply.
  • Alert the WooCommerce Blocks team; do they have a solution? If not, provide input to help them come up with one.
@reykjalin reykjalin added priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project. component: blocks Cart and checkout blocks labels May 19, 2021
@wjrosa wjrosa self-assigned this Dec 30, 2024
@wjrosa wjrosa linked a pull request Jan 7, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: blocks Cart and checkout blocks priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants