(better textual / visual explanation of things like "motivation" / "how it works" / "limitations" will come here in the future)
I created a simple demo using React and framer-motion. Without Quickboot.js, it's impossible to reduce the JS size smaller than react-dom.
You can compare the JS sizes loaded before the animation starts using your web browser's network inspector. Here Quickboot.js reduces the JS size needed to start the animation by more than 40%. This size is smaller than react-dom package alone.
To use Quickboot.js CLI, please follow the following instructions:
npx quickbootjs trace /path/to/your/target.jsand follow the instruction to save the runtime execution trace
Note that this tool is highly experimental and you should NOT use it in production since there can be bugs or non obvious tradeoffs.
For example, we know that the usage of
However, depending on your use case, Quickboot.js could bring more benefit than its potential drawbacks. If you are interested in deploying this to production (maybe under feature flags?). I am really interested in the use case so do not hesitate to contact Naru.
Replacing unused code with eval is not as trivial as it seems and there are several bugs already. My next step is to create test cases to reliably reproduce the issues and fix them along with other obvious issues such as error handling.