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.45.0] - 2025-01-11
7f69561 ast: [BREAKING]
oxc_ast
do not exportBigUint
(refactor(ast)!:oxc_ast
do not exportBigUint
#8428) (overlookmotel)d8b27af ast: [BREAKING] No unneccesary trailing underscores on
AstBuilder
method names (refactor(ast)!: no unneccesary trailing underscores onAstBuilder
method names #8283) (overlookmotel)5106088 ast: [BREAKING] Remove
FromIn<Expression> for Statement
(refactor(ast)!: removeFromIn<Expression> for Statement
#8280) (overlookmotel)Features
IntoIterator
for&mut Vec
(feat(allocator): implementIntoIterator
for&mut Vec
#8389) (overlookmotel)raw
field ofNumericLiteral
andStringLiteral
inContentEq
(feat(ast_tools): ignoreraw
field ofNumericLiteral
andStringLiteral
inContentEq
#8417) (Boshen)\n
is inside template literals (feat(codegen): print real newline when\n
is inside template literals #8178) (Boshen)CompressOptions::target
(feat(minfier): addCompressOptions::target
#8179) (Boshen)0
fromnew Int8Array(0)
and other TypedArrays (feat(minifier): drop0
fromnew Int8Array(0)
and other TypedArrays #8431) (sapphi-red)new
from NativeErrors /AggregateError
(feat(minifier): removenew
from NativeErrors /AggregateError
#8430) (sapphi-red)!(x === undefined)
->x !== undefined
(feat(minifier): minimize not!(x === undefined)
->x !== undefined
#8429) (Boshen)if(false){}
in a single pass (feat(minifier): removeif(false){}
in a single pass #8421) (Boshen)ambiguous if else
(feat(minifier): foldambiguous if else
#8415) (Boshen)a != null ? a : b
->a ?? b
(feat(minifier):a != null ? a : b
->a ?? b
#8352) (camc314)x = x || 1
tox ||= 1
(feat(minifier): compressx = x || 1
tox ||= 1
#8368) (sapphi-red)a.b = a.b + c
toa.b += c
(feat(minifier): compressa.b = a.b + c
toa.b += c
#8367) (sapphi-red)a.b || (a.b = c)
toa.b ||= c
(feat(minifier): compressa.b || (a.b = c)
toa.b ||= c
#8366) (sapphi-red)new Array(2)
->[,,]
(feat(minifier): compressnew Array(2)
->[,,]
#8344) (sapphi-red)new Array(7n)
->[7n]
(feat(minifier): compressnew Array(7n)
->[7n]
#8343) (sapphi-red)({ ...null })
->({})
(feat(minifier): fold object spread({ ...null })
->({})
#8339) (Boshen)if (test) {}
->test
(feat(minifier): remove empty if statmentif (test) {}
->test
#8336) (Boshen)!0 + null !== 1
->!0 + null != 1
(feat(minifier): minimize!0 + null !== 1
->!0 + null != 1
#8332) (Boshen)a || (a = b)
toa ||= b
(feat(minifier): compressa || (a = b)
toa ||= b
#8315) (sapphi-red)a = a + b
toa += b
(feat(minifier): compressa = a + b
toa += b
#8314) (sapphi-red)new
fromnew Error
/new Function
/new RegExp
(feat(minifier): removenew
fromnew Error
/new Function
/new RegExp
#8313) (sapphi-red)x["0"]
-> x[0] (feat(minifier): minimizex["0"]
-> x[0] #8316) (Boshen)do{}while(true)
->do;while(true)
(feat(minifier): minimizedo{}while(true)
->do;while(true)
#8311) (Boshen)(x = 1) === 1
->(x = 1) == 1
(feat(minifier): minimize(x = 1) === 1
->(x = 1) == 1
#8310) (Boshen)try
statement (feat(minifier): minimize emptytry
statement #8309) (Boshen).toString()
(feat(minifier): fold.toString()
#8308) (Boshen)if(x >> y == 0){}
->if(!(x >> y)){}
(feat(minifier): foldif(x >> y == 0){}
->if(!(x >> y)){}
#8277) (Boshen)String()
->''
,Number()
->false
(feat(minifier): foldString()
->''
,Number()
->false
#8274) (Boshen){[1]: _}
-> {1: _} (feat(minifier): compress property key{[1]: _}
-> {1: _} #8272) (Boshen)BigInt(1n)
->1n
(feat(minifier): foldBigInt(1n)
->1n
#8270) (Boshen)Number
(feat(minifier): minify call expressionstoNumber
#8267) (camc314){}
evals tof64::NaN
(Boshen)String.fromCharCode
(feat(minifier): constant foldString.fromCharCode
#8248) (Boshen)~undefined
,~null
,~true
,~false
(feat(minifier): minimize~undefined
,~null
,~true
,~false
#8247) (Boshen)'x'.toString()
andtrue.toString()
(feat(minifier): constant fold'x'.toString()
andtrue.toString()
#8246) (Boshen)Number
constructor (feat(minifier): minimizeNumber
constructor #8245) (Boshen)!!!foo ? bar : baz
->foo ? baz : bar
(feat(minifier): minsize!!!foo ? bar : baz
->foo ? baz : bar
#8244) (Boshen)1==x
=>x==1
(feat(minifier): always put literals on the rhs of equal op1==x
=>x==1
#8240) (Boshen)return
statement (feat(minifier): remove last redundantreturn
statement #8234) (Boshen)foo ? foo : bar
andfoo ? bar : foo
(feat(minifier): minimizefoo ? foo : bar
andfoo ? bar : foo
#8229) (Boshen)typeof x == 'undefined'
(feat(minifier): minimize all variants oftypeof x == 'undefined'
#8227) (Boshen)if(x)return;y
->if(!x)y
(feat(minifier): foldif(x)return;y
->if(!x)y
#8226) (Boshen)ConvertToDottedProperties
(feat(minifier): addConvertToDottedProperties
#8212) (Boshen)RemoveUnusedCode
(feat(minifier): addRemoveUnusedCode
#8210) (Boshen)MinimizeExitPoints
and ExploitAssigns` boilerplate (feat(minifier): addMinimizeExitPoints
and ExploitAssigns` boilerplate #8203) (Boshen)StatementFusion
(feat(minifier): improveStatementFusion
#8194) (Boshen)NaN
tof64::NAN
(feat(minifier): changeNaN
tof64::NAN
#8191) (Boshen)foo?.['bar']
tofoo?.bar
(feat(minifier): changefoo?.['bar']
tofoo?.bar
#8176) (翠 / green)string.length
/array.length
(feat(minifier): foldstring.length
/array.length
#8172) (sapphi-red)foo['bar']
-> foo.bar (feat(minifier): changefoo['bar']
-> foo.bar #8169) (Boshen)typeof foo == undefined
intofoo == undefined
when possible (feat(minifier): foldtypeof foo == undefined
intofoo == undefined
when possible #8160) (翠 / green)typeof foo != "undefined"
intotypeof foo < "u"
(feat(minifier): foldtypeof foo != "undefined"
intotypeof foo < "u"
#8159) (翠 / green)Infinity
intof64::Infinity
(feat(minifier): normalizeInfinity
intof64::Infinity
#8148) (Boshen)PropertyKey
(feat(minifier): minify stringPropertyKey
#8147) (Boshen)instanceof
(feat(minifier): constant foldinstanceof
#8142) (翠 / green)a + 'b' + 'c'
->a + 'bc'
(feat(minifier): minimizea + 'b' + 'c'
->a + 'bc'
#8137) (Boshen)if (x) if (y) z
->if (x && y) z
(feat(minifier): minimizeif (x) if (y) z
->if (x && y) z
#8136) (Boshen)if(foo) bar else baz
->foo ? bar : baz
(feat(minifier): minimizeif(foo) bar else baz
->foo ? bar : baz
#8133) (Boshen)if (x) return; return 1
->return x ? void 0 : 1
(feat(minifier): minimizeif (x) return; return 1
->return x ? void 0 : 1
#8130) (Boshen)if(!x) foo()
->x || foo()
(feat(minifier): minimizeif(!x) foo()
->x || foo()
#8122) (Boshen)if(foo) bar
->foo && bar
(feat(minifier): minimizeif(foo) bar
->foo && bar
#8121) (Boshen)Normalize
ast pass (feat(minifier): addNormalize
ast pass #8120) (Boshen)var
into for loop initializer (feat(minifier): collapsevar
into for loop initializer #8119) (Boshen)typeof foo === 'number'
=>typeof foo == 'number'
(feat(minifier):typeof foo === 'number'
=>typeof foo == 'number'
#8112) (Boshen)a instanceof b == true
(feat(mininifier): minimize variants ofa instanceof b == true
#8241) (Boshen)Bug Fixes
IntoIterator
forVec
(fix(allocator): fix lifetimes onIntoIterator
forVec
#8388) (overlookmotel)ContentEq
andContentHash
impls for literal types (fix(ast): fixContentEq
andContentHash
impls for literal types #8426) (overlookmotel)return 1n
output (fix(codegen): fix incorrect minifiedreturn 1n
output #8374) (Boshen)search_original_line_and_column
(fix(codegen): source map builder panicked because it attempted to subtract with overflow insearch_original_line_and_column
#8185) (Dunqing)to_int_32
value for Infinity (fix(ecmascript): incorrectto_int_32
value for Infinity #8144) (翠 / green)Source
is notClone
(fix(lexer):Source
is notClone
#8294) (overlookmotel)top_level: true
(fix(mangler): keep exported symbols fortop_level: true
#7927) (翠 / green)self.changed
when minimizing if stmts (fix(minifier): correctly setself.changed
when minimizing if stmts #8420) (camc314)!!x
is not idempotent inRemoveDeadCode
(fix(minifier):!!x
is not idempotent inRemoveDeadCode
#8419) (Boshen)Object.defineProperty
in sequence expressions (fix(minifier): do not minifyObject.defineProperty
in sequence expressions #8416) (Boshen)+0n
producesTypeError
(fix(minifier):+0n
producesTypeError
#8410) (Boshen)a in b
has error throwing side effect (fix(minifier):a in b
has error throwing side effect #8406) (Boshen)#constructor
(fix(minifier): cannot transform property key#constructor
#8405) (Boshen)instanceof
has error throwing side effect (fix(minifier):instanceof
has error throwing side effect #8378) (Boshen)prototype
cannot be changed (fix(minifier): computed property keyprototype
cannot be changed #8373) (Boshen)undefined
in return statement (fix(minifier): do not remove shadownedundefined
in return statement #8371) (Boshen)-0 != +0
(fix(minifier): do not fold literals in-0 != +0
#8278) (Boshen)is_in_boolean_context
(fix(minifier): handle arrow fn expressions correctly inis_in_boolean_context
#8260) (camc314)peephole_minimize_conditions
(fix(minifier): fix panic inpeephole_minimize_conditions
#8242) (Boshen)(x ? true : y)
(fix(minifier): fix incorrect return value for(x ? true : y)
#8233) (Boshen)Expression::AssignmentExpression
(fix(minifier): remove incorrect foldExpression::AssignmentExpression
#8211) (Boshen)0 instanceof F
(fix(minifier): do not constant fold0 instanceof F
#8199) (Boshen)PropertyKey
(fix(minifier): minify stringPropertyKey
#8177) (sapphi-red)const
andenum
(fix(parser): allow line breaks betweenconst
andenum
#8193) (branchseer)super()
in nested class (fix(transformer/arrow-functions): outersuper()
in nested class #8382) (Dunqing)super_methods
on aStack
to fix nested async methods (fix(transformer/arrow-functions): storesuper_methods
on aStack
to fix nested async methods #8331) (Dunqing)_this = this
should be inserted after super call expression (fix(transformer/arrow-functions):_this = this
should be inserted after super call expression #8024) (Dunqing)var
in hoist scope (fix(transformer/private-methods): create brand bindingvar
in hoist scope #8361) (overlookmotel)import =
whenonly_remove_type_imports
is true (fix(transformer/typescript): remove type-onlyimport =
whenonly_remove_type_imports
is true #8275) (Dunqing)Reference
forrequire
(fix(transformer/typescript): createReference
forrequire
#8355) (overlookmotel)Reference
forInfinity
(fix(transformer/typescript): createReference
forInfinity
#8354) (overlookmotel)only_remove_type_imports
(fix(transformer/typescript): should strip import specifiers type withonly_remove_type_imports
#8141) (underfin)Performance
NonEmptyStack
instead ofStack
(perf(transformer/arrow-functions): useNonEmptyStack
instead ofStack
#8318) (overlookmotel)Documentation
Refactor
AstBuilder
enum builder methods usealloc_*
methods (refactor(ast):AstBuilder
enum builder methods usealloc_*
methods #8281) (overlookmotel)get_identifier_reference
ofTSType
andTSTypeName
(refactor(ast): simplifyget_identifier_reference
ofTSType
andTSTypeName
#8273) (Dunqing)NonNull
shim (refactor(data_structures): removeNonNull
shim #8423) (overlookmotel)use
statement (refactor(ecmascript): remove unnecessaryuse
statement #8284) (overlookmotel)SourcePosition
(refactor(lexer): tighten safety of lexer by always including lifetime onSourcePosition
#8293) (overlookmotel)handle_byte
a method ofLexer
(refactor(lexer): makehandle_byte
a method ofLexer
#8291) (overlookmotel)#[allow]
with#[expect]
(refactor(lexer): replace#[allow]
with#[expect]
#8289) (overlookmotel)??
transform (refactor(minifier): remove the buggy??
transform #8411) (Boshen)!in_fixed_loop
happen last (refactor(minifier): change ast passes order,!in_fixed_loop
happen last #8380) (Boshen)minimize_exit_points
implementation (refactor(minifier): remove the buggyminimize_exit_points
implementation #8349) (Boshen)peephole_substitute_alternate_syntax
(refactor(minifier): clean uppeephole_substitute_alternate_syntax
#8327) (Boshen)peephole_replace_known_methods
(refactor(minifier): clean uppeephole_replace_known_methods
#8306) (Boshen)ReplaceKnownMethods
(Boshen)peephole_fold_constants
(Boshen)peephole_substitute_alternate_syntax
a little bit (Boshen)try_optimize_block
(refactor(minifier): clean uptry_optimize_block
#8139) (Boshen)peephole_substitute_alternate_syntax.rs
(refactor(minifier): clean uppeephole_substitute_alternate_syntax.rs
#8111) (Boshen)AstBuilder
call (refactor(transformer/arrow-functions): shortenAstBuilder
call #8317) (overlookmotel)TraverseCtx
to function notAstBuilder
(refactor(transformer/async-to-generator): passTraverseCtx
to function notAstBuilder
#8279) (overlookmotel)replace_class_name_with_temp_var
in class_properties (refactor(transformer/class-properties): sharereplace_class_name_with_temp_var
in class_properties #8105) (Dunqing)*_if_super
methods instatic_block_and_prop_init
(refactor(transformer/class-properties): remove all*_if_super
methods instatic_block_and_prop_init
#8104) (Dunqing)supers
tosuper_converter
(refactor(transformer/class-properties): movesupers
tosuper_converter
#8103) (Dunqing)Styling
Testing
Token
in 32-bit WASM (test(lexer): assert size ofToken
in 32-bit WASM #8292) (overlookmotel)