Skip to content

Design Meeting Notes, 9/24/2021 #46050

Closed
Closed
@DanielRosenwasser

Description

@DanielRosenwasser

--init Setting target to es2016

#45934

  • Proposal: have the target go 5 years back.
  • What's that introduce?
    • Exponentiation and Array.prototype.includes.
  • Mostly uncontroversial, get it in for 4.5.

type Modifiers on Named Imports/Exports

#45998

  • Biggest change here is auto-import behavior because we have to consider the mix of importsNotUsedAsValues and preserveValueImports and isolatedModules.
  • Auto-imports will try to be "smarter" and more flexible to avoid errors.
  • Previously, if you had written a type-only import, you probably wrote it yourself because you didn't want a runtime dependency on a module.
  • However, now that these settings generally synthesize more type-only imports, we're more flexible.
  • Also, type imports to serve use-case of "I don't want to accidentally bring in this module" is kind of bogus; already got that before these options.
    • These should be caught in code review.
    • If you need a module's values, you need a module.

keyof Including Remapped Keys

#45923

  • keyof doesn't preserve keys when you have an as clause.
  • Change adds a new rule
  • keyof A to keyof { [K in keyof T as SomeTransform<K>]: ... }
    • Means we relate keyof A to SomeTransform<keyof T>
  • Could try to make member resolution just resolve names.
  • We've definitely gotten questions about this.
    • Moreso, gotten questions about supporting T to FilterKeys<T, ...>.
  • Try to get a code review before 4.5 beta!

Gist Playgrounds Prototype

https://www.staging-typescript.org/play?#gist/5a5df9e63d5646f045a8871f11cb5b6f-0

  • Idea: want to make a group of code samples together.
  • Inspired mostly by work on type-or-treat work from last year.
  • Reading/writing from a Gist allows us to tackle questions around multi-file URLs and whatnot.
  • Files are not read-only, but cannot create a file.
    • What happens when you edit?
    • Gist disappears.
  • Want to make sure we don't re-invent the wheel.
  • Gists support multi-file?
    • Yes.
  • Eventually would like multi-editor.
  • How does the type-or-treat example work today?
    • Losing local changes from a gist after making an edit could be frustrating.
  • Nice that you don't need to authenticate though!
  • Able to have a full VS Code-like experience?
    • Difficult to embed - also, there is complexity to a full editor. Value prop today is just a single editor, input/output.
  • If multi-file is the value prop, just use // @filename
  • Maybe Type Or Treat should just be a single GitHub repo that people can fork.
  • Feels like there's a lot of playground spinoffs that could be unified into just the Playground if we add an API to TS Server which would allow support for // @filename and the like
  • Explore that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design NotesNotes from our design meetings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions