🪚 A JavaScript code size optimizer based on abstract interpretation
See the codeThis is an experimental code size optimizer for JavaScript based on the Oxc parser.
Read the paper | Try online | CLI | Bundler Plugin: pnpm i -D rollup-plugin-jsshaker
| Input | Output |
|
|
| Input | Output |
|
|
| Input | Output |
|
|
| Input | Output |
|
|
createElementalso works, if it is directly imported fromreact.
| Input | Output |
|
|
We also have special handling for some React.js APIs. For example, React Context,
memo,forwardRef,useMemo, etc.
| Input | Output |
|
|
Here is a simple comparison:
if(false) { ... } can be removed".if (x) { ... } can only be preserved if ... is reachable and has side effects".This project has been done in the spirit of soundiness. When building practical program analyses, it is often necessary to cut corners. In order to be open about language features that we do not support or support only partially, we are attaching this soundiness statement.
Our analysis does not have a fully sound handling of the following features:
We have determined that the unsoundness in our handling of these features has minimal effect on analysis output and the validity of our experimental evaluation. To the best of our knowledge, our analysis has a sound handling of all language features other than those listed above.
This statement has been produced with the Soundiness Statement Generator from http://soundiness.org.
Rust
87.7%
TypeScript
9.2%
Vue
1.5%
JavaScript
1.4%
🪚 A JavaScript code size optimizer based on abstract interpretation
See the codeThis is an experimental code size optimizer for JavaScript based on the Oxc parser.
Read the paper | Try online | CLI | Bundler Plugin: pnpm i -D rollup-plugin-jsshaker
| Input | Output |
|
|
| Input | Output |
|
|
| Input | Output |
|
|
| Input | Output |
|
|
createElementalso works, if it is directly imported fromreact.
| Input | Output |
|
|
We also have special handling for some React.js APIs. For example, React Context,
memo,forwardRef,useMemo, etc.
| Input | Output |
|
|
Here is a simple comparison:
if(false) { ... } can be removed".if (x) { ... } can only be preserved if ... is reachable and has side effects".This project has been done in the spirit of soundiness. When building practical program analyses, it is often necessary to cut corners. In order to be open about language features that we do not support or support only partially, we are attaching this soundiness statement.
Our analysis does not have a fully sound handling of the following features:
We have determined that the unsoundness in our handling of these features has minimal effect on analysis output and the validity of our experimental evaluation. To the best of our knowledge, our analysis has a sound handling of all language features other than those listed above.
This statement has been produced with the Soundiness Statement Generator from http://soundiness.org.
Rust
87.7%
TypeScript
9.2%
Vue
1.5%
JavaScript
1.4%