import { foo, bar } as obj from 'module

kai zhu kaizhu256 at gmail.com
Wed Dec 13 04:11:29 UTC 2017


> I don’t know how much of a factor this is in language design, but I think this addition could have a nice side effect — it might help encourage patterns that happen to play well with "tree shaking".


tree-shaking is incompatible with class-inheritance and meta-programming in javascript.  it has negligible effect in practice, unless the majority of your code uses static-functions instead of classes.

> On Dec 13, 2017, at 2:46 AM, Darien Valentine <valentinium at gmail.com> wrote:
> 
> > To me this seems like such a no-brainer that I'm actually surprised that this isn't possible already.
> 
> I think it’s a no-brainer now that we’ve all been using import/export in practice for a while, but it’s understandable that it might not have been obvious on the first pass.
> 
> I don’t know how much of a factor this is in language design, but I think this addition could have a nice side effect — it might help encourage patterns that happen to play well with "tree shaking".
> 
> I bet this would fly if proposed!
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



More information about the es-discuss mailing list