-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(es/minifier): Preserve flags while dropping elements of SeqExpr
#8907
Conversation
🦋 Changeset detectedLatest commit: 3e03eb6 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
// TODO: preserve PURE comment attached to original | ||
// sequence expression. | ||
|
||
// *e = *s.exprs.pop().unwrap(); |
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.
You can
-
assign the span of the node with
PURE
comment to the emitted node -
Accept
C: Comments
or&dyn Comments
and callmove_leading
I'll take on this |
9f9f1ea
to
898f70e
Compare
**Description:** This is required for #8907
8d526b5
to
2e76dd1
Compare
SeqExpr
CodSpeed Performance ReportMerging #8907 will improve performances by 8.8%Comparing Summary
Benchmarks breakdown
|
In code like
/*#__PURE__*/ (0, forwardRef)(Foo);
, thedead_branch_remover
pass will simplify this toforwardRef(Foo)
and remove thePURE
annotation which might be used in later passes. I added a test to show this, and commented out the line that causes it. However I'm not quite sure how to fix it.I guess the comment is attached to the original sequence expression which was removed. So we need to move the comment to the resulting expression somehow, or maybe change the span of the expression to match the old one.
I tried passing in the comments to this pass so I could move it, but it was a bit hard because of the
Parallel
implementation that would require the comments to beSend + Sync
.Any suggestions on the best approach here?