woocommerce / woocommerce-blocks

(Deprecated) This plugin has been merged into woocommerce/woocommerce
https://wordpress.org/plugins/woo-gutenberg-products-block/
GNU General Public License v3.0
406 stars 218 forks source link

Source files still included in WooCommerce package #4929

Closed senadir closed 2 years ago

senadir commented 3 years ago

It seems like https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/4418 didn't work well in composer builds. WooCommerce still ships with source files, making the block package be +4mb of the 9.6mb zip file instead of 2.2mb.

pcShBQ-82-p2

Additional context

Approximately once a month (Pca54o-1N-p2), the latest version of WooCommerce Blocks gets integrated into WooCommerce. The WooCommerce Blocks dependency that WooCommerce is fetching, is currently 12.9mb big, while the WooCommerce Blocks plugin on w.org has a size of 2.2mb. The WooCommerce Blocks dependency that is fetches still contains source files, which lead to a bigger file size. This then leads to a bigger overall file size of the WooCommerce plugin.

Steps to reproduce

  1. Download the WooCommerce plugin from https://wordpress.org/plugins/woocommerce/.
  2. Unzip the file and go to woocommerce/packages/woocommerce-blocks.
  3. See that this folder contains the build files and folders assets, packages, patches and global.d.ts.

Expected result

The WooCommerce Blocks dependency should only contain production and not build files and folders.

nielslange commented 2 years ago

Related: #4725 & #4928

nerrad commented 2 years ago

Just a few thoughts:

the WooCommerce Blocks dependency that is fetches still contains build files, which lead to a bigger file size and The WooCommerce Blocks dependency should only contain production and not build files and folders.

@senadir will you clarify the terminology in the description and edit "build" to "source"? I'm pretty sure you meant source files (or files used for building) but a first read-through caused me to trip up a bit because I read it as "built".


@niels can you clarify if this issue has been addressed elsewhere - I see a number of linked relevant issues in various places and it's not clear to me whether any of them fix this.

Since I'm not sure if this has been fixed or not based on conversations I've seen in Slack (p1637754359333600-slack-C8X6Q7XQU) and elsewhere, my next suggestion might no longer be relevant. But one approach you could take to fixing this for Woo Core distributions is to implement a post install in the WooCommerce repository that deletes the source files after the package is installed.

senadir commented 2 years ago

the WooCommerce Blocks dependency that is fetches still contains build files, which lead to a bigger file size and The WooCommerce Blocks dependency should only contain production and not build files and folders.

@senadir will you clarify the terminology in the description and edit "build" to "source"? I'm pretty sure you meant source files (or files used for building) but a first read-through caused me to trip up a bit because I read it as "built".

I'm not sure if I was the one who wrote that, but still, I meant source files, not build files, updated.

But one approach you could take to fixing this for Woo Core distributions is to implement a post install in the WooCommerce repository that deletes the source files after the package is installed.

If we're to remove them here before they're pushed, that would be great, but using postinstall is also a solution.

I was actually having a déjà vu, Darren and I had this same exact convo a year ago, I'm not sure if anything changed from composer side, so it's worth another try.

p1599750092174900-slack-C8X6Q7XQU

nielslange commented 2 years ago

@niels can you clarify if this issue has been addressed elsewhere - I see a number of linked relevant issues in various places and it's not clear to me whether any of them fix this.

Since I'm not sure if this has been fixed or not based on conversations I've seen in Slack (p1637754359333600-slack-C8X6Q7XQU) and elsewhere, my next suggestion might no longer be relevant. But one approach you could take to fixing this for Woo Core distributions is to implement a post install in the WooCommerce repository that deletes the source files after the package is installed.

I marked two issues as related:

  1. 4725 → This issue affects the zip file that gets created when downloading the repo from GitHub. My fix #5242 does not affect the part that gets included into the WooCommerce core.

  2. 4928 → This issue affects the zip file that gets created for testing when running the command npm run package-plugin:deploy. My fix #4928 might have solved the problem that our plugin contains obsolete files and being merged into the WooCommerce core. My fix should be shipping with WooCommerce Blocks 6.5.0 and should land in WooCommerce 6.1. I suggest checking if this problem still exists with WooCommerce 6.1.

github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

Internal: After 10 days with no activity this issue will be automatically be closed.
github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

Internal: After 10 days with no activity this issue will be automatically be closed.