-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Build distinct dev / prod & min builds #7242
Conversation
Not sure I agree with changing the names of both. Why not let react.js/react.min.js imply production (like all other JS libraries) and offer a react.dev.js/react.dev.min.js as an alternative? |
If we had done this from the beginning, I'd agree. But the builds have existed like this for a long time and I'm afraid there would be more confusion from reusing the current files names (especially with things like npmcdn, bower). Plus, I kind of like that the use of .prod implies there is a .dev, whereas the alternative would not pique anybody's curiosity and they may think prod builds are the only thing. We could maybe do that but it would have to happen at v16 and not before. I don't know when that will be. Maybe we could wait but it would mean living with the current confusion for longer. |
@zpao is the confusion so pervasive that it necessitates a major ergonomic change? Personally have never heard of this being an issue, but you folks definitely sample the feedback at a bigger scale. |
I see a new benchmark using DEV version every other week. The confusion unfortunately is pervasive. |
Would it be enough to just rename What if we use a build tool that inlines and minifies as a single batch then we can't keep separating them? There should be no reason to use one but not the other. |
I think the confusion is the other way around. People see a URL like https://cdnjs.cloudflare.com/ajax/libs/react/15.2.1/react.js and it doesn’t seem immediately wrong. So it’s the one that should be |
There are a few things that Rollup itself can't prune. For example |
Closing this PR due to the work that's happened around Rollup and flat bundles on #9327 |
For now we settled with @trueadm on using |
Hopefully this helps reduce some confusion about what each build actually is and maybe we'll see fewer people doing benchmarks with the dev version.
There's some more to do to make sure this is actually right and works, but this is the general idea. We'd build
react.dev.js
andreact.prod.js
and the minified version of each. We should do all the other ones as well (addons less important long term, but react-dom definitely needs this treatment because #7164).We start recommending these file names as soon as they are part of a release. We keep building the plain
react.js
&react.min.js
for compatibility. For v16 we stop building them entirely.TODO:
uglifify
step. We might not need those anymore anyway if we do this after rolloup (that step is only there to remove somerequire
s but rollup handles that I think)..map
then, and then copy the right files instead of doing a duplicate build).