Closed
Description
Private Fields in .d.ts
Files
- One issue is that
.d.ts
files are sometimes lossy becauseprivate
fields omit their types.- We probe the structure
- The variance issue sounds like something we're not likely to address.
- It's broken today for
private
, why change for#
?
- It's broken today for
- Perhaps it makes sense to just include a single
#_
declaration in the output if we're just erasing all details.- Why don't we just include the original privates in the class declarations?
- Because you don't want 30 privates in your classes?
- But that's the case for
private
properties today.
- Do private fields affect incremental and project references?
- Yes, but they probably shouldn't.
- A point in favor of emitting a single private property?
- Why don't we just include the original privates in the class declarations?
- So
#_
?#privateProperty
just so people can search it online more easily.
Collisions of Imported Types
- Introducing an error when types conflict with local type names.
import { foo } from "./stuff";
export type foo = foo;
- Breaks legitimate errors in
firebase-firestore
,glimmer
,skype
,vscode
.- VS Code examples seemed suspicious.
- The general pattern is useful when running with
isolatedModules
, but there's no reason to use the same name. - This is a breaking change, but the break seems legitimate, existing code seems wrong, and the fix is simple.
@RyanCavanaugh has the other notes.