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

No externs are generated for re-exported namespace #1203

Open
theseanl opened this issue Sep 30, 2020 · 7 comments
Open

No externs are generated for re-exported namespace #1203

theseanl opened this issue Sep 30, 2020 · 7 comments

Comments

@theseanl
Copy link
Contributor

theseanl commented Sep 30, 2020

As I understand tsickle does not support generating externs from export * from '...' syntax (which I couldn't find a tracking issue), but it seems that it does not support externs generation for the following situation as well:

import * as foo from 'bar';
export {foo}
@evmar
Copy link
Contributor

evmar commented Sep 30, 2020

(Edit: deleted comment above that wasn't about this specific bug.)

@evmar
Copy link
Contributor

evmar commented Sep 30, 2020

In general, I believe tsickle doesn't support imports or exports within externs at all. I think there's a more general bug in the tracker that is about this problem, that this might be considered a dup or a subtask of. We don't really have a good conception of how to even represent this, given that externs files themselves can't have import/exports.

@theseanl
Copy link
Contributor Author

We don't really have a good conception of how to even represent this,

Isn't a module .d.ts just externs declared on some namespace? It is the idea I've learned from tsickle.

I believe tsickle doesn't support imports or exports within externs at all

Module .d.ts already work 90% of time. Given that almost all declaration files in DefinitelyTyped are module .d.ts, IMO making it more complete would open a lot of use cases.

@evmar
Copy link
Contributor

evmar commented Sep 30, 2020

We definitely would like this to work, we just haven't had time for it. I think you're right that hiding things on a namespace works for a single file, but I'm not sure whether all the various other interactions do the right thing with it.

@evmar
Copy link
Contributor

evmar commented Sep 30, 2020

(Part of the reason we haven't worked on this much is that we don't have a good model for using third-party dependencies in JSCompiler even when there is no TS involved.)

@theseanl
Copy link
Contributor Author

I'm not sure whether all the various other interactions do the right thing with it.

Huh, I thought it is already doing the right thing most of time. If you have some particular concerns I'd like to know, I am willing to work on this issue and provide a PR.

@evmar
Copy link
Contributor

evmar commented Sep 30, 2020

Sure, send a PR for this if you have a fix.

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