-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(es/minifier): Respect inline level and preserve native names (#8205
) **Description:** Note: Preserving native names is a hack, but it's used by `terser` and it's the only way to preserve the name of `class AbortSignal` while mangling without `keep_classnames: true`. We can special case `AbortSignal`, but let's just follow `terser`. **Related issue:** - vercel/next.js#57904
- Loading branch information
Showing
40 changed files
with
13,743 additions
and
15,124 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
1,818 changes: 854 additions & 964 deletions
1,818
..._ecma_minifier/tests/fixture/next/31077/static/chunks/1606726a.10299989c08cb523/output.js
Large diffs are not rendered by default.
Oops, something went wrong.
2,373 changes: 1,168 additions & 1,205 deletions
2,373
..._ecma_minifier/tests/fixture/next/33265/static/chunks/d6e1aeb5-38a8d7ae57119c23/output.js
Large diffs are not rendered by default.
Oops, something went wrong.
1,756 changes: 823 additions & 933 deletions
1,756
...ma_minifier/tests/fixture/next/33265/static/chunks/pages/index-cb36c1bf7f830e3c/output.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
5 changes: 2 additions & 3 deletions
5
crates/swc_ecma_minifier/tests/fixture/next/36127/2/1/output.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
export function regexCheck(regex) { | ||
return check; | ||
function check(code) { | ||
return function(code) { | ||
return null !== code && regex.test(String.fromCharCode(code)); | ||
} | ||
}; | ||
} |
5 changes: 2 additions & 3 deletions
5
crates/swc_ecma_minifier/tests/fixture/next/36127/2/2/output.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
function regexCheck(regex) { | ||
return check; | ||
function check(code) { | ||
return function(code) { | ||
return null !== code && regex.test(String.fromCharCode(code)); | ||
} | ||
}; | ||
} | ||
console.log(regexCheck("Foo")), console.log(regexCheck("Foo")), console.log(regexCheck("Foo")), console.log(regexCheck("Foo")), console.log(regexCheck("Foo")), console.log(regexCheck("Foo")), console.log(regexCheck("Foo")), console.log(regexCheck("Foo")), console.log(regexCheck("Foo")), console.log(regexCheck("Foo")); |
This file contains 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
Oops, something went wrong.