Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.4k stars 1.98k forks source link

Store|Woo: Remove `client/extensions/woocommerce` code #49433

Open mattsherman opened 3 years ago

mattsherman commented 3 years ago

Part of the Sunset Store project. See pbIJXs-sE-p2 for more details.

Once Store removal has been in production for a few weeks, and we are confident that users are accessing the new WooCommerce experience without issue, we should cleanup the codebase and remove client/extensions/woocommerce code.

Acceptance criteria

Tasks

timmyc commented 3 years ago

Thanks for creating this clean-up issue @mattsherman 🙇 - I was wondering if we have searched the wp-calypso code base to make sure there are no other parts of calypso that might be importing components from the extensions/woocommerce directory?

I did a quick ( read not exhaustive ) search locally and found the following:

blocks/signup-form/index.jsx
58:import TextControl from 'calypso/extensions/woocommerce/components/text-control';

blocks/login/login-form.jsx
28:import TextControl from 'calypso/extensions/woocommerce/components/text-control';

blocks/login/index.jsx
45:import WooCommerceConnectCartHeader from 'calypso/extensions/woocommerce/components/woocommerce-connect-cart-header';

signup/steps/user/index.jsx
39:import WooCommerceConnectCartHeader from 'calypso/extensions/woocommerce/components/woocommerce-connect-cart-header';

state/stats/lists/utils.js
145: * Return delta data in a format used by 'extensions/woocommerce/app/store-stats`. The fields array is matched to

Looks like we might need to relocate the TextControl component that is being used in a few other places - iirc that is a pretty lightweight rich text editor that uses TinyMCE.

There are also some image assets located in https://github.com/Automattic/wp-calypso/tree/trunk/static/images/extensions/woocommerce that we could likely remove too after validating they aren't used elsewhere.

mattsherman commented 3 years ago

@timmyc I should have done that search. Good catch. Wow, that seems pretty "wrong" to me to have non-extension code in Calypso importing bits from the extension... seems to violate the separation that should exist. I'll add those things to the task list, and also bump up the estimate a bit on this to accomodate those.

timmyc commented 3 years ago

Yeah I totally agree that the code probably should have been moved to a shared components folder prior to being used elsewhere. The only reason I thought to search for that was I had been pinged for reviews on that component in the past year so figured it must have been in use by others.

I'll add those things to the task list, and also bump up the estimate a bit on this to accomodate those.

You da best! Thank you!!!

becdetat commented 3 years ago

Implementer: note that WooCommerceConnectCartHeader is WooCommercConnectCartHeader in the component source file (note the missing e).

mattsherman commented 3 years ago

Move the client/extensions/woocommerce/components/text-control component to shared components folder (this is used by code outside of the extension) (@mattsherman)

I'm grabbing this first task. Other tasks should be able to be worked on in parallel by others