-
-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Turn on Babel helpers
#5093
Turn on Babel helpers
#5093
Changes from 2 commits
775387a
ca2777f
b86f9bd
937d786
b74852a
3cdbbfe
3dbc5f8
2b06e8b
8ef839d
55a605b
071aa4f
82c82f8
a404acc
5bb2ee2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,5 +9,5 @@ | |
const create = require('./create'); | ||
|
||
module.exports = function(api, opts) { | ||
return create(api, opts, 'development'); | ||
return create(api, { helpers: false, ...(opts || {}) }, 'development'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's fine to spread undefined. I don't think you need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is object spread though. Is it supported in all envs we target? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. look at that. they thought of everything. |
||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"presets": [["react-app", { "helpers": true }]] | ||
"presets": ["react-app"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -234,12 +234,7 @@ module.exports = { | |
options: { | ||
// @remove-on-eject-begin | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is removed on eject. Where do we decide what to write on eject? Seems like we'd lose this. Maybe it means I wasn't right about the app default. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
babelrc: false, | ||
presets: [ | ||
[ | ||
require.resolve('babel-preset-react-app'), | ||
{ helpers: true }, | ||
], | ||
], | ||
presets: [require.resolve('babel-preset-react-app')], | ||
// Make sure we have a unique cache identifier, erring on the | ||
// side of caution. | ||
// We remove this when the user ejects because the default | ||
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, shouldn't default be false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the non-dependency version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah it's for app code. Hmm.
Would it break these instructions?
https://reactjs.org/docs/add-react-to-a-website.html#run-jsx-preprocessor
If so I think it should still be off by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://github.com/facebook/create-react-app/pull/5093/files#diff-e4eb38a3161bed144100754a3e97763dR26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right but I don't want this to break non-commonjs usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe we should have a separate entry point for "standalone" usage.