timolins / react-hot-toast

Smoking Hot React Notifications 🔥
https://react-hot-toast.com
MIT License
9.84k stars 331 forks source link

New bundler setup with `react-hot-toast/headless` #205

Closed timolins closed 2 years ago

timolins commented 2 years ago

This PR improves the build & bundle setup. It's using tsup (powered by esbuild) instead of unmaintained tsdx. Additionaly, npm v4 was replaced by pnpm, which finally gets rid of the outdated v1 npm lockfile.

Faster builds

These changes give us a way faster and simpler builds (about 3x faster) with fewer dev dependencies.

Better headless support

The new bundler allows us to have multiple entry points. We use this to expose react-hot-toast/headless, which doesn't import any of the default components and has no dependency on goober.

This makes react-hot-toast headless mode compatible with react-native (and other non-web targets) again. Fixes #39

Using react-hot-toast/headless is super lightweight. Adding less than 2kb to your gzipped bundle.

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
react-hot-toast ✅ Ready (Inspect) Visit Preview Jul 10, 2022 at 2:44PM (UTC)
github-actions[bot] commented 2 years ago

size-limit report 📦

Path Size
dist/react-hot-toast.cjs.production.min.js 0 B (-100% 🔽)
dist/react-hot-toast.esm.js 0 B (-100% 🔽)
dist/index.js 4.83 KB (+100% 🔺)
dist/index.mjs 4.52 KB (+100% 🔺)
headless/index.js 1.76 KB (+100% 🔺)
headless/index.mjs 1.47 KB (+100% 🔺)