Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize bundles sizes, add csso, fix lighthouse issues #252

Closed
NeOMakinG opened this issue May 2, 2022 · 9 comments · Fixed by #416 or #427
Closed

Optimize bundles sizes, add csso, fix lighthouse issues #252

NeOMakinG opened this issue May 2, 2022 · 9 comments · Fixed by #416 or #427
Assignees
Labels
Improvement Sources Related to dev environment

Comments

@NeOMakinG
Copy link
Contributor

No description provided.

@Hlavtox
Copy link
Contributor

Hlavtox commented May 6, 2022

We need to divide the assets per-module again, so they are not loaded in the bundle if not needed.

@Hlavtox Hlavtox added Sources Related to dev environment Improvement labels May 12, 2022
@NeOMakinG
Copy link
Contributor Author

We need to divide the assets per-module again, so they are not loaded in the bundle if not needed.

Seems impossible in the current state of PrestaShop

@Hlavtox
Copy link
Contributor

Hlavtox commented Aug 4, 2022

Why not?

It's all about putting proper css to proper directories:
https://github.com/prestarocket-agence/classic-rocket/tree/develop/modules/productcomments/views

You can even unregister a default asset by putting an empty file there:
https://devdocs.prestashop.com/1.7/themes/getting-started/asset-management/#in-themes

And we should be able to specify what we want to load on which controller by specifiying it in theme.yml:
https://devdocs.prestashop.com/1.7/themes/getting-started/asset-management/#registering-in-themes

@NeOMakinG
Copy link
Contributor Author

@Hlavtox

CSS files path depends on the module developer choice:

some are inside /css/*.css, some are inside /views/dist/css/*.css, some are inside /public/*.css

We have absolutely no way to make this automatic

And we absolutely have no way to add our own stylesheets depending on the fact that a module is activated and installed inside the current page we're visiting.

Yes, we can register some stylesheets depending on the controller we are, but modules can be moved into different hooks, it's not a reliable way to do this, except for the core styles of the page

@Hlavtox
Copy link
Contributor

Hlavtox commented Aug 4, 2022

Yes, but at least the module CSS will be loaded only on pages where it's needed, not everywhere.

@Hlavtox
Copy link
Contributor

Hlavtox commented Aug 4, 2022

With the way hummingbird is written now, all JS, all CSS, for all modules (even uninstalled) are loaded absolutely everywhere.

@NeOMakinG
Copy link
Contributor Author

With the way hummingbird is written now, all JS, all CSS, for all modules (even uninstalled) are loaded absolutely everywhere.

Yeah I know, we can improve it and it's almost ready: NeOMakinG@d570e8b

But we can't do it perfectly for sure :(

@NeOMakinG
Copy link
Contributor Author

@Oksydan wants to take this subject, I'll move it to WIP

@Oksydan
Copy link
Contributor

Oksydan commented Jan 9, 2023

Assign me 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Sources Related to dev environment
Projects
Status: Done
4 participants