fix(@angular/build): avoid pure comment pattern in oxc transform - #34013
Merged
Conversation
clydin
approved these changes
Sep 3, 2026
| source.appendLeft(lastStatement.end, `\nreturn ${classIdName};\n})();`); | ||
| } else if (isVariableClass) { | ||
| // Wrap class inside init: `/*#__PURE__*/ (() => { let ClassName = class ClassName {}; return ClassName; })()` | ||
| // Wrap class inside init: IIFE |
Member
There was a problem hiding this comment.
Can we do
// Wrap class inside init: `(() => { let ClassName = class ClassName {}; return ClassName; })()`
to keep the example structure?
In Bun 1.4.0, single-line comments containing `/*#__PURE__*/` immediately preceding a call expression cause Bun's lexer/transpiler to interpret the call as pure and drop it during dead code elimination when its return value is unused. Sanitizing the comment avoids triggering this upstream Bun bug. Fixes angular#33973
alan-agius4
force-pushed
the
fix-oxc-bun-comment
branch
from
September 3, 2026 12:58
7728379 to
fae77b9
Compare
Collaborator
Author
|
This PR was merged into the repository. The changes were merged into the following branches:
|
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.
In Bun 1.4.0, single-line comments containing
/*#__PURE__*/immediately preceding a call expression cause Bun's lexer/transpiler to interpret the call as pure and drop it during dead code elimination when its return value is unused.Sanitizing the comment avoids triggering this upstream Bun bug.
Fixes #33973