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

[Feature Request] Add Development Build Scripts #1316

Closed
viankakrisna opened this issue Dec 23, 2016 · 8 comments
Closed

[Feature Request] Add Development Build Scripts #1316

viankakrisna opened this issue Dec 23, 2016 · 8 comments

Comments

@viankakrisna
Copy link
Contributor

Something like

`npm run build --dev`

with NODE_ENV set to development

My staging environment uses apache to serve the index html, and minified react behaves differently from my development environment.

In a pinch, this feature would be helpful.

will add pull request if this request is acceptable.

@gaearon
Copy link
Contributor

gaearon commented Dec 23, 2016

Can you give more details on how React works differently? This sounds like bug in React.

@viankakrisna
Copy link
Contributor Author

Yes, the input component created with React.cloneElement won't update it's state in production environment, no errors or warning. Will look further to it and add code sample.

But what do you think about this feature? I think it's some kind of escape hatch

@viankakrisna
Copy link
Contributor Author

Haven't got time to add code example, but for people who wants the escape hatch, I wrote an article about it in here:
https://medium.com/@viankakrisna/extending-create-react-app-webpack-config-c70828593c96#.3gu6c1lpz

@gaearon
Copy link
Contributor

gaearon commented Jan 12, 2017

This can break with every patch version:

var reactScriptsConfig = require('react-scripts/config/webpack.config.dev')

I’m thinking we should randomize build names in every release now that people are relying on it. And beginners reading your article will rely on it because they don’t understand the dangers as well as you do. And we’re back to JavaScript fatigue where every update is dangerous. 😞

@viankakrisna
Copy link
Contributor Author

Yes, like i said, it's an escape hatch, it will work until it won't work anymore T_T.
What do you mean about randomize build names?

@gaearon
Copy link
Contributor

gaearon commented Jan 12, 2017

I think that maybe less experienced developers might actually think it's a supported way of modifying CRA's config from some articles (yours is not the first one I've seen). So maybe we could make it seem "scarier" to import it by making the path a little more obscure, like react-scripts/config/webpack.config.dev-0.8.4.js. So that it's obvious it could break in the next version and is not supported.

@viankakrisna
Copy link
Contributor Author

Yes, I think that's a good way to prevent something like this happening. I've updated the article with a disclaimer. But I still think that we need a build with env set to development. It's obviously an edge case. Like the issue i've experienced, it's too much consuming to find the bug in react on production

@gaearon
Copy link
Contributor

gaearon commented Feb 11, 2017

I’m closing since this appears to be a duplicate of #1070.
Let’s continue the discussion there.

Yes, the input component created with React.cloneElement won't update it's state in production environment, no errors or warning.

This sounds like a bug in React, and you should file one there.

@gaearon gaearon closed this as completed Feb 11, 2017
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants