ONSdigital / sdg-indicators

Development website for collecting and disseminating UK data for the Sustainable Development Goal global indicators.
https://ONSdigital.github.io/sdg-indicators/
37 stars 66 forks source link

JS/CSS Bundling/Minification #2826

Closed shaneporter closed 5 years ago

shaneporter commented 6 years ago

So that number of http requests is reduced, and the combined size of the responses is smaller.

brockfanning commented 6 years ago

@shaneporter do you know if any front-end asset processing is required for the functionality of the platform? I'm wondering if the front-end asset handling could be left to the countries to manage. A basic npm-based pipeline could be added to the site repo (the repo that the countries actually fork) to give them a starting place, and then added to the CI builds (eg npm run build-assets, or something).

The reason that comes to mind is that in my experience working with front-end developers, each team/dev always has their own preferred pipeline/libraries/etc. Like Grunt, Gulp, npm scripts, etc. And some want to start with Bourbon/Neat, Compass, or whatever grid system/library they prefer. Basically I'm wondering if the asset handling could done in a front-end way (the simplest would probably be an npm script) instead of in Jekyll, and provided in the forked repo as a starting place -- with the understanding that a particular asset pipeline/processing would never be coupled with any platform functionality.

For example this might not work if the javascript in the core platform needed to be transpiled at all, I think. But if the platform could be independent of any asset-processing then that might give more flexibility to the countries forking.

AnnCorp commented 5 years ago

@dougmet please could you comment once discussed with Brock/James

jameesy commented 5 years ago

After running an audit to see how much of an issue this was causing, it seems that the biggest issue is actually with the minified Bootstrap CSS file.

screenshot 2019-02-19 at 14 40 54

Not sure the payout that this would give would potentially be worth it.

dougmet commented 5 years ago

Minification is a good idea, but it won't make a huge difference so let's close and resurrect if it changes.