Skip to content

fix: #284 ignore javascript from sucrase transformations - #285

Merged
thescientist13 merged 3 commits into
masterfrom
bug/issue-284-ignore-javascript-from-sucrase-transformations
Oct 10, 2026
Merged

thescientist13 merged 3 commits into
masterfrom
bug/issue-284-ignore-javascript-from-sucrase-transformations

Conversation

@thescientist13

@thescientist13 thescientist13 commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Related Issue

resolves #284

Summary of Changes

  1. ignore javascript from sucrase transformations

TODO

  1. Greenwood testing

Since Acorn uses fs.readFile and execution happens with import, there is an inherit gap where-in other file types can be imported in a file, but not processed correctly, by either WCC or WCC + Greenwood. Will probably need to find a solution for this long term.

@thescientist13 thescientist13 added bug Something isn't working 0.22.3 and removed 0.22.3 labels Oct 6, 2026

@thescientist13 thescientist13 left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

So just a callout here that there is a slight dis-connect this issue revealed, in that to parse JavaScript, we have to read the file from disk, which is different from how it gets executed, with import.

This means any framework processing of custom extensions, would have its source fed right to Acorn, which could break if it's non-standard JavaScript syntax. However, if a user has custom loader hooks setup, it would still work when executed. Something we should probably track as an issue to try and reconcile somehow.


As it relates to this change, this more formally "locks" in WCC to just the following extensions

  • JavaScript - .js, .mjs, .cjs
  • TypeScript / JSX - .ts, .jsx, .tsx

edit: there's already a discussion for this - #226

@thescientist13
thescientist13 merged commit a754e4a into master Oct 10, 2026
17 checks passed
@thescientist13
thescientist13 deleted the bug/issue-284-ignore-javascript-from-sucrase-transformations branch October 10, 2026 15:35
@thescientist13 thescientist13 self-assigned this Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plain javascript dependency is causing an execution failure

1 participant