Improve performance of AST parse
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.7k
- Forks
- 185
- PR merge metrics
- No merged PRs in 30d
Description
We currently use acorn for parsing JS into the AST, however there are faster alternatives now.
One of the fastest, @swc/core, is used by Next.js so its perhaps possible to parse once and share the AST so that nft wouldn't need to parse again. However, this could lead to a major rewrite since the AST is not compatible.
- Related Issue: https://github.com/swc-project/swc/issues/2123
- Docs: https://swc.rs/docs/usage/core
Another alternative, hermes-parser, is used by React Native and should have the same AST format (ESTree) which might mean its a drop-in replacement for acorn.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating nft's current acorn-based JavaScript parsing entry point, then compare @swc/core and hermes-parser for AST compatibility and performance. Benchmark the alternatives and determine whether AST sharing is feasible without the major rewrite described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, next.js, react-native
- Domain
- performance, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100