2020 is coming and more SPAs will be written than ever. After all frontend fun we still have questions in frontend-opsy topics. How about these features:
- SSR support and passing SSR data to the browser for immediate hydration
- preload all route data before rendering, including promise.all for route matches
- code splitting via async components (lazy load)
- 404 and other status pages
- aborting data load if we’re switching route
- dependency injection in components and in data loaders
Working on these questions sometimes leads to a library. So here’s Chyk - microframework to build universal SPAs with React.
The library is written in TypeScript and aiming to help with features described above. Chyk is based on react-router-config approach for routes config. It allows to statically analyze config, preload all needed data and inject it to the route components.
Check screencast and examples.
Thanks!