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

[v2] Refactor loading Babel to make it behave like rest of Gatsby #4298

Merged
merged 10 commits into from
Mar 3, 2018

Conversation

KyleAMathews
Copy link
Contributor

@KyleAMathews KyleAMathews commented Mar 1, 2018

i.e use Redux + new API onCreateBabelcc

This should make understanding & using the API more fool-proof + this
PR is adding a bunch of tests where loading babelrc previously had no tests.

TODOs

  • test with real site to make sure things work as expected
  • update core plugins
  • add new babelrc docs page with sample .babelrc file for overriding defaults

@ghost ghost assigned KyleAMathews Mar 1, 2018
@ghost ghost added the review label Mar 1, 2018
useBuiltIns: `usage`,
sourceType: `unambiguous`,
shippedProposals: true, // includes async/await and Object spread/rest
targets: { browsers: browserslist },
Copy link
Contributor

Choose a reason for hiding this comment

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

I learned the hard way the other day that preset-env should always force include object-rest-spread (https://github.com/4Catalyzer/babel-preset-4catalyzer/blob/master/index.js#L41) webpack can't handle the syntax even if the browser can.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Huh, that sounds really painful to debug.

shippedProposals does add this — perhaps we should validate user's babelrcs to make sure they've either set shippedPropsals or that they include it directly.

@KyleAMathews KyleAMathews changed the title [v2] WIP refactor loading Babel to make it behave like rest of Gatsby [v2] Refactor loading Babel to make it behave like rest of Gatsby Mar 3, 2018
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.

2 participants