-
-
Notifications
You must be signed in to change notification settings - Fork 470
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
refactor(ast)!: change 'raw' from &str to Option<Atom> #7547
refactor(ast)!: change 'raw' from &str to Option<Atom> #7547
Conversation
Your org has enabled the Graphite merge queue for merging into mainAdd the label “0-merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix. You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks loads for tackling this.
Turns out this is more complicated than I thought! Sorry for the litany of comments below.
First off, could you please rebase on main and fix the merge conflicts so CI can run?
Most of my comments are the same - they relate to not unwrapping when can't be sure that raw
is Some
.
In lots of places we need a fallback for converting NumericLiteral
's value
to a string if raw
is None
. Probably it'd be good to add a method NumericLiteral::raw_str
which can be used in all those places (which I guess will need to return a Cow<str>
).
crates/oxc_minifier/src/ast_passes/peephole_substitute_alternate_syntax.rs
Outdated
Show resolved
Hide resolved
cc5c3a2
to
6604759
Compare
Thanks a lot for the detailed comments! Sorry, I was indeed abusing unwrap... Add a new method called Most problems should already be fixed. |
CodSpeed Performance ReportMerging #7547 will improve performances by 4.67%Comparing Summary
Benchmarks breakdown
|
Glad you found them useful and not annoying! Nice speed bump on transformer benchmarks. Could you please try and fix the failing test, and fix clippy, and then I'll review again? A couple of quick things in meantime:
Side note: I think we can also remove |
8c93101
to
9b6952f
Compare
I believe the CI failure on "Test NAPI" CI job is unrelated to content of this PR. I've also seen it on one of my recent PRs #7618. Please let me know when ready for me to review again. |
Cool, if so, the PR should be ready to be reviewed now. There might also be some comment issues, like whether I should add "Safety: xxx" above unwrap or some comments is not clearly enough. but the logic part should be done. |
9b6952f
to
7eb3802
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Branch got out of date with main. I've rebased on main and fixed conflicts. I've also taken the liberty of pushing a few small commits to fix a few things, rather than going through another round of review - I hope you don't mind.
Am going to merge now. @ShuiRuTian please take a look at the extra commits I pushed if you're interested.
Thanks loads for your work on this!
Thanks much for the detailed guide! It really helps a lot |
To be honest, I don't think this one is correct: 4874660 If |
Fix #7254
Changed all "raw" propperty of literal types(if it has this property) to Option