-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Use Rust macros for converters where possible #5532
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
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-flags Notice: 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 [email protected]. You can test it via |
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.