Closed jchavarri closed 2 years ago
Right now, every call to React.Dom.Style.make is compiled to a bunch of zeros on unused optional arguments.
React.Dom.Style.make
This leads quickly to larger bundle sizes, e.g. for 7 usages of this function in some real world project, a prod bundle increases by ~17KB.
We should provide an API where the style properties are passed in a list, so unused ones don't lead into bundle costs.
e.g. like @davesnx does in jsoo-css:
let box = React.Dom.Style.make([| color("333"), backgroundColor("C0FFEE"), padding("45px"), borderRadius("8px"), fontSize("22px"), fontWeight("bold"), |]);
I don't think we need type safety on each prop type, for a first version.
Right now, every call to
React.Dom.Style.make
is compiled to a bunch of zeros on unused optional arguments.This leads quickly to larger bundle sizes, e.g. for 7 usages of this function in some real world project, a prod bundle increases by ~17KB.
We should provide an API where the style properties are passed in a list, so unused ones don't lead into bundle costs.
e.g. like @davesnx does in jsoo-css:
I don't think we need type safety on each prop type, for a first version.