Use the Babel parser as a fallback when Acorn can’t parse code#13844
Merged
nachocodoner merged 1 commit intorelease-3.3.1from Jul 9, 2025
Merged
Use the Babel parser as a fallback when Acorn can’t parse code#13844nachocodoner merged 1 commit intorelease-3.3.1from
nachocodoner merged 1 commit intorelease-3.3.1from
Conversation
✅ Deploy Preview for v3-meteor-api-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Closed
italojs
approved these changes
Jul 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context: #13800
This PR addresses a scenario where the acorn parser can’t handle certain code syntax and broke some apps using specific dependencies that require JSX parsing just by update to Meteor 3.3. The acorn parser is used as a faster alternative to Babel’s AST parser, and the SWC parser doesn’t yet support the AST format. This parser converts code to an AST and runs checks in the import scanner to enable features like global exported variables in packages.
Using
acorn-jsxcould fix this as well, but I’d rather add a fallback to solve any other syntax scenario and regression we haven’t encountered and Babel surely supports. Adding acorn-jsx would also require updating the reify package, which we want to leave unchanged to avoid new issues. Eventually, we’ll replace acorn with SWC once it supports AST and JSX. For now, the fallback to Babel is good enough.