Browser bundle is very large
See original GitHub issueI’m currently trying to use this library for isomporphic form validation/rendering. However, this lifted my (uncompressed) JS size from ~700kb to 3.1mb.
After removing formidable
, async
and qs
as dependencies (formidable has the largest contribution), and leaving the server implementation to parse form data, my bundle size is sitting at around 900kb. You can see the fork here
You could also remove the dependencies on shims (object-keys
, is
, object.assign
, string.prototype.trim
), if you just specified that people who want support for older browsers/runtimes need to include polyfills themselves.
That will result in zero dependencies with almost no loss in functionality. The changes being:
- You have to parse the form data before handing it over
- You have to polyfill JS features that aren’t available
I know legacy support is an important feature for this library, as is ease of “plug and play” use, so I wanted to see if there was any interest in reducing dependencies.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
async
gets removed as part of #2182f4ba3a4471a0a64c719d0bbcaa6e9d4b1e9ad8a has dropped the bundle size by 12% without any changes, so that’s a start. #218 seems to drop bundle sizes an additional 4% (from 1.09MB to 1.05MB). Thus, I suspect
async
is not the biggest contributor.