Skip to content

Conversation

@magic-akari
Copy link
Member

@changeset-bot
Copy link

changeset-bot bot commented Jun 11, 2025

🦋 Changeset detected

Latest commit: fbdf19c

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

@magic-akari
Copy link
Member Author

I've implemented parse_commonjs on the Rust side, which gives Rust users straightforward access to this functionality.
Now the question is: how should we expose this to JavaScript users?

Currently, we have the isModule property accepting true, false, and Unknown.
Given that Acorn is planning to implement sourceType: 'commonjs', should we consider extending this with a dedicated commonjs option?

@kdy1
Copy link
Member

kdy1 commented Jun 11, 2025

Aligning with acorn sounds good to me

@magic-akari magic-akari marked this pull request as ready for review June 11, 2025 18:39
@magic-akari magic-akari requested review from a team as code owners June 11, 2025 18:39
@kdy1 kdy1 added this to the Planned milestone Jun 12, 2025
@magic-akari magic-akari requested a review from kdy1 June 12, 2025 16:16
kdy1
kdy1 previously approved these changes Jun 12, 2025
@kdy1 kdy1 merged commit 70bda6a into swc-project:main Jun 12, 2025
18 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.12.1 Jun 12, 2025
@magic-akari magic-akari deleted the fix/issue-10597 branch June 14, 2025 03:12
@swc-project swc-project locked as resolved and limited conversation to collaborators Jul 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

SWC Fails to Parse Certain CommonJS Code

2 participants