Repository navigation
Commit cf97e07
authored
perf(javascript): parse into a SyntaxTree and print from it when the minifier neither compresses nor mangles (#22643)
* perf(javascript): write a parsed tree into a SyntaxTree's columns
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
* perf(javascript): print a source neither compressed nor mangled from its SyntaxTree
minify with compress: false and mangle: false parses the source into a
SyntaxTree and prints it with a tree printer reading only the tree and its
tokens, skipping adoptEstree and the phases; any option the tree printer
cannot match yet falls back to printing terser's tree.
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
* perf(javascript): map a source printed from its SyntaxTree
The tree printer adds the source mappings printEstree adds, so a minify
asking for a source map prints from the tree too.
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
* perf(javascript): write each function body into the SyntaxTree as it is read
addEstree takes a child already written as its id, so the tree parse writes
each function body once the parser finishes it and its ESTree nodes go before
the rest of the source is read: the live heap holds the tree, not the tree
and the whole ESTree.
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
* chore(types): declare SyntaxTree#addEstree
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
* fix(javascript): write an import or export an older edition parsed without attributes
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC1 parent b76f39a commit cf97e07
5 files changed
Lines changed: 3470 additions & 108 deletions
File tree
- lib/javascript
- test/unitCases
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18079 | 18079 | | |
18080 | 18080 | | |
18081 | 18081 | | |
| 18082 | + | |
| 18083 | + | |
| 18084 | + | |
| 18085 | + | |
| 18086 | + | |
| 18087 | + | |
| 18088 | + | |
| 18089 | + | |
| 18090 | + | |
| 18091 | + | |
| 18092 | + | |
| 18093 | + | |
| 18094 | + | |
| 18095 | + | |
| 18096 | + | |
| 18097 | + | |
| 18098 | + | |
| 18099 | + | |
| 18100 | + | |
| 18101 | + | |
| 18102 | + | |
| 18103 | + | |
| 18104 | + | |
| 18105 | + | |
| 18106 | + | |
| 18107 | + | |
| 18108 | + | |
| 18109 | + | |
| 18110 | + | |
| 18111 | + | |
| 18112 | + | |
| 18113 | + | |
| 18114 | + | |
| 18115 | + | |
| 18116 | + | |
| 18117 | + | |
| 18118 | + | |
| 18119 | + | |
| 18120 | + | |
| 18121 | + | |
| 18122 | + | |
| 18123 | + | |
| 18124 | + | |
| 18125 | + | |
| 18126 | + | |
| 18127 | + | |
| 18128 | + | |
| 18129 | + | |
| 18130 | + | |
| 18131 | + | |
| 18132 | + | |
| 18133 | + | |
| 18134 | + | |
| 18135 | + | |
| 18136 | + | |
| 18137 | + | |
| 18138 | + | |
| 18139 | + | |
| 18140 | + | |
| 18141 | + | |
| 18142 | + | |
| 18143 | + | |
| 18144 | + | |
| 18145 | + | |
| 18146 | + | |
| 18147 | + | |
| 18148 | + | |
| 18149 | + | |
| 18150 | + | |
| 18151 | + | |
| 18152 | + | |
| 18153 | + | |
| 18154 | + | |
| 18155 | + | |
| 18156 | + | |
| 18157 | + | |
| 18158 | + | |
| 18159 | + | |
18082 | 18160 | | |
18083 | 18161 | | |
18084 | 18162 | | |
18085 | 18163 | | |
18086 | 18164 | | |
| 18165 | + | |
| 18166 | + | |
| 18167 | + | |
| 18168 | + | |
| 18169 | + | |
| 18170 | + | |
| 18171 | + | |
| 18172 | + | |
| 18173 | + | |
| 18174 | + | |
| 18175 | + | |
| 18176 | + | |
| 18177 | + | |
| 18178 | + | |
18087 | 18179 | | |
18088 | 18180 | | |
18089 | 18181 | | |
18090 | 18182 | | |
18091 | | - | |
| 18183 | + | |
18092 | 18184 | | |
18093 | | - | |
18094 | | - | |
18095 | | - | |
18096 | | - | |
| 18185 | + | |
18097 | 18186 | | |
18098 | | - | |
| 18187 | + | |
18099 | 18188 | | |
18100 | 18189 | | |
18101 | 18190 | | |
| |||
0 commit comments