-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Design NotesNotes from our design meetingsNotes from our design meetings
Description
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: Tsconfig option to disallow features requiring transformations which are not supported by Node.js' --strip-types #59601 (comment)- 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.
- Nice that
- 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.
Metadata
Metadata
Assignees
Labels
Design NotesNotes from our design meetingsNotes from our design meetings
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
--erasableSyntaxOnly
oxc-project/oxc#8701