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

docs(babel-preset-gatsby): document --save-dev flag in README #10434

Merged
merged 1 commit into from
Dec 12, 2018

Conversation

enzoferey
Copy link
Contributor

As it is documented on the preset READMe (babel-preset-gatsby), it should be installed as a devDependency.

As it is documented on the preset READMe ([`babel-preset-gatsby`](https://github.com/gatsbyjs/gatsby/tree/master/packages/babel-preset-gatsby)), it should be installed as a devDependency.
@enzoferey enzoferey requested a review from a team December 12, 2018 12:50
@pieh
Copy link
Contributor

pieh commented Dec 12, 2018

I don't think this should as dev dependency - if someone would npm install --production, it wouldn't be installed. It would probably still work because babel-preset-gatsby would be installed by gatsby package, so it would work as transitive dependency.

@enzoferey
Copy link
Contributor Author

As far as I know, all the babel related stuff if always installed as a devDependency (except @babel/plugin-transform-runtime).

How different is babel-preset-gatsby than any other babel preset ? Looking at its source it just reuses a set of other presets and plugins with some specific configs...

@DSchau
Copy link
Contributor

DSchau commented Dec 12, 2018

@enzoferey there are some considerations here. I generally agree with you that it probably makes sense to make this a devDep, but as @pieh notes there are some edge cases, particularly around the production flag. We want to minimize the amount of those occurring for users, because that's just never a fun thing to deal with!

That being said--let's merge this, because I do think this is technically more correct. babel and other build-time tooling is generally considered a devDependency and is not required for your production, runtime code.

Copy link
Contributor

@DSchau DSchau left a comment

Choose a reason for hiding this comment

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

@DSchau DSchau changed the title Fix type of dependency to dev docs(babel-preset-gatsby): document --save-dev flag in README Dec 12, 2018
@DSchau DSchau merged commit c12336a into master Dec 12, 2018
@DSchau DSchau deleted the fix-dependency-type branch December 12, 2018 19:26
@enzoferey
Copy link
Contributor Author

enzoferey commented Dec 12, 2018

Great @DSchau ! For me it was more about finding out its proper placement, it doesn't make sense to label it as a dependency on the website and as a devDepedency on Github 😄

I understand that it could cause hard to spot errors, but aren't other babel presets/plugins marked as devDependencies in the same position ?

I mean, if instead babel-preset-gatsby it's just babel-preset-react, it would be missing as well if you install with the production flag, so your React code wouldn't get transpiled and everything would crash.

I had never really thought about it, but I guess dependencies in deployment servers are usually installed without production flag and the production flag is then passed during build time. When would you do it the other way around ?

m-allanson added a commit to Bouncey/gatsby that referenced this pull request Dec 14, 2018
* master: (33 commits)
  fix(blog): youfit case study typofix
  Doc improvements to Visual testing with Storybook guide (gatsbyjs#10436)
  fix(gatsby-plugin-offline): prevent incorrect revisioning of static file by workbox (gatsbyjs#10416)
  fix(starters): ttag repo link
  fix typo in pull request template (gatsbyjs#10454)
  fix(www) Fix query for plugin links always ?=undefined (gatsbyjs#10453)
  chore(release): Publish
  fix(gatsby): fix extracting StaticQuery nested in shorthand fragment (gatsbyjs#10443)
  fix(www): avoid querying for no-cache=1 (gatsbyjs#10389)
  fix(gatsby-image): update typescript definitions - properly mark fields as optional (gatsbyjs#10419)
  refactor(gatsby): improve EnsureResources (gatsbyjs#10224)
  Fixed minor Typos and grammatical errors (gatsbyjs#9353)
  docs: add ClinciJS website into showcase (gatsbyjs#10437)
  docs(babel-preset-gatsby): document --save-dev flag in README (gatsbyjs#10434)
  fix(docs): Environment Variables Examples (gatsbyjs#10406)
  chore(release): Publish
  [gatsby-image] re: fade out base64 on full image load (gatsbyjs#7539)
  docs(starter-library): add example to starter library (gatsbyjs#10425)
  docs(gatsby-plugin-offline): specify to not HTTP-cache sw.js (gatsbyjs#10430)
  fix(docs): prompt => confirm (gatsbyjs#10431)
  ...
gpetrioli pushed a commit to gpetrioli/gatsby that referenced this pull request Jan 22, 2019
…js#10434)

As it is documented on the preset READMe ([`babel-preset-gatsby`](https://github.com/gatsbyjs/gatsby/tree/master/packages/babel-preset-gatsby)), it should be installed as a devDependency.
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

Successfully merging this pull request may close these issues.

3 participants