Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
173 stars 69 forks source link

Use `apiFetch` from `@wordpress/api-fetch` #1575

Open jessepearson opened 3 years ago

jessepearson commented 3 years ago

apiFetch is available in @wordpress/api-fetch, and we are using it from @wordpress/data-controls. It is not yet deprecated, but it may be best to refactor when possible.

https://developer.wordpress.org/block-editor/reference-guides/packages/packages-api-fetch/

gpressutto5 commented 2 years ago

Why do we want to stop using @wordpress/data-controls?

As far as I understood, @wordpress/data-controls uses @wordpress/api-fetch, but uses the generator pattern, which makes the entire project depend on its yieldable behavior. It will require a major refactor to get rid of it.

jessepearson commented 2 years ago

I checked the PR that references this issue and it appears there was a little more discussion about it here: https://github.com/Automattic/woocommerce-payments/pull/1437#pullrequestreview-635790371

Basically the dispatch in data-controls was deprecated, which makes it seem like apiFetch could be, as well. It appears the issue to refactor dispatch is still open: https://github.com/Automattic/woocommerce-payments/issues/1574

zmaglica commented 8 months ago

This issue impacts Release Process, Monitoring (including On-call process ownership), MC Tools, Dev Tools, CI/CD Pipeline, and Dependencies Management, so assigning to Harmony (based on team responsibilities Pc2DNy-3z-p2) @deepakpathania. Assigning as part of Gamma Triage process PcreKM-yM-p2.

Tagging as part of re-evaluating older issues in the backlog, please have a look and close if no longer relevant.