From e74cd60d073c575f03ff8d0fc04eb93902a4979b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 7 Jul 2020 17:14:00 -0400 Subject: [PATCH 1/3] docs: react related breaking changes --- docs/plugin-transform-react-jsx.md | 16 ++-------------- docs/preset-react.md | 22 +++++----------------- 2 files changed, 7 insertions(+), 31 deletions(-) diff --git a/docs/plugin-transform-react-jsx.md b/docs/plugin-transform-react-jsx.md index d05ec8b3f9..e7da9e83cf 100644 --- a/docs/plugin-transform-react-jsx.md +++ b/docs/plugin-transform-react-jsx.md @@ -8,7 +8,7 @@ sidebar_label: transform-react-jsx ### React Automatic Runtime -Automatic runtime is a feature available in v7.9.0. With this runtime enabled, the functions that JSX compiles to will be imported automatically. +Automatic runtime is a feature available in v7.9.0 and becomes default in v8.0.0. With this runtime enabled, the functions that JSX compiles to will be imported automatically. **In** @@ -251,7 +251,7 @@ With options: "@babel/plugin-transform-react-jsx", { "throwIfNamespace": false, // defaults to true - "runtime": "automatic", // defaults to classic + "runtime": "classic", // defaults to automatic "importSource": "custom-jsx-library" // defaults to react } ] @@ -320,15 +320,3 @@ Note that the `@jsx React.DOM` pragma has been deprecated as of React v0.12 `string`, defaults to `React.Fragment`. Replace the component used when compiling JSX fragments. - -### `useBuiltIns` - -`boolean`, defaults to `false`. - -When spreading props, use `Object.assign` directly instead of Babel's extend helper. - -### `useSpread` - -`boolean`, defaults to `false`. - -When spreading props, use inline object with spread elements directly instead of Babel's extend helper or `Object.assign`. diff --git a/docs/preset-react.md b/docs/preset-react.md index b1204a21f0..e6674ae874 100644 --- a/docs/preset-react.md +++ b/docs/preset-react.md @@ -49,11 +49,11 @@ With options: [ "@babel/preset-react", { - "pragma": "dom", // default pragma is React.createElement (only in classic runtime) - "pragmaFrag": "DomFrag", // default is React.Fragment (only in classic runtime) + // "pragma": "dom", // default pragma is React.createElement (only in classic runtime) + // "pragmaFrag": "DomFrag", // default is React.Fragment (only in classic runtime) "throwIfNamespace": false, // defaults to true - "runtime": "classic" // defaults to classic - // "importSource": "custom-jsx-library" // defaults to react (only in automatic runtime) + "runtime": "automatic", // defaults to automatic + "importSource": "custom-jsx-library" // defaults to react (only in automatic runtime) } ] ] @@ -80,7 +80,7 @@ require("@babel/core").transform("code", { #### `runtime` -`classic | automatic`, defaults to `classic` +`classic | automatic`, defaults to `automatic` Decides which runtime to use. @@ -126,18 +126,6 @@ Replace the function used when compiling JSX expressions. Replace the component used when compiling JSX fragments. -#### `useBuiltIns` - -`boolean`, defaults to `false`. - -Will use the native built-in instead of trying to polyfill behavior for any plugins that require one. - -#### `useSpread` - -`boolean`, defaults to `false`. - -When spreading props, use inline object with spread elements directly instead of Babel's extend helper or `Object.assign`. - ### .babelrc.js ```js From a8a80e104fd6e34b3c9fd6261e840c29df01dd57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 21 Jul 2020 15:42:41 -0400 Subject: [PATCH 2/3] Update docs/plugin-transform-react-jsx.md --- docs/plugin-transform-react-jsx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugin-transform-react-jsx.md b/docs/plugin-transform-react-jsx.md index e7da9e83cf..29a7425da4 100644 --- a/docs/plugin-transform-react-jsx.md +++ b/docs/plugin-transform-react-jsx.md @@ -8,7 +8,7 @@ sidebar_label: transform-react-jsx ### React Automatic Runtime -Automatic runtime is a feature available in v7.9.0 and becomes default in v8.0.0. With this runtime enabled, the functions that JSX compiles to will be imported automatically. +Automatic runtime is a feature available in v7.9.0 and becomes the default in v8.0.0. With this runtime enabled, the functions that JSX compiles to will be imported automatically. **In** From bbfea946a0dbf2e18ceb291642484b6103d504a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Tue, 21 Jul 2020 17:01:13 -0400 Subject: [PATCH 3/3] Update docs/plugin-transform-react-jsx.md Co-authored-by: Brian Ng --- docs/plugin-transform-react-jsx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugin-transform-react-jsx.md b/docs/plugin-transform-react-jsx.md index 29a7425da4..e5c7b6634c 100644 --- a/docs/plugin-transform-react-jsx.md +++ b/docs/plugin-transform-react-jsx.md @@ -8,7 +8,7 @@ sidebar_label: transform-react-jsx ### React Automatic Runtime -Automatic runtime is a feature available in v7.9.0 and becomes the default in v8.0.0. With this runtime enabled, the functions that JSX compiles to will be imported automatically. +The automatic runtime is the default in v8.0.0. When enabled, the functions that Babel compiles JSX to are automatically imported. **In**