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.
[0.48.2] - 2025-02-02
Features
MangleIf
(feat(minifier): completeMangleIf
#8810) (Boshen)(a = _a) != null ? a : b
and(a = _a) != null ? a.b() : undefined
(feat(minifier): compress(a = _a) != null ? a : b
and(a = _a) != null ? a.b() : undefined
#8823) (sapphi-red)Array.of
(feat(minifier): implement known methodArray.of
#8805) (7086cmd)a != null ? a.b : undefined
toa?.b
(feat(minifier): compressa != null ? a.b : undefined
toa?.b
#8802) (feat(minifier): compressa != null ? a.b : undefined
toa?.b
(#8802) #8808) (Boshen)a != null ? a.b : undefined
toa?.b
(feat(minifier): compressa != null ? a.b : undefined
toa?.b
#8802) (sapphi-red)a != null ? a : b
intoa ?? b
(feat(minifier): compressa != null ? a : b
intoa ?? b
#8801) (sapphi-red)'str1,str2'.split(',')
(feat(minifier): compress array of string literals to'str1,str2'.split(',')
#8786) (sapphi-red)typeof a.b === 'undefined'
toa.b === void 0
(feat(minifier): compresstypeof a.b === 'undefined'
toa.b === void 0
#8751) (sapphi-red)a == null && b
toa ?? b
when return value is ignored (feat(minifier): compressa == null && b
toa ?? b
when return value is ignored #8749) (sapphi-red)a[0]
andthis.a
inhas_no_side_effect_for_evaluation_same_target
(feat(minifier): supporta[0]
andthis.a
inhas_no_side_effect_for_evaluation_same_target
#8748) (sapphi-red)!(a, b)
->a, !b
(feat(minifier): minimize!(a, b)
->a, !b
#8746) (Boshen)import.meta
statement (feat(minifier): remove unusedimport.meta
statement #8744) (Boshen)break
andcontinue
(feat(minifier): remove unreachable statements afterbreak
andcontinue
#8743) (Boshen)Bug Fixes
else if
was converted toif
(fix(minifier): mark as changed whenelse if
was converted toif
#8837) (翠 / green).split()
(fix(minifier): unreachable error when compressing string literal arrays with.split()
#8806) (sapphi-red)var undefined = 1; foo === null || foo === undefined
should not be compressed (fix(minifier): fixvar undefined = 1; foo === null || foo === undefined
should not be compressed #8803) (sapphi-red)+void unknown
toNaN
and fix typo (fix(minifier): avoid minifying+void unknown
toNaN
and fix typo #8784) (7086cmd){ let foo; const bar = undefined; }
->{ let foo, bar; }
(fix(minifier):{ let foo; const bar = undefined; }
->{ let foo, bar; }
#8764) (Boshen)const
tolet
if assignment to constant variable. (fix(minifier): do not changeconst
tolet
if assignment to constant variable. #8761) (Boshen)[]['concat'](1)
(fix(minifier): fix crash with[]['concat'](1)
#8750) (sapphi-red)Performance
tmp_bindings
#8735)" (perf(manger): Revert "perf(manger): remove useless tmp_bindings (#8735)" #8741) (Dunqing)Documentation
JSXExpression::EmptyExpression
(docs(ast): correct documentation forJSXExpression::EmptyExpression
#8816) (Dunqing)AstBuilder
doc comments (docs(ast): reformatAstBuilder
doc comments #8774) (overlookmotel)Refactor
Visit
more understandable (refactor(ast): make generated code forVisit
more understandable #8825) (overlookmotel)AstKind
in generated code forVisit
trait (refactor(ast): comments for enums with noAstKind
in generated code forVisit
trait #8796) (overlookmotel)VisitMut
(refactor(ast): shorten generated code forVisitMut
#8795) (overlookmotel)AstKind
(refactor(ast): remove unnecessary lint from generated code forAstKind
#8794) (overlookmotel)Visit
trait (refactor(ast): alter comments in generatedVisit
trait #8793) (overlookmotel)#[estree(type)]
attr on struct fields to#[estree(ts_type)]
(refactor(ast): rename#[estree(type)]
attr on struct fields to#[estree(ts_type)]
#8767) (overlookmotel)#[estree(type)]
attr on types to#[estree(rename)]
(refactor(ast): rename#[estree(type)]
attr on types to#[estree(rename)]
#8766) (overlookmotel)extract_id_or_assign_to_id
method (refactor(minifier): extractextract_id_or_assign_to_id
method #8822) (sapphi-red)mangleStmts
(refactor(minifier): port esbuild'smangleStmts
#8770) (Boshen)EmptyStatement
in a single place (refactor(minifier): removeEmptyStatement
in a single place #8745) (Boshen)Testing