
_Kerman
@KermanX_
Followers
338
Following
1K
Media
19
Statuses
124
TS/RS dev | @slidevjs team member | undergraduate @USTC-SGY
Joined March 2024
RT @KermanX_: @hd_nvim @johnsoncodehk @_ArnaudBarre I think it is possible to have full type inference. Hopefully w….
0
1
0
Just tried to use tree-shaker to optimize them. Sadly, neither my optimizer nor I could understand `__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE` 🙃.
Production bundle quality matters. In Rspack 1.4, we collaborated with SWC to improve dead code elimination. For example, Rspack and SWC can now produce the smallest bundle for react-router-dom.
1
0
3
And here is an example of class member tree-shaking. P2 is Google Closure Compiler's output, (I removed the static property there because it requires the unstable flag), which can't shake `A.prototype.method`.
btw, tree-shaker already supports object property mangling and class member tree-shaking. Most importantly, these optimizations are designed to be fully safe unless `__proto__` is accessed in unexpected ways. But the fact is that there are a bunch of bugs.
0
0
2
Here is an example of object property mangling. Terser's output was incorrect because it couldn't handle dynamic key access. (This is out of the scope of "tree shaking" 🫠)
btw, tree-shaker already supports object property mangling and class member tree-shaking. Most importantly, these optimizations are designed to be fully safe unless `__proto__` is accessed in unexpected ways. But the fact is that there are a bunch of bugs.
0
0
6
I’m really impressed by swc’s production-ready optimizations. Tree-shaker also achieved a similar effect (possibly through a different approach), but it is just too hard to make tree-shaker an actually useful tool.
While refactoring the minifier of @swc_rs, I found a ridiculous test case. The first image is the input, and the second is the output. You might think it's just a feature to show off the performance, but it's actually because that's what's in the input data that I implemented
1
0
7
Bringing Rust syntax to the JavaScript world together with @KazariEX_0929 . Rust syntax + JavaScript runtime = "Rust with GC" (wtf.
3
2
32