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

Namespace hack #32

Open
blakeembrey opened this issue Sep 29, 2016 · 2 comments
Open

Namespace hack #32

blakeembrey opened this issue Sep 29, 2016 · 2 comments

Comments

@blakeembrey
Copy link
Member

Let's not merge namespace hacks so people can use "ES6-style imports" with CommonJS code. Remember to point out when someone is using an import incorrectly. I'm adding this issue mostly as a bookmark for future reference, since I commonly write something up like typed-typings/npm-basic-auth#1 (comment). There's a good answer on Stack Overflow by Ryan we can point people to now - https://stackoverflow.com/questions/39415661/why-cant-i-import-a-class-or-function-with-import-as-x-from-y 👍

@CaselIT
Copy link

CaselIT commented Sep 29, 2016

Is updating the original library to add the module.exports.default to support the default es6 import reasonable?

@blakeembrey
Copy link
Member Author

blakeembrey commented Sep 29, 2016

I suppose, that's what TypeScript technically emits and it'd be up to the module author. Personally I wouldn't merge a PR or accept an issue for it, but maybe others would. I wouldn't push for it personally since I definitely don't want to spam a bunch of people who don't care about this when there's already valid ways to use the code. Also, that hack may also break one day - hard to tell if real ES6 support lands what it'll look like anyway but it looks likely that in this year it will need to be solved.

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

2 participants