How to half the size of your Spryker vendor directory

Rick Peacock
Rick Peacock Technical Team Lead Posts: 2 🧑🏻‍🚀 - Cadet

I had a bit of a shock today while checking the size of our Spryker install. Naturally the vendor directory was the biggest but one particular module stands out:

du -sh vendor/spryker
395M vendor/spryker

du -sh vendor/spryker/chart
173M vendor/spryker/chart

Unless I'm looking at this wrong, the chart module is nearly making up half the size of the entire core Spryker codebase!

The actual chart module is not too big itself and looks innocent until the webpack assets are compiled

du -sh vendor/spryker/chart/assets/Zed/node_modules
172M vendor/spryker/chart/assets/Zed/node_modules

I know disk space is cheap and it is not really hurting us, but as engineers we should support the https://www.sustainablewebmanifesto.com/ and aim to keep our digital footprint as small as possible.

For our particular project I think this module is only used for the Backoffice dashboard and for us this data is already in our BI systems so we could consider removing this module.

If we do this it will certainly save a bit of time in our CI pipelines, with less to download and compile.

Update: I just noticed there was an update to this module in the last day so maybe this is already optimised - something we can also check.

Just posting this here incase others are looking to save some space, or have other thoughts on reducing the application footprint.

Comments

  • James Hooper
    James Hooper Senior Technical Trainer Sprykee Posts: 67 ⚖️ - Guardians (admin)

    Hey @Rick Peacock ,

    Thank you so much for your feedback, I have passed this on to our team 🙌

  • Fred Jung
    Fred Jung Spryker Customer Posts: 24 ✨ - Novice

    Good suggestion!

  • Yuriy Gerton
    Yuriy Gerton Front End Technical Lead Sprykee Posts: 49 🧑🏻‍🚀 - Cadet

    Hello @Rick Peacock ,

    Thank you for bringing this to our attention.

    The current Spryker frontend builder uses the npm workspaces, which avoids duplicating node modules and shares them from the root node_modules folder.

    I’ve checked the current B2B demo shop and the sizes are:

    du -sh vendor/spryker
    179M vendor/spryker
    du -sh vendor/spryker/chart
    272K vendor/spryker/chart

    Please follow the migration guides to update the FE builder:
    Switch from Yarn to npm v8
    Upgrade Node.js to v18 and npm to v9