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

Design Meeting Notes, 1/21/2025 #61020

Open
DanielRosenwasser opened this issue Jan 22, 2025 · 0 comments
Open

Design Meeting Notes, 1/21/2025 #61020

DanielRosenwasser opened this issue Jan 22, 2025 · 0 comments
Labels
Design Notes Notes from our design meetings

Comments

@DanielRosenwasser
Copy link
Member

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.
    • 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.
@DanielRosenwasser DanielRosenwasser added the Design Notes Notes from our design meetings label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Notes Notes from our design meetings
Projects
None yet
Development

No branches or pull requests

1 participant