From 3a408a048505f7ef63e1ddf62337317d608f5d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Barr=C3=A9?= Date: Thu, 30 Mar 2023 00:45:20 +0200 Subject: [PATCH 1/2] chore!: drop jsxPure --- packages/plugin-react/src/index.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/plugin-react/src/index.ts b/packages/plugin-react/src/index.ts index e6fb390b0..697f120be 100644 --- a/packages/plugin-react/src/index.ts +++ b/packages/plugin-react/src/index.ts @@ -31,12 +31,6 @@ export interface Options { * @default "react" */ jsxImportSource?: string - /** - * Set this to `true` to annotate the JSX factory with `\/* @__PURE__ *\/`. - * This option is ignored when `jsxRuntime` is not `"automatic"`. - * @default true - */ - jsxPure?: boolean /** * Babel configuration applied in both dev and prod. */ @@ -128,7 +122,6 @@ export default function viteReact(opts: Options = {}): PluginOption[] { }, jsx: 'transform', jsxImportSource: opts.jsxImportSource, - jsxSideEffects: opts.jsxPure === false, }, } } else { @@ -136,7 +129,6 @@ export default function viteReact(opts: Options = {}): PluginOption[] { esbuild: { jsx: 'automatic', jsxImportSource: opts.jsxImportSource, - jsxSideEffects: opts.jsxPure === false, }, } } From 0819f8c999e41cc51c22414bb66217e51e65ee89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnaud=20Barr=C3=A9?= Date: Thu, 30 Mar 2023 11:10:49 +0200 Subject: [PATCH 2/2] add warning --- packages/plugin-react/src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/plugin-react/src/index.ts b/packages/plugin-react/src/index.ts index 697f120be..fd8876c20 100644 --- a/packages/plugin-react/src/index.ts +++ b/packages/plugin-react/src/index.ts @@ -149,6 +149,11 @@ export default function viteReact(opts: Options = {}): PluginOption[] { '[@vitejs/plugin-react] Support for classic runtime is deprecated.', ) } + if ('jsxPure' in opts) { + config.logger.warnOnce( + '[@vitejs/plugin-react] jsxPure was removed. You can configure esbuild.jsxSideEffects directly.', + ) + } runPluginOverrides = (babelOptions, context) => { const hooks = config.plugins