perf: make routes lazy
Description
Makes all routes lazy so their components don't get loaded with the initial load, but when navigating to the routes.
The ComponentLoader is basically a component wrapping the route components to display a loading spinner during the loading times.
Related Issue
- Fixes https://github.com/owncloud/web/issues/10980
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [x] Technical debt
- [ ] Tests
- [ ] Documentation
- [ ] Maintenance (e.g. dependency updates or tooling)
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.
I'm a bit torn here. It adds a bit of complexity while (currently) having near to no impact (Web now loads smaller but more chunks, even resulting in ~10-20ms more initial loading time - however this is not noticable). There might be situations in the future where this would be useful though, e.g. when some route component loads a lot of dependencies.
@kulmann @dschmidt any opinions from your side?
Closing here since we're currently not planing this.