Closed lionel-rowe closed 3 weeks ago
Thanks @zloirock ! Added that to the table
I don't know about perf, but the bundle size for core-js(-pure)/actual/regexp/escape
definitely not 88kB -)
https://bundlejs.com/?q=core-js-pure%2Factual%2Fregexp%2Fescape&treeshake=%5B*%5D
https://bundlejs.com/?q=core-js%2Factual%2Fregexp%2Fescape&treeshake=%5B*%5D
I don't know about perf, but the bundle size for core-js(-pure)/actual/regexp/escape definitely not 88kB -) https://bundlejs.com/?q=core-js-pure%2Factual%2Fregexp%2Fescape&treeshake=%5B*%5D https://bundlejs.com/?q=core-js%2Factual%2Fregexp%2Fescape&treeshake=%5B*%5D
Gotta admit I was a little perplexed at how high the numbers looked for es-shims/RegExp.escape
and zloirock/core-js
. Methodology I'm using is fetching the ESM version via esm.sh then bundling and minifying with esbuild (which in theory should tree shake correctly for ESM bundling). No gzip. Still, 12.8 kB is a long way off of 88 kB, so I guess either esbuild isn't tree shaking properly, esm.sh is adding a massive amount of cruft, or there's a bug in my code. Edit: I've replaced with min+gzipped numbers from bundlejs.com (and bundlephobia in the case of es-shims/RegExp.escape
as I can't get it to load properly via any of the CDNs available on bundlejs.com).
(Computing bundle size numbers absent a complete application is always going to be inaccurate due to optimizations and deduplication, and displaying them makes it really easy for people to draw inaccurate conclusions in both directions.)
Thanks! I'll add es-shims and core-js to the readme; when you've published yours to npm, I'd love a PR to add it as well.
Super happy to see this at Stage 3! 🎉
I noticed there's a polyfill under development at es-shims/RegExp.escape and available via NPM, and I've also made my own lightweight one: lionel-rowe/regexp-escape-polyfill. I'll probably add it to JSR and/or NPM at some point, but for now it's just a GitHub repo.
Benchmarks/comparison:
Anyway, feel free to add this info to the README etc.