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

Extract Babel configuration to a separate package #674

Closed
fson opened this issue Sep 18, 2016 · 12 comments
Closed

Extract Babel configuration to a separate package #674

fson opened this issue Sep 18, 2016 · 12 comments
Milestone

Comments

@fson
Copy link
Contributor

fson commented Sep 18, 2016

Once the monorepo configuration in #419 has landed, we should move Babel configuration to a preset package and linting rules to an ESLint config package.

This will improve the ejected experience, because we will generate less configuration and also simplify some of the underlying code, which is getting quite complex because of the differences between running inside react-scripts and in the ejected mode (as can be seen in #602).

In the long term providing smaller configuration packages makes it easier to eject without opting in to maintain all the aspects of the config. This can also make forks that reuse the config easier to maintain.

@fson
Copy link
Contributor Author

fson commented Sep 19, 2016

I could look into this soon, but I wonder what we should call these packages? I'll throw in some random ideas:

  • Babel preset: babel-preset-react-app, babel-preset-react-recommended, babel-preset-create-react-app?
  • ESLint config: probably similar to the Babel preset name, but prefixed eslint-config-?

@fson fson changed the title Extract Babel and ESLint presets to separate packages Extract Babel configuration to a separate package Sep 20, 2016
@fson
Copy link
Contributor Author

fson commented Sep 20, 2016

Renaming this issue to be only about the Babel preset, because there was a separate issue about ESLint config: #655.

@AlicanC
Copy link

AlicanC commented Sep 20, 2016

I vote for babel-preset-create-react-app since CRA will be its scope.

(Though, in the future, I'd love to see official FB recommandations under babel-preset-facebook and eslint-config-facebook which CRA, React and React Native would use or compose.)

@fson
Copy link
Contributor Author

fson commented Sep 20, 2016

@AlicanC There's already eslint-config-fbjs which is used at least in FBJS, and (with stricter extensions) in React and Jest.

However it seems to me that an CRA's configuration (used for React apps) would have different goals than than the FBJS configuration (used for FB libraries).

@gaearon
Copy link
Contributor

gaearon commented Sep 21, 2016

babel-preset-react-app sounds good. Squatted.

@gaearon gaearon added this to the 0.5.0 milestone Sep 21, 2016
@gaearon
Copy link
Contributor

gaearon commented Sep 22, 2016

@fson Do you think you can take this?

@fson
Copy link
Contributor Author

fson commented Sep 22, 2016

@gaearon Yeah, planning to tackle this today or tomorrow. Should be pretty straightforward now that presets can also accept options (we probably need this for different development/production configs).

@gaearon
Copy link
Contributor

gaearon commented Sep 22, 2016

I think it might be reasonable to just use Babel env option and not use configuration.

@gaearon
Copy link
Contributor

gaearon commented Sep 22, 2016

As a follow up we should make it so we have a .babelrc instead of two configs, and copy that file when ejecting.

@fson
Copy link
Contributor Author

fson commented Sep 22, 2016

Absolutely. I had this is mind when doing the split already, but didn't want to touch too many things at once.

@gaearon
Copy link
Contributor

gaearon commented Sep 22, 2016

@fson FYI, I’m working on it already but happy to leave it to you to polish.

@gaearon
Copy link
Contributor

gaearon commented Sep 22, 2016

#705

gaearon added a commit that referenced this issue Sep 22, 2016
@gaearon gaearon closed this as completed Sep 22, 2016
feiqitian pushed a commit to feiqitian/create-react-app that referenced this issue Oct 25, 2016
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants