respec
respec copied to clipboard
Use esbuild instead of rollup
It appears to be a lot faster!
Building respec-highlight (rollup: 2.1s, esbuild: 0.7s):
# rollup
$ time rollup -c worker/rollup.config.js
worker/respec-highlight.js → builds/...
created builds/ in 1.1s
npx rollup -c worker/rollup.config.js 0.03s user 0.15s system 8% cpu 2.154 total
# esbuild
$ time esbuild worker/respec-highlight.js --outdir=builds --bundle --minify --format=iife --global-name=hljs
builds\respec-highlight.js 37.0kb
Done in 14ms
npx esbuild worker/respec-highlight.js --outdir=builds --bundle --minify 0.09s user 0.14s system 33% cpu 0.684 total
Note: The bundle size is slightly larger (like 800 bytes).
Build w3c profile (with CSS, JS minification) 😱 😮
➜ time node tools/esbuild.js
node tools/esbuild.js 0.00s user 0.00s system 0% cpu 0.258 total
➜ time npm run build:w3c
npm run build:w3c 0.11s user 0.15s system 4% cpu 6.129 total
Do we get any other goodies from ESBuild? I guess this could be nice for the when we are running the watcher and running tests?
Yes. Watch mode would be a lot faster now. We can also write ReSpec in TypeScript without waiting on slow compilation feedback, if that's something we want to pursue, for reasons..
One day... once we fix maybe 80% of current bugs.
If ReSpec is migrated to TypeScript, it may be possible to use tsc
implemented in low-level languages (like Go to speed up type checking in the future.