Skip to content

Allow reading default feature flags from bundle tests #13629

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

Merged
merged 1 commit into from
Sep 12, 2018

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Sep 12, 2018

I want to run some tests both in Fire and normal modes (#13628).

But for that I need tests to switch on ReactFeatureFlags and determine the expected behavior based on that. And this doesn't work in bundle tests so I'd have to make them internal.

I don't want to make those tests internal. So instead I'm making a readonly version of ReactFeatureFlags available to bundle tests. That's sufficient to know in which mode we're running. If you attempt to write to it (as some our tests which need to stay internal do), this will throw.

I could have used something like process.env for this instead. But it felt more confusing to me to have different ways to read a feature flag.

@sizebot
Copy link

sizebot commented Sep 12, 2018

Details of bundled changes.

Comparing: 7204b63...44118e3

schedule

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
schedule.development.js n/a n/a 0 B 19.17 KB 0 B 5.74 KB UMD_DEV
schedule.production.min.js n/a n/a 0 B 3.16 KB 0 B 1.53 KB UMD_PROD
schedule-tracking.development.js -4.5% -8.4% 10.64 KB 10.16 KB 2.51 KB 2.3 KB NODE_DEV

Generated by 🚫 dangerJS

@gaearon gaearon merged commit a7bd7c3 into facebook:master Sep 12, 2018
Simek pushed a commit to Simek/react that referenced this pull request Oct 25, 2018
jetoneza pushed a commit to jetoneza/react that referenced this pull request Jan 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants