bundlejs now support full react-native builds with including flow type transforms 🎉, etc...
will only available in the API at first but should be coming to the browser soon
Yeah getting the npm resolution working requires a lift. The primary reason bundlejs doesn't use rollup is 'cause it was too slow. I've already explored rolldown as an option, it has potential. In the future once it's matured a little bit more I might add support for it
I test Zod's treeshaking against Rollup, whereas bundlejs uses esbuild. esbuild has some serious known limitations w.r.t. treeshaking (lack of deep tracking)
in this case, esbuild wasn't properly shaking a utils file from Zod Mini. I found a fix on Zod's side which landed in v4.3.5. the new gzipped size is 4.15kb (40% less). feel free to update the post at your leisure 👍
I'd recommend using Rollup for future benchmarks/comparisons like this. it's more reflective of reality now that most frameworks are Vite-based.
bundlejs.com/?q=zod/mini&t…
One of the things that brings a smile to my face, is when when I see a bundle size then click the link for the bundle size and it leads to bundlejs (cc @jsbundle )
TIL, I had a bunch of bundlejs prs that were just languishing where I solved a number of bugs but just kinda forgot about...
I've now re-fixed a number of these bugs, but separately 😅
I'm now cleaning up older prs
Great news, bundlejs now supports jsr.io packages (cc @deno_land)
Just add `jsr:..` and you're good.
PS. Under the hood it's just using esm.sh by @jexia_
BTW, I recommend checking out @brielov's `@oxi/result` on jsr, it's a wonderful package
ALT Demo of a JSR package being bundled by bundlejs
Great news, bundlejs now supports jsr.io packages (cc @deno_land)
Just add `jsr:..` and you're good.
PS. Under the hood it's just using esm.sh by @jexia_
BTW, I recommend checking out @brielov's `@oxi/result` on jsr, it's a wonderful package
ALT Demo of a JSR package being bundled by bundlejs
TIL, each browser and runtime implements gzip and the CompressionStream slightly differently that's why the compression results for bundlejs in both the API and the Browser are just a couple KB's off.
BTW, even Deno, and Node.js implement it slightly differently
Thanks for taking the time. Cyclic deps. are supported by Node.js, so it is a bug in bundlejs.
I'm just curious about why react-dom is using it? Is there like a specific reason?
This is my 1st time running into it and I'm wondering what usecases cyclic deps are great for?
It seems `react-dom` refers to itself in its own import, in addition it doesn't list the `react-dom` package in its package.json, so bundlejs just defaults to the latest version of the package
I'm not sure if this is a bug or an expected feature of Node.js I need to implement?
I guess the main issue is that it's a tree of re-exports/barrel files.
Just quickly running that through a tree-shaking check at bundlejs bundlejs.com/?q=@apollo/… results in a very long trail and even errors out eventually