-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Emit 'export as namespace ts' in our bundled d.ts output #53570
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
Conversation
Wait, |
Yes, yes they were! |
@DanielRosenwasser I stuck this in 5.0.3 as this feels like something we should backport for the patch release? Not totally sure how to test that this doesn't negatively impact anyone but I'm pretty sure it does not. |
I'm confused, didn't we say these files shouldn't contain an |
I think we started with "nobody's complaining, so why bother", but Andrew (and I, originally) seemed to think that if the output file would put itself into the globals when not loaded via an import that it should declare so. |
We're like 10 months post-module migration; given nobody has complained about this I'm just going to close this. If we ever want to change that, we can still revive this, but I really suspect anyone who wants us in a browser is just bundling anyhow. |
I was reading https://johnnyreilly.com/definitely-typed-the-movie and saw the
export as namespace
syntax, which triggered a memory that made me remember that we used to have this in our output pre-modules, but I did not preserve it.Before, we had:
typescript.d.ts
, which only hadexport = ts
tsserverlibrary.d.ts
, which had bothexport = ts
andexport as namespace ts
.typescriptServices.d.ts
, which just declared thets
namespace without exporting it.Given we still let
ts
be loaded on the globals if not in CJS, this seems like it's correct to say that there's a globalts
namespace when not imported.