-
Notifications
You must be signed in to change notification settings - Fork 26.3k
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
Add React's production aliases #1855
Conversation
The change is located such that users' |
This is great @lukeed. |
Thanks! Tim mentioned the same thing earlier today so i checked it out and it's not the case. The server picks up the webpack aliases. |
😍 |
I tested this with few different types of app for multiple times. There's no comparable time and size differences using this PR. But, The improvement comes when the user turned off uglifyjs. (Stopping that will give us around 2x-3x build time reduction) |
@arunoda Thanks for this! Is there anyway you can show me some of the apps you tested this on? I should be able to dig into it more this weekend. But with the
This was the main incentive for the PR. 😄 'Twas the start of that Twitter thread. |
@lukeed check this for a mid-size app. |
Understandable 😜 I'll check this out. Btw, I don't think there should be a huge time difference here -- UglifyJS still has to be slow & methodical in order to do its job well. A possible next step might be to uglify the application code only and then inject the prod-ready React afterwards? Might not be worth the experimentation, since it'd only avoid parsing ~45kb. |
Using
examples/hello-world
as a basic starting point, these changes produce a bundle that is1kB
(min) smaller. The compilation process is also faster!On my workhorse, I'm seeing
5.6s
vs6.0s
. <-- Really marginal here, but this difference translates to a larger difference on more standard hardware. Eg, the difference is1.5s
on my laptop... and the difference will only increase with more complex projects!Relevant thread: Twitter