AKSW / building-navigator

The Gebäude-Navigator helps you to find accessible places in Leipzig.
https://behindertenverband-leipzig.de/gebaeude-navigator
GNU General Public License v3.0
3 stars 2 forks source link

Optimized main.min.js #52

Closed simeonackermann closed 6 years ago

simeonackermann commented 6 years ago

Currently its size is about 1.1 MB which too much.

Why it's so big?

Find ways too optimize and minimize.

simeonackermann commented 6 years ago

Webpack build message:

WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB). This can impact web performance. Assets: main.min.js (1.03 MiB) WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance. Entrypoints: main (1.03 MiB) main.min.js WARNING in webpack performance recommendations: You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application. For more info visit https://webpack.js.org/guides/code-splitting/

k00ni commented 6 years ago

Why is that a problem at all? Did the user need something else besides the main.min.js?

simeonackermann commented 6 years ago

Ok, the 1.1 MB main.min.js included an experimental routing feature with a lot of translated routing transcriptions. Without its about 700 KiB, what is closer to the size I had in mind.

But I think this could be still optimized. Beside the main.min.js users have to download CSS files, Images and leaflet tiles. Especially for mobile devices it should be as less as possible.

k00ni commented 6 years ago

How much is the size of all files in total?

simeonackermann commented 6 years ago

Our JS, CSS and image files are about 1.1 MB. The quite biggest part is the main.js The leaflet map tiles for the center of leipzig are 300 KB

simeonackermann commented 6 years ago

But I think the current fixed build size (600KB) is OK and we can close this issue.

Another issue might be performance improvements. Eg test if a React component should update.