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

Make possible to initialize SC_ATTR via REACT_APP_SC_ATTR env variable #2501

Merged
merged 6 commits into from
Jun 4, 2019

Conversation

oliverlaz
Copy link
Contributor

When working with two or more different styled-components instances on a single page (or application), SC_ATTR environment variable could be used for distinguishing between those instances.

However, in create-react-app based applications, environment variables are filtered out by matching them with a well-known pattern (REACT_APP_) -> see here.

This PR enables usage of REACT_APP_SC_ATTR environment variable as a fallback and its easier configuration via a .env file.

@quantizor
Copy link
Contributor

Can you add this for the other env variable too? SC_DISABLE_SPEEDY

@oliverlaz
Copy link
Contributor Author

Sure! PR is updated.

@quantizor quantizor added the 4.0 label May 29, 2019
@quantizor
Copy link
Contributor

@oliverlaz can you look into the CI failure?

@oliverlaz
Copy link
Contributor Author

Hey @probablyup, Somehow this DISABLE_SPEEDY flag messes up the integration test.
At first, I just thought it is a Travis issue but later I managed to reproduce it on my side as well (integration test suite requires a built version of styled-components).
I will ping you back once I find the culprit.

oliverlaz and others added 6 commits June 4, 2019 11:20
this increases the compatibility with CRA as it filters out any env
variables which don't follow the REACT_APP_* pattern
…Y env variable

this increases the compatibility with CRA as it filters out any env
variables which don't follow the REACT_APP_* pattern
@quantizor quantizor merged commit 4ca4e62 into styled-components:master Jun 4, 2019
quantizor added a commit that referenced this pull request Jun 4, 2019
quantizor added a commit that referenced this pull request Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants