damonhook / aos-statshammer

A tool for calculating and comparing damage outputs for Warhammer Age of Sigmar units.
https://aos-statshammer.herokuapp.com/
MIT License
18 stars 10 forks source link

Lazy load routed components #46

Closed damonhook closed 4 years ago

damonhook commented 4 years ago

As the size of this webapp grows, the initial load times will start to increase, this is because it needs to import everything at the entry point. We should change to lazy loading of these containers

E.g:

import About from 'containers/About';
import Home from 'containers/Home';
import PdfContainer from 'containers/PdfContainer';
import Simulations from 'containers/Simulations';

Becomes

const About = lazy(() => import('containers/About'));
const Home = lazy(() => import('containers/Home'));
const PdfContainer = lazy(() => import('containers/PdfContainer'));
const Simulations = lazy(() => import('containers/Simulations'));