2.0.0
Refactor component-side of the library to use React's new hook infra and some newer React goodies like React.lazy
. This allowed for many perf optimizations in the code and double-digit % size reduction without losing any features!
Migration instructions:
- Upgrade all react dependencies (and buttermilk, of course):
npm i react@latest react-dom@latest react-is@latest buttermilk@latest
- If you are dynamically-importing components for any routes, wrap the import in
React.lazy()
(note that this only works in the browser right now becauseReact.Suspense
doesn't work server-side yet.)
✅
routes: [
{
path: '/',
render: () => React.lazy(() => import('./Home')),
},
{
path: '*',
render: () => NotFound,
},
];
⛔️
routes: [
{
path: '/',
render: () => import('./Home').then(mdl => mdl.default),
},
{
path: '*',
render: () => NotFound,
},
];
-
??
-
Profit!