Skip to content

fix(transformer): remove false positive duplicate __source/__self prop error#20678

Merged
graphite-app[bot] merged 1 commit intomainfrom
fix/jsx-remove-duplicate-source-self-error
Mar 24, 2026
Merged

fix(transformer): remove false positive duplicate __source/__self prop error#20678
graphite-app[bot] merged 1 commit intomainfrom
fix/jsx-remove-duplicate-source-self-error

Conversation

@Dunqing
Copy link
Copy Markdown
Member

@Dunqing Dunqing commented Mar 24, 2026

Fixes #20654

The JSX source and self plugins were erroneously reporting "Duplicate __source prop found" / "Duplicate __self prop found" warnings when a user wrote <div __source={{}} /> or <div __self={this} />. This prevented valid code from being transformed.

In Babel, the duplicate error only exists to warn users who have both the automatic runtime AND the deprecated standalone plugins enabled simultaneously (source). It's not relevant for oxc as a standalone transformer.

Now the plugins silently skip adding __source/__self when the user has already provided one, matching the behavior of Babel's standalone plugins.

@github-actions github-actions bot added the A-transformer Area - Transformer / Transpiler label Mar 24, 2026
Copy link
Copy Markdown
Member Author

Dunqing commented Mar 24, 2026


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 changes, fast-track this PR to the front of the merge queue

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.

@github-actions github-actions bot added the C-bug Category - Bug label Mar 24, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 24, 2026

Merging this PR will not alter performance

✅ 49 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing fix/jsx-remove-duplicate-source-self-error (26a31cc) with main (611fca5)

Open in CodSpeed

Footnotes

  1. 7 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 marked this pull request as ready for review March 24, 2026 09:19
@Dunqing Dunqing requested a review from overlookmotel as a code owner March 24, 2026 09:19
@Dunqing Dunqing requested a review from sapphi-red March 24, 2026 09:19
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Mar 24, 2026
Copy link
Copy Markdown
Member

Boshen commented Mar 24, 2026

Merge activity

… prop error (#20678)

Fixes #20654

The JSX source and self plugins were erroneously reporting "Duplicate `__source` prop found" / "Duplicate `__self` prop found" warnings when a user wrote `<div __source={{}} />` or `<div __self={this} />`. This prevented valid code from being transformed.

In Babel, the duplicate error only exists to warn users who have both the automatic runtime AND the deprecated standalone plugins enabled simultaneously ([source](https://github.com/babel/babel/blob/9137617716e200cb440948562789ae3744559fcb/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts#L847-L853)). It's not relevant for oxc as a standalone transformer.

Now the plugins silently skip adding `__source`/`__self` when the user has already provided one, matching the behavior of Babel's standalone plugins.
@graphite-app graphite-app bot force-pushed the fix/jsx-remove-duplicate-source-self-error branch from 26a31cc to 3375627 Compare March 24, 2026 10:48
@graphite-app graphite-app bot merged commit 3375627 into main Mar 24, 2026
26 checks passed
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 24, 2026
@graphite-app graphite-app bot deleted the fix/jsx-remove-duplicate-source-self-error branch March 24, 2026 10:51
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-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Duplicate __source prop found

3 participants