Skip to content

Conversation

@GiveMe-A-Name
Copy link
Collaborator

Description:

We using is_react_compiler_required in ts or tsx file. But it's not support parse tsx syntax, so it's always return false.

https://github.com/swc-project/swc/blob/main/bindings/binding_react_compiler_node/src/support.rs#L37-L39

BREAKING CHANGE:

Related issue (if exists):

@GiveMe-A-Name GiveMe-A-Name requested a review from a team as a code owner June 23, 2025 02:34
@changeset-bot
Copy link

changeset-bot bot commented Jun 23, 2025

🦋 Changeset detected

Latest commit: adff370

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

Would it be fine to unconditionlly use tsx syntax?

@codspeed-hq
Copy link

codspeed-hq bot commented Jun 23, 2025

CodSpeed Performance Report

Merging #10682 will not alter performance

Comparing GiveMe-A-Name:fix/binding-react-compiler (adff370) with main (a8347fe)

Summary

✅ 140 untouched benchmarks

@GiveMe-A-Name
Copy link
Collaborator Author

GiveMe-A-Name commented Jun 23, 2025

Would it be fine to unconditionlly use tsx syntax?

Have any effect? I don't sure. In my impression, it's will parse a bit slower if using tsx syntax.
And I notice it's always using tsx syntax in next.js .
And ensure it will parse correctly if user using decorators, so i add decorators attributes.

@kdy1 kdy1 changed the title fix(binding_react_compiler): update parser to support TSX and TS file parsing fix(es/react-compiler): Use tsx syntax for parser Jun 23, 2025
@kdy1 kdy1 merged commit a355e37 into swc-project:main Jun 23, 2025
168 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.12.6 Jun 23, 2025
@swc-project swc-project locked as resolved and limited conversation to collaborators Jul 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants