Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Make process shim not necessary on production environments #472

Merged
merged 3 commits into from
May 31, 2018
Merged

Make process shim not necessary on production environments #472

merged 3 commits into from
May 31, 2018

Conversation

kaisermann
Copy link
Contributor

Fixes #403

Copy link
Contributor

@k1r0s k1r0s left a comment

Choose a reason for hiding this comment

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

Would prefer this one just to ensure that we don't throw any exception because env is null or undefined

const DEV = typeof process !== 'undefined' && process.env && 'development'!=='production'

Additional checks are free

@kaisermann
Copy link
Contributor Author

kaisermann commented May 29, 2018

I agree. Done!

@lukeed
Copy link
Member

lukeed commented May 29, 2018

Is the shim still skipped if we do this?

const DEV = typeof process === 'undefined' || process.env.NODE_ENV !== 'production';

@k1r0s
Copy link
Contributor

k1r0s commented May 30, 2018

@lukeed I would preffer @kaisermann statement since is more easy to read and has no chance to raise NPE

@k1r0s
Copy link
Contributor

k1r0s commented May 30, 2018

LGFM! any comments before merging?

@lukeed
Copy link
Member

lukeed commented May 30, 2018

Nope~! I don't think mine is any harder to read, but I'm happy as long as a solution works 😄

@k1r0s k1r0s merged commit bb3a6a0 into preactjs:master May 31, 2018
@k1r0s
Copy link
Contributor

k1r0s commented May 31, 2018

Slightly hard haha, both are easy to read sorry :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants