Closed
Description
--init
Setting target
to es2016
- Proposal: have the target go 5 years back.
- What's that introduce?
- Exponentiation and
Array.prototype.includes
.
- Exponentiation and
- Mostly uncontroversial, get it in for 4.5.
type
Modifiers on Named Imports/Exports
- Biggest change here is auto-import behavior because we have to consider the mix of
importsNotUsedAsValues
andpreserveValueImports
andisolatedModules
. - 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
keyof
doesn't preserve keys when you have anas
clause.- Change adds a new rule
keyof A
tokeyof { [K in keyof T as SomeTransform<K>]: ... }
- Means we relate
keyof A
toSomeTransform<keyof T>
- Means we relate
- Could try to make member resolution just resolve names.
- We've definitely gotten questions about this.
- Moreso, gotten questions about supporting
T
toFilterKeys<T, ...>
.
- Moreso, gotten questions about supporting
- 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.