Use Rust macros for converters where possible#5532
Merged
lukastaegert merged 11 commits intomasterfrom Jun 8, 2024
Merged
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#macros-for-flagsNotice: Ensure you the latest stable Rust toolchain. If you haven't installed it yet, please see https://www.rust-lang.org/tools/install to learn how to download Rustup and install Rust. 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 #5532 +/- ##
=======================================
Coverage 98.81% 98.81%
=======================================
Files 238 238
Lines 9544 9544
Branches 2439 2439
=======================================
Hits 9431 9431
Misses 48 48
Partials 65 65 ☔ View full report in Codecov by Sentry. |
So far it supports flags and optional nodes
4cf8ce8 to
13ce2b9
Compare
|
This PR has been released as part of rollup@4.18.1. You can test it via |
This was referenced Jul 30, 2024
This was referenced Sep 15, 2024
This was referenced Sep 17, 2024
This was referenced Sep 19, 2024
This was referenced Sep 21, 2024
This was referenced Sep 25, 2024
This was referenced Oct 2, 2024
This was referenced Oct 4, 2024
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.
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
Originally, I wanted to make the conversion of flags easier by providing a macro just for encoding flags. However it turned out that it was not too difficult to generate macros for about half the AST nodes that can completely take over the encoding, so this happens in this PR. With a little more work, some of the remaining AST nodes can probably still be encoded, but this already helps a lot in adding new features like TypeScript and JSX.
It will also make it easier to swap the parser at some point if we want to.