Skip to content

docs(transformer): clarify jsx.pure option would affect JSX elements#15376

Merged
graphite-app[bot] merged 1 commit intomainfrom
11-06-docs_transformer_clarify_jsx.pure_option_would_affect_jsx_elements
Nov 7, 2025
Merged

docs(transformer): clarify jsx.pure option would affect JSX elements#15376
graphite-app[bot] merged 1 commit intomainfrom
11-06-docs_transformer_clarify_jsx.pure_option_would_affect_jsx_elements

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Nov 6, 2025

Update the doc comment as jsx.pure option also affects JSX elements.

ctx.ast.expression_call_with_pure(span, callee, NONE, arguments, false, self.pure)

I'll update the docs after this PR is merged.

@github-actions github-actions bot added A-transformer Area - Transformer / Transpiler C-docs Category - Documentation. Related to user-facing or internal documentation labels Nov 6, 2025
Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@sapphi-red sapphi-red requested a review from Dunqing November 6, 2025 12:17
@sapphi-red sapphi-red marked this pull request as ready for review November 6, 2025 12:18
Copilot AI review requested due to automatic review settings November 6, 2025 12:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates documentation comments to more accurately describe the behavior of the @babel/plugin-transform-react-pure-annotations plugin. The update clarifies that the plugin marks both JSX elements and top-level React method calls as pure, rather than only top-level React method calls.

  • Updated documentation to include "JSX elements" in the description of what gets marked as pure

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
napi/transform/src/transformer.rs Updated doc comment for JsxOptions to clarify pure annotation scope
napi/transform/index.d.ts Updated TypeScript documentation comment to match Rust implementation
crates/oxc_transformer/src/jsx/options.rs Updated doc comment in core transformer options to reflect accurate behavior

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 6, 2025

CodSpeed Performance Report

Merging #15376 will not alter performance

Comparing 11-06-docs_transformer_clarify_jsx.pure_option_would_affect_jsx_elements (1f27af7) with main (b1d3e00)

Summary

✅ 33 untouched
⏩ 4 skipped1

Footnotes

  1. 4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Nov 7, 2025
Copy link
Member

Dunqing commented Nov 7, 2025

Merge activity

@graphite-app graphite-app bot force-pushed the 11-06-docs_transformer_clarify_jsx.pure_option_would_affect_jsx_elements branch from 1f27af7 to 4b904b1 Compare November 7, 2025 02:33
@graphite-app graphite-app bot merged commit 4b904b1 into main Nov 7, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 11-06-docs_transformer_clarify_jsx.pure_option_would_affect_jsx_elements branch November 7, 2025 02:39
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-transformer Area - Transformer / Transpiler C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments