vuestorefront / vue-storefront-1

The open-source frontend for any eCommerce. Built with a PWA and headless approach, using a modern JS stack. We have custom integrations with Magento, commercetools, Shopware and Shopify and total coverage is just a matter of time. The API approach also allows you to merge VSF with any third-party tool like CMS, payment gateways or analytics. Newest updates: https://blog.vuestorefront.io. Always Open Source, MIT license.
https://www.vuestorefront.io
MIT License
18 stars 13 forks source link

[VSF1] reduce memory usage by refactoring nested function definitions #488

Closed cartok closed 2 years ago

cartok commented 2 years ago

How the project can be improved?

Hello, I see places where bigger functions are defined inside of other functions. Like this the engine will allocate new memory on every execution of the outer function no matter if you use the function keyword a const value with an arrow function. To reduce the amount of created garbage these places should better get refactored. I will point out some important places:

Used regex: ^ {2,}(?:(?:const|let|var) \w+ = \(.*?\) =>|function \w+ \(.*?\)) Used path includes: core/**/*.js, core/**/*.ts

What are the acceptance criteria?

No response

Additional information

No response

What version of Vue Storefront this feature can be implemented?

1.12.4

Code of Conduct

Fifciu commented 2 years ago

Done. But it will be a part of 1.13