New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split up converter.rs into AST nodes #5510
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thank you for your contribution! ❤️You can try out this pull request locally by installing Rollup via npm install rollup/rollup#split-up-converter Notice: Ensure you have installed Rust nightly. If you haven't installed it yet, please first see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust, then see https://rust-lang.github.io/rustup/concepts/channels.html to learn how to install Rust nightly. or load it into the REPL: |
Performance report!Rough benchmark
Internal benchmark
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5510 +/- ##
=======================================
Coverage 98.81% 98.81%
=======================================
Files 238 238
Lines 9540 9540
Branches 2437 2437
=======================================
Hits 9427 9427
Misses 48 48
Partials 65 65 ☔ View full report in Codecov by Sentry. |
If an unwrapper only calls methods from a single AST node, it is placed in the same file
This PR has been released as part of rollup@4.18.0. You can test it via |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
Initially, the Rust side of the AST converter was mostly a single file,
converter.rs
, spanning several thousand lines of code. My goal, however, is to structure the Rust side similarly to the TypeScript side by co-location AST node related code.This PR will create a separate Rust file for each (ESTree) AST node as with Rust, it is possible to split up the AstConverter implementation over as many files as we like. In the future, related tree-shaking and rendering logic can be placed within the same files, making it easy to see the lifetime of an AST node in one place.