Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This library seems to conflate export * and export { default } #7

Open
stefanpenner opened this issue Aug 15, 2018 · 5 comments
Open

Comments

@stefanpenner
Copy link
Contributor

stefanpenner commented Aug 15, 2018

I believe this library confuses:

export { default } from 'their-module';

With:

export *  from 'their-module';

  • define.alias is export * from 'their-module', making all members available
  • export { default } from 'their-module, making only the default member available
@stefanpenner
Copy link
Contributor Author

stefanpenner commented Aug 15, 2018

This results in code being written that is:

// module a;
export function foo () { };
export default function() {

}
// module b;
export { default } from 'a';
// module c
export { foo } from 'b';

// foo really should NOT be accessible here as
// all module B is re-exporting is the default of module A;
// it is NOT re-exporting foo

@stefanpenner
Copy link
Contributor Author

I made a tool to quickly fix peoples code: https://github.com/stefanpenner/fix-compact-reexports

@stefanpenner
Copy link
Contributor Author

This lib then should likely learn about export * from y; and compress it accordingly.

@stefanpenner
Copy link
Contributor Author

I think I can easily add support to loader to suport define.default(from, to) which could be shorthand for export { default } from 'foo'

@stefanpenner
Copy link
Contributor Author

ember-cli/loader.js#138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant