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

Find and use a better pattern for excluding things from prod builds #93

Open
pineapplemachine opened this issue Jul 20, 2017 · 1 comment
Assignees
Labels
effort: moderate The issue will probably take a single contributor one or two days of work to resolve. type: polish The issue involves making existing functionality more usable.

Comments

@pineapplemachine
Copy link
Owner

pineapplemachine commented Jul 20, 2017

Currently lines such as

tests: process.env.NODE_ENV !== "development" ? undefined : { ... }

are present all over the code base. If at all possible, a more concise and approachable pattern should be used. tests: isProd ? undefined : { ... } would be an example of such a better pattern.

As part of this task: Once a better pattern is found, all places in the codebase that currently compare against process.env.NODE_ENV should be replaced with that newer pattern.

It is a requirement of the pattern that minified production builds (currently created using nwb build) must totally exclude development-only branches and must totally exclude docs and tests objects from things like wrapped functions where the old pattern is currently used.

@pineapplemachine pineapplemachine added effort: moderate The issue will probably take a single contributor one or two days of work to resolve. type: polish The issue involves making existing functionality more usable. labels Jul 20, 2017
@pineapplemachine
Copy link
Owner Author

Currently finding that, while I write more bare or entirely excluded argument validation logic in prod builds, it becomes impossible to test the build with that different logic using the test suite since the same env var switch both hides tests and switches the validation logic. It would be extremely good if this task also made it possible to separately and concisely check for whether docs and/or tests should be excluded from the build, and whether the dev- or prod-appropriate args validation logic should be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: moderate The issue will probably take a single contributor one or two days of work to resolve. type: polish The issue involves making existing functionality more usable.
Projects
None yet
Development

No branches or pull requests

2 participants