From 4b904b1584d60c0ae5fd16f23671f60cf05088e0 Mon Sep 17 00:00:00 2001 From: sapphi-red <49056869+sapphi-red@users.noreply.github.com> Date: Fri, 7 Nov 2025 02:33:23 +0000 Subject: [PATCH] docs(transformer): clarify `jsx.pure` option would affect JSX elements (#15376) Update the doc comment as `jsx.pure` option also affects JSX elements. https://github.com/oxc-project/oxc/blob/b1d3e005def3fe1899e77d2ace0c0584c9b22f80/crates/oxc_transformer/src/jsx/jsx_impl.rs#L779 I'll update the docs after this PR is merged. --- crates/oxc_transformer/src/jsx/options.rs | 2 +- napi/transform/index.d.ts | 2 +- napi/transform/src/transformer.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/oxc_transformer/src/jsx/options.rs b/crates/oxc_transformer/src/jsx/options.rs index dac670dfdee8b..08ed1aa7659b1 100644 --- a/crates/oxc_transformer/src/jsx/options.rs +++ b/crates/oxc_transformer/src/jsx/options.rs @@ -61,7 +61,7 @@ pub struct JsxOptions { /// Enables `@babel/plugin-transform-react-pure-annotations`. /// - /// It will mark top-level React method calls as pure for tree shaking. + /// It will mark JSX elements and top-level React method calls as pure for tree shaking. /// /// Defaults to `true`. #[serde(default = "default_as_true")] diff --git a/napi/transform/index.d.ts b/napi/transform/index.d.ts index 75874e103b52c..d8a4fc3fc6e1b 100644 --- a/napi/transform/index.d.ts +++ b/napi/transform/index.d.ts @@ -211,7 +211,7 @@ export interface JsxOptions { /** * Enables `@babel/plugin-transform-react-pure-annotations`. * - * It will mark top-level React method calls as pure for tree shaking. + * It will mark JSX elements and top-level React method calls as pure for tree shaking. * * @see {@link https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations} * diff --git a/napi/transform/src/transformer.rs b/napi/transform/src/transformer.rs index d3c45d2b45c8f..1031e4884a59f 100644 --- a/napi/transform/src/transformer.rs +++ b/napi/transform/src/transformer.rs @@ -535,7 +535,7 @@ pub struct JsxOptions { /// Enables `@babel/plugin-transform-react-pure-annotations`. /// - /// It will mark top-level React method calls as pure for tree shaking. + /// It will mark JSX elements and top-level React method calls as pure for tree shaking. /// /// @see {@link https://babeljs.io/docs/en/babel-plugin-transform-react-pure-annotations} ///