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

Projects
None yet
2 participants
@oliverlaz
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Apr 20, 2019

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

@oliverlaz

This comment has been minimized.

Copy link
Contributor Author

commented Apr 20, 2019

Sure! PR is updated.

@probablyup probablyup added the 4.0 label May 29, 2019

@probablyup

This comment has been minimized.

Copy link
Contributor

commented May 29, 2019

@oliverlaz can you look into the CI failure?

@oliverlaz

This comment has been minimized.

Copy link
Contributor Author

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 some commits Apr 15, 2019

make possible to set SC_ATTR via REACT_APP_SC_ATTR env variable
this increases the compatibility with CRA as it filters out any env
variables which don't follow the REACT_APP_* pattern
make possible to set SC_DISABLE_SPEEDY via REACT_APP_SC_DISABLE_SPEED…
…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 oliverlaz: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

continuous-integration/travis-ci/pr The Travis CI build passed
Details

probablyup added a commit that referenced this pull request Jun 4, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.