final-form / react-final-form-html5-validation

A swap-in replacement for 🏁 React Final Form's <Field> component to provide HTML5 Validation
MIT License
57 stars 8 forks source link

Fixed bundling ReactDOM #2

Closed Andarist closed 6 years ago

codecov[bot] commented 6 years ago

Codecov Report

Merging #2 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff          @@
##           master     #2   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           2      2           
  Lines          37     37           
  Branches       16     16           
=====================================
  Hits           37     37

Continue to review full report at Codecov.

Legend - Click here to learn more Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data Powered by Codecov. Last update 3f21321...953a2e3. Read the comment docs.

erikras commented 6 years ago

Any proof that this reduces bundle size? My initial test was pretty equivalent to master.

Andarist commented 6 years ago

I've made tests after running ./node_modules/.bin/nps build.es and then inspecting the size with wc -c dist/react-final-form-html5-validation.es.js

master 670401 my PR 6402

Rollup build times also went down quite a bit (1.8s vs 422ms)

Andarist commented 6 years ago

The problem was using findDOMNode but not specifying react-dom as external

erikras commented 6 years ago

Um, confirmed. From 30 kb down to 1.45kb. πŸ€¦β€β™‚οΈπŸ’₯

erikras commented 6 years ago

Published in v1.0.1.

dist/react-final-form-html5-validation.es.js went from 730K to 5.4K. 😱