Authress-Engineering / openapi-explorer

OpenAPI Web component to generate a UI from the spec.
Apache License 2.0
316 stars 42 forks source link

build: `regex-to-strings` minified is 151 KB vs `randExp.js` 9 KB, and 4k vs 3m weekly downloads #179

Closed llllvvuu closed 1 year ago

llllvvuu commented 1 year ago

Current bundle size:

Assets: 
  openapi-explorer.min.js (938 KiB)
  openapi-explorer.min.js.gz (248 KiB)
wparad commented 1 year ago

This looks like a request to change the dependency, we definitely can if that library offers the functionality we need here. What's the difference in usage, would that other library help us here?

llllvvuu commented 1 year ago

Hi @wparad great question, it's basically a drop-in replacement. Just opened a PR: https://github.com/Rhosys/openapi-explorer/pull/180

p/s: I did not change any behavior, although my personal preference would have been to make it nonrandom (RandExp.prototype.randInt = (from, to) => from) and remove the 8 chars substitution for +/* (let it be the default 1)