localvoid / ivi

Lighweight Embeddable Web UI Library
MIT License
724 stars 22 forks source link

Is 2.7kb claim still correct? #56

Open canadaduane opened 1 year ago

canadaduane commented 1 year ago

I'm exploring this great little library and I'm curious if the 2.7kb claim on the readme is still correct. When I include ivi and the @ivi/html libs, I see about 13kb of library data imported (brotli compressed):

image

This is from https://cdn.jsdelivr.net/npm/@ivi/htm/+esm

localvoid commented 1 year ago

Yes, it is the size when template precompilation is enabled (Vite, Rollup or babel plugins).

@ivi/htm package and many other modules will be eliminated from the final bundle when templates are precompiled.

Originally, I thought about maintaining two different modules for template compilation at runtime: one that is optimized for size and performance and another one for development. But in the end I've decided to keep it simple, maintain codebase for runtime compiler that is easy to read/update and optimize everything for template precompilation.