Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minify React.createElement calls #135

Open
nippur72 opened this issue May 19, 2016 · 1 comment
Open

minify React.createElement calls #135

nippur72 opened this issue May 19, 2016 · 1 comment

Comments

@nippur72
Copy link
Contributor

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
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant