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

Disabling demo builds #155

Closed
loklaan opened this issue Aug 9, 2016 · 3 comments
Closed

Disabling demo builds #155

loklaan opened this issue Aug 9, 2016 · 3 comments
Assignees

Comments

@loklaan
Copy link
Collaborator

loklaan commented Aug 9, 2016

Hi there,

Just wanted to see if there was interest or acceptance for the idea of adding config to turn off production builds of Demo in react-component type?

I bring this up, because a project I am putting together has a consolidated Styleguide for demo'ing components. However, during dev, the demo environment is very useful. But I don't need it past npm start. That's my use case, which might not be that uncommon.

@insin
Copy link
Owner

insin commented Aug 10, 2016

I wouldn't be averse to that, sounds reasonable.

We probably also need something to disable wrapping of propTypes with an environment check, as some people have use cases where they want to use propTypes in production (e.g. React Bootstrap uses them to mask props, someone building a UI lib with nwb might want to do likewise).

Still not sure of the cleanest way to configure all these off-toggles for default features. I added a polyfill toggle to the top-level config object to prevent the new default polyfills being added, wondering how ugly that gets as you increase the number default features you can turn off.

@insin
Copy link
Owner

insin commented Aug 10, 2016

What do you think of making these all command-line feature toggles?

We already have some precedent with --preact (enable experimental build), --install (enable experimental dev tooling), --fallback (enable fallback serving for HTML5 History apps) and --reload (toggle a downstream feature on), none of which have any config file equivalent as being command line args lets you try them without any commitment (and you can add them to your package.json scripts if you decide you always want them).

Potential new toggles:

react-component projects:

  • --no-demo[-build]- turn demo build off
  • --no-[wrap-]proptypes - turn propTypes environment check wrapping off

react-app/web-app projects:

  • --no-polyfill - turn off inclusion of default polyfills (replacing polyfill: false config, which can only ever have that value) polyfilling affects serving, build and testing, so it gets to be a special case, as you'd have to use --no-polyfill in every command for consistency
  • --no-vendor[-bundle] - turn off automatic vendor bundle for anything from node_modules (replacing vendorBundle: false config, which can only ever have that value)

@insin insin self-assigned this Aug 10, 2016
@loklaan
Copy link
Collaborator Author

loklaan commented Aug 11, 2016

I like your reasoning for cli toggles vs config file options.

Thanks for the validation and going ahead to implement it!

@loklaan loklaan closed this as completed Aug 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants