[babel 8] Type checking preset-react options#12741
[babel 8] Type checking preset-react options#12741nicolo-ribaudo merged 14 commits intobabel:mainfrom
Conversation
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0c34bc2:
|
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/44747/ |
99782ad to
1a61ea0
Compare
Co-authored-by: Nicolò Ribaudo <[email protected]>
Co-authored-by: Nicolò Ribaudo <[email protected]>
5259580 to
51e017d
Compare
| throwIfNamespace, | ||
| }; | ||
| } else { | ||
| let { pragma, pragmaFrag } = options; |
There was a problem hiding this comment.
do we need to do it here too?
let { pragma, pragmaFrag, development = false } = opts;
kinda confused what below is doing.. maybe can just do|| false
const development = !!options.development
There was a problem hiding this comment.
I think it's different to keep the Babel 7 behavior the same (where we coerced everything to a boolean); if we use a default value in the destructuring it will change with falsy values.
| const libBundles = [ | ||
| "packages/babel-parser", | ||
| "packages/babel-plugin-proposal-optional-chaining", | ||
| "packages/babel-preset-react", |
There was a problem hiding this comment.
everything is getting bundled huh 😄, feel like eventually this list will be the opposite?
There was a problem hiding this comment.
In Babel 8 I'd like to eventually bundle everything, so that we don't pay the cost of resolving all the files (some packages have many of them)
|
For the failure, we can modify the rollup options to avoid throwing for that warning. |
It seems that rollup can not detect usage in a template expression: https://github.com/babel/babel/pull/12741/checks?check_run_id=2196889572#step:6:95
|
I can push a fix for the failure if you want |
This reverts commit 2aedf64.
BABEL_8_BREAKINGflagThis PR was derived from #10927. It focuses on checking
@babel/preset-reactoptions only.