ChangeLog: v1.3.78
This version includes many fixes.
- #7820: A bug of
ascii_only
is fixed.
Code generation for
{
Ì: "\u0069\u0307\u0300",
}
is fixed.
- #7788: A bug of a rest pattern is fixed.
Previously, if the input code contains an array with two or more object patterns with a rest pattern in it, SWC produced an invalid code.
function fn([
{ foo, ...flags },
{ bar }
]) {
console.log(flags.rangeChanged);
}
- #7773: A bug of SWC minifier copying template literals is fixed.
This bug was related to careless logic in pure string optimizer. Now SWC minifier tracks status of cooked
field correctly.
- #7804: Sequential inliner now aborts on un-optimizable code.
Due to very complex situation, the SWC minifier had broke
let a = 1
function foo(g) {
var t = g()
a += t
}
function g() {
a = 2
return 1
}
foo(g)
console.log(a)
but it's now fixed.
- #7823: Inliner now preserves more analysis data while inlining.
Previously the code below was broken because the SWC minifier didn't propagate used_as_ref
flag while inlining an identifier into an identifier.
const Blocks = {
Block1: () => {
return <>'Block1xx'</>;
},
Block2: () => {
return <>'Block2xx'</>;
},
Layout1: () => {
// In the final code, Blocks does not have a 'Block1' key
return RenderLayout(Blocks, ['Block1'])
}
};
function RenderLayout(Comps, items) {
return items.map((item) => {
return Comps[item]
})
}
export function render() {
return <Blocks.Layout1 />
}