You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
--init
Settingtarget
toes2016
#45934
Array.prototype.includes
.type
Modifiers on Named Imports/Exports#45998
importsNotUsedAsValues
andpreserveValueImports
andisolatedModules
.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.keyof
Including Remapped Keys#45923
keyof
doesn't preserve keys when you have anas
clause.keyof A
tokeyof { [K in keyof T as SomeTransform<K>]: ... }
keyof A
toSomeTransform<keyof T>
T
toFilterKeys<T, ...>
.Gist Playgrounds Prototype
https://www.staging-typescript.org/play?#gist/5a5df9e63d5646f045a8871f11cb5b6f-0
// @filename
// @filename
and the likeThe text was updated successfully, but these errors were encountered: