Closed mehmetkose closed 4 years ago
Dropping MUI v3 support https://github.com/iamhosseindhv/notistack/blob/73ecdf9cc991008f8e4cbbde6acb3102c9d4c711/src/SnackbarItem/SnackbarItem.styles.js#L41
and using clsx
instead of classnames
could help a bit
Yes, it is rather large: https://bundlephobia.com/result?p=notistack@0.9.6
As you can see most the size is actually the library this is where most reductions could be made. Although other areas are:
Some big wins without even reducing code size where there would be ... massive ... wins
Another leverage I have just thought of. Instead of a custom alert component, we could explore using this one: https://material-ui.com/components/alert/.
Agreed. Currently for a notifications stack, its pretty huge. Its about the same size as react-router.
@andrewmclagan What other dependencies do you have in your package.json? (looking for opportunities of third-party libraries to reduce bundle size)
Just installed notistack 0.9.11 and it adds ~50KB to my builds using parcel build --experimental-scope-hoisting
. I'm hoping more bundle size optimizations can be done. On a small preact + material-ui page that 50KB is 20% of my 250KB bundle.
Of course improving bundle size is an ongoing thing and there's always room for improvement, but https://github.com/iamhosseindhv/notistack/pull/268 made a good step towards a smaller bundle size.
Closing this but always open to suggestions.
Seems like it's even bigger than react. How can be possible?