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

REMOVE nodeenv development #81

Merged
merged 7 commits into from
Apr 8, 2020
Merged

Conversation

ndelangen
Copy link
Member

fixes: #68

@ndelangen ndelangen added bug Classification: Something isn't working customer reported Tracking: This issue was reported through customer support labels Jan 14, 2020
@tmeasday
Copy link
Member

What about the BROWSER bit? I don't know why that's there either.

@tmeasday
Copy link
Member

tmeasday commented Jan 14, 2020

The commit where it came from is super old: https://github.com/chromaui/chromatic/commit/e1a9ba09283ff96a6c9b369e855db5c3bd41efba

@ndelangen
Copy link
Member Author

The NODE_ENV=TEST was to make babel parse the example storybook correctly 😖

Removing it caused the example to fail on require.context

I was able to make the example work by removing the babel stuff for webpack's require.context, and migrating to tri-config.

@ndelangen
Copy link
Member Author

I merged in the better error handling, because it actually helped my find & test the problem.

I could remove it from this branch again if you really want @tmeasday or I could close the other PR, and consider it 1 cleanup PR. WDYT?

@tmeasday
Copy link
Member

tmeasday commented Jan 17, 2020

Hold on a sec, you might need to talk me through what happened here.

Definitely pull the other PR out as I had comments on that separately.

@ndelangen ndelangen force-pushed the fix/remove-nodeenv-development branch from b1cdcdd to fb0f739 Compare January 17, 2020 15:22
@ndelangen
Copy link
Member Author

I cleaned the PR up @tmeasday

@tmeasday
Copy link
Member

Thanks it looks reasonable. I'm just worried that you had to do this. Does it mean that Chromatic doesn't work any more with non-main.js storybooks?

@ndelangen
Copy link
Member Author

NO AFAICS it should work without / should work with the old config.js just fine @tmeasday

@tmeasday
Copy link
Member

So why did you need to do it in our test storybook? Can you explain what happened? Is the BROWSER var needed?

@ndelangen
Copy link
Member Author

ndelangen commented Jan 21, 2020

@tmeasday build-storybook uses the babel config defined in the root. It's always done that, but because NODE_END was set to 'development' and in the root there's no babel config for that env, it wouldn't override anything.

Removing NODE_ENV='development' made it act as NODE_ENV='test' which DOES match a env specified in the root babel config, and thus it's applied.

Turns out if we add NODE_ENV=test here:

process.env.NODE_ENV = process.env.NODE_ENV || 'test';

IMHO that should be production WDYT?

@ndelangen
Copy link
Member Author

We can't know exactly what impact a NODE_ENV change will have on the users config/code-output. Perhaps it's safer to release this as a major?

@ndelangen
Copy link
Member Author

AFACS there's no usage of process.env.BROWSER whatsoever. Removing seems to do absolutely nothing.

@tmeasday
Copy link
Member

OK, setting NODE_ENV=test there seems not correct either. Do you know why we did that? Was it for the sake of dotenv?

We can't know exactly what impact a NODE_ENV change will have on the users config/code-output. Perhaps it's safer to release this as a major?

You are probably right.

@ndelangen
Copy link
Member Author

I'll delete this code and that makes this a major release

process.env.NODE_ENV = process.env.NODE_ENV || 'test'; 

@tmeasday tmeasday merged commit cea5c89 into next Apr 8, 2020
@tmeasday tmeasday deleted the fix/remove-nodeenv-development branch April 8, 2020 05:52
@github-actions github-actions bot requested a deployment to chromatic April 8, 2020 05:53 Pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Classification: Something isn't working customer reported Tracking: This issue was reported through customer support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants