wix-incubator / react-templates

Light weight templates for react
https://wix.github.io/react-templates
MIT License
2.82k stars 206 forks source link

minify React.createElement calls #135

Open nippur72 opened 8 years ago

nippur72 commented 8 years ago

We could save bytes if we do like other vdom packages do, namely use a short alias name for React.createElement.

For example:

var h = require("react").React;
h("div", ... );

instead of

var React = require("react");
React.createElement("div", ... );
nippur72 commented 8 years ago

I just tried out PR #176 in a small production app with --create-element-alias _h, and size went from 303 k to 297 k... Not bad.