Design Meeting Notes, 1/21/2025
DRANK

Flag for Erasable Syntax Only Flag in light of strippable type support for TypeScript in Node.js. --erasableSyntaxOnly What is it? No enums, namespaces, parameter properties. Allow all these in ambient contexts (declare keywords). Can we get it in in the next week? Probably. --verbatimModuleSyntax? Compilers can do this independently? Module elision is not in line with what Node itself supports. Also, purists might not really be into module elision in the first place. Unclear What about uninstantiated namespaces? They should be allowed...but Node.js disallows them. // uninstantiated - should be allowed, currently is NOT in Node.js ⚠️ export namespace foo1 { export interface I {} } // ambient - should be allowed, currently is in Node.js export declare namespace foo2 { export interface I {} } // instantiated - should *not* be allowed, and is currently disallowed in Node.js export namespace foo3 { export interface I {} 1 + 2; } Arguable that being forced to write declare is a bit of a footgun to force everyone to write: https://github.com/microsoft/TypeScript/issues/59601#issuecomment-2296958990 Nice that declare makes it clear there's no JS On the other hand, declare implies something is a little bit odd about the surrounding environment. We think we'll allow uninstantiated namespaces, may restrict more later if we really made a mistake. New usage of this code is fairly low regardless.

github.com
Related Topics: TypeScript
1 comments