esnext/es6-module-transpiler — pull request #174 by eventualbuddha (2014-10-18 18:44:19+00:00)
Title: [RFC] Add support for namespace imports

cc @caridy @ericf @wycats @dherman

This adds support for namespace imports, i.e. `import * as foo from 'foo'`. The initial work was done by @caridy and I followed up to make it work with both the commonjs and bundle formatters. I am not yet satisfied with this branch. The biggest code smell is that I am having to cache the specifier names by forcing them to be computed *before* they are re-written. Other than that, here's some things I think we may need before we can merge:

- [ ] Make the tests added in 56aa11e pass.
- [ ] Potentially optimize `import * as foo from 'foo'` with `foo.a` to become a direct reference to the `a` export (i.e. `foo$$a`) rather than `foo$$.a`, which may keep us from needing the `foo$$` object at all (bundle formatter only).
- [ ] Figure out a better way to preserve the original specifier names.
- [ ] Ensure ES5 output is acceptable for the bundle formatter (i.e. `get` properties vs. `Object.defineProperty`).

Any other optimizations or static errors you all can think of?