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

@oliverlaz oliverlaz commented Apr 15, 2019

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.

@probablyup
Copy link
Contributor

@probablyup probablyup commented Apr 20, 2019

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

@oliverlaz
Copy link
Contributor Author

@oliverlaz oliverlaz commented Apr 20, 2019

Sure! PR is updated.

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

@probablyup probablyup commented May 29, 2019

@oliverlaz can you look into the CI failure?

@oliverlaz
Copy link
Contributor Author

@oliverlaz oliverlaz commented May 30, 2019

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 Jun 4, 2019
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
@probablyup probablyup force-pushed the react_app_sc_attr branch from 911b25d to a3519cd Jun 4, 2019
@probablyup probablyup merged commit 4ca4e62 into styled-components:master Jun 4, 2019
1 check passed
probablyup added a commit that referenced this issue Jun 4, 2019
probablyup added a commit that referenced this issue 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
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants