browser-metrics icon indicating copy to clipboard operation
browser-metrics copied to clipboard

Exports

Open mxstbr opened this issue 8 years ago • 1 comments

Instead of recommending people to import from /lib/x, why not export the modules?

import browserMetrics from 'browser-metrics';
// and
import { Metric } from 'browser-metrics';

mxstbr avatar Nov 28 '16 09:11 mxstbr

Oups, sorry I have missed that issue.

My only concern with named import is with build size. Available tree shaking solutions have proven to be unreliable, e.g. those two issues linked in that comment: https://github.com/callemall/material-ui/pull/5545#issuecomment-260111140:

  • Webpack: https://github.com/webpack/webpack/issues/2867
  • Rollup: https://github.com/rollup/rollup/wiki/Troubleshooting#tree-shaking-doesnt-seem-to-be-working

oliviertassinari avatar Dec 18 '16 18:12 oliviertassinari