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

Put DEV-only code into DEV blocks #14673

Merged
merged 1 commit into from
Jan 23, 2019
Merged

Put DEV-only code into DEV blocks #14673

merged 1 commit into from
Jan 23, 2019

Conversation

gaearon
Copy link
Collaborator

@gaearon gaearon commented Jan 23, 2019

This confused me a bit. I think it's sometimes dangerous to leave these assignments without DEV blocks because one might think the variable itself is legit to use outside of DEV, and have a prod error.

In practice the name already codifies it's DEV only but I added guards for consistency with other code.

Copy link
Contributor

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too bad we can't use Flow for this somehow.

Copy link
Contributor

@threepointone threepointone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fair, I'm happy with being more explicit. thanks!

@gaearon gaearon merged commit 9944392 into facebook:master Jan 23, 2019
@gaearon gaearon deleted the dev-nits branch January 23, 2019 17:00
n8schloss pushed a commit to n8schloss/react that referenced this pull request Jan 31, 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.

4 participants