evestera / json_typegen

Tools and libraries to create types for Rust, Kotlin, TypeScript and Python from JSON samples
https://typegen.vestera.as
Apache License 2.0
273 stars 26 forks source link

Explore removing regex crate from dependencies #14

Closed evestera closed 3 years ago

evestera commented 5 years ago

The wasm bundle used in json_typegen_web and the npm package is quite big, currently ~1.3 MB. A large portion of that is the regex crate. A quick test of removing it (and the Inflector crate, as it depends on it) reduced the bundle size to ~400 KB.

If it turns out to be too hard to completely remove, a quick test with regex = { version = "1.3", default-features = false, features = ["std"] } yielded a wasm bundle of ~800 KB. This solution would only require a simple fork of Inflector, to match versions and features of regex.

Places where regex is currently used: