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

[feature request] Code minification #1044

Closed
JanetLaysEggs opened this issue Sep 28, 2020 · 5 comments
Closed

[feature request] Code minification #1044

JanetLaysEggs opened this issue Sep 28, 2020 · 5 comments

Comments

@JanetLaysEggs
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

Currently it seems that the pages at https://community.preciousplastic.com/ use no code minification in any of the JS files. I recommend webpack or something similar to help with this and reduce server+ bandwidth load. Also what is being used for the back end for users etc?

Describe alternatives you've considered
The alternative is not using minifcation?

Additional context
Add any other context or screenshots about the feature request here.

@BenGamma
Copy link
Contributor

Can you point out which file you refer to ?

The JS files in current build are minified see here and here

@JanetLaysEggs
Copy link
Author

JanetLaysEggs commented Sep 30, 2020

Hiya @BenGamma, I mean files like 'scrollSpy.js' and ''custom.js'.
Also some files that have been minified could be reduced even further by the use of webpack etc where they could all be wrapped into one file - so even function/class names that span across multiple files can be shortened. This would also mean the main page is no longer reliant on assets like 'button.js' which reduces the page's reliability should that repo change and that link fail (it links to a github repo instead of a file on the https://preciousplastic.com/ server)? You should be able to use npm to do all this? Also comments still exist in some of the files.


UPDATE: I just used a online js code minifer to cut buttons.js by 7KiB as an example.


I'd like to help in this effort if I can?

Thank you for getting back to me.

-J

@JanetLaysEggs
Copy link
Author

Oh and css files too!

@BenGamma
Copy link
Contributor

Ah you are refering to the academy. The repo for the academy is https://github.com/ONEARMY/academy

We are using a tool called Docusaurus to build the academy section and we embed it in /academy. I never dive into the minified optimizations for it. I would say have a look if you like !

@chrismclarke
Copy link
Member

Hi @JanetLaysEggs - thanks for pointing this out. Yes, confusingly enough all the content for the academy sits in another git repo (and we just display it in an iframe in the community platform). I've copied your issue over to ONEARMY/academy#106 - if you did have a chance to look into ways we could improve on this then that would be great (although as a word of warning the repository isn't very actively maintained, so it could be some time for changes to be merged - but most welcome nonetheless)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants