Your mileage will vary.
┌────────────────────────────────────┐
│ │
│ Destination: dist/index.umd.js │
│ Bundle Size: 126.8 KB │
│ Minified Size: 113.27 KB │
│ Gzipped Size: 35.76 KB │
│ │
└────────────────────────────────────┘
-----------------------------
Rollup File Analysis
-----------------------------
bundle size: 128.053 KB
original size: 132.392 KB
code reduction: 3.28 %
module count: 30
┌────────────────────────────────────┐
│ │
│ Destination: dist/index.umd.js │
│ Bundle Size: 69.44 KB │
│ Minified Size: 21.38 KB │
│ Gzipped Size: 8.24 KB │
│ │
└────────────────────────────────────┘
-----------------------------
Rollup File Analysis
-----------------------------
bundle size: 66.381 KB
original size: 76.633 KB
code reduction: 13.38 %
module count: 42
┌────────────────────────────────────┐
│ │
│ Destination: dist/index.umd.js │
│ Bundle Size: 44.21 KB │
│ Minified Size: 15.77 KB │
│ Gzipped Size: 5.56 KB │
│ │
└────────────────────────────────────┘
-----------------------------
Rollup File Analysis
-----------------------------
bundle size: 42.38 KB
original size: 52.081 KB
code reduction: 18.63 %
module count: 31
┌────────────────────────────────────┐
│ │
│ Destination: dist/index.umd.js │
│ Bundle Size: 32.8 KB │
│ Minified Size: 14.77 KB │
│ Gzipped Size: 5.36 KB │
│ │
└────────────────────────────────────┘
-----------------------------
Rollup File Analysis
-----------------------------
bundle size: 31.397 KB
original size: 34.905 KB
code reduction: 10.05 %
module count: 17
┌────────────────────────────────────┐
│ │
│ Destination: dist/index.umd.js │
│ Bundle Size: 51.27 KB │
│ Minified Size: 13.91 KB │
│ Gzipped Size: 4.66 KB │
│ │
└────────────────────────────────────┘
-----------------------------
Rollup File Analysis
-----------------------------
bundle size: 49.604 KB
original size: 58.474 KB
code reduction: 15.17 %
module count: 27
- Maybe add a mustache option.
- Build for last 2 versions of supported browsers (not just Chrome) and use the polyfills.
- Basic check of parse time, compile time, memory usage, numerous instances.
Before checking, I expected LitHTML or HyperHTML to have the leanest build results. Preact and Snabbdom ended up beating HyperHTML. In comparison, React was 7.67 times as large as LitHTML.
That difference in gzip size is not decisively significant in any way given that time to transfer 35.76kb on a 3G network is still under a second (though, remember: that's on paper vs real life conditions and 300ms is a perceptible delay), but JS bundle size isn't only an issue over the network, it's also an issue once it arrives. The relationship between parse/compile time and JS bundle size is non-linear, but the relationship does exist and AFAIK is based on the unzipped file size (in this case, of 113.27kb for React vs 14.77kb for Preact). I expect that comparison to be similarly reasonable, though.
I suspect there might be ways to cut the size of both the React and HyperHTML builds, but I think it's a data point to consider that this is what I ended up with by spending roughly the same amount of time and attention on each setup.
I also thought it was interesting that most ended up bundling around 30 different modules (files, really), but then Preact had only 17 while HyperHTML had 42. This could be an approximation of the complexity of the underlying dependency tree, but I doubt it's a great one. After all, you can often organize the same things into either 30 very simple modules vs 15 less-simple-but-still-simple-enough modules. I did find, however, that when I traced Preact's imports back a few levels it was particularly easy to figure out what was being imported and why. None of the options were too far off the others in that respect, though.