Skip to content

2.0.0

Compare
Choose a tag to compare
@quantizor quantizor released this 18 Feb 18:18

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:

  1. Upgrade all react dependencies (and buttermilk, of course):
npm i react@latest react-dom@latest react-is@latest buttermilk@latest
  1. 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 because React.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,
  },
];
  1. ??

  2. Profit!