Skip to content

[Feature Request] Add Development Build Scripts #1316

Closed

Description

@viankakrisna

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.

Activity

  1. gaearon commented on Dec 23, 2016

    @gaearon
    Contributor

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

  2. viankakrisna commented on Dec 23, 2016

    @viankakrisna
    ContributorAuthor

    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

  3. viankakrisna commented on Jan 12, 2017

    @viankakrisna
    ContributorAuthor

    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

  4. gaearon commented on Jan 12, 2017

    @gaearon
    Contributor

    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. 😞

  5. viankakrisna commented on Jan 12, 2017

    @viankakrisna
    ContributorAuthor

    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?

  6. gaearon commented on Jan 12, 2017

    @gaearon
    Contributor

    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.

  7. viankakrisna commented on Jan 12, 2017

    @viankakrisna
    ContributorAuthor

    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

  8. gaearon commented on Feb 11, 2017

    @gaearon
    Contributor

    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.

  9. locked and limited conversation to collaborators on Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions