-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
fix(es2018): add a target and an initial lib #20385
Conversation
@@ -120,6 +121,7 @@ namespace ts { | |||
"es7": "lib.es2016.d.ts", | |||
"es2016": "lib.es2016.d.ts", | |||
"es2017": "lib.es2017.d.ts", | |||
"es2018": "lib.es2018.d.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to build the new library as well. this is defined in our Jake/gulp files (sorry we have two build systems for now untill we are done with the migration).
JakeFile: https://github.com/Microsoft/TypeScript/blob/8f1cdc9b0c649f1e4fe9d96718be93277baa2ecd/Jakefile.js#L229
GulpFle: https://github.com/Microsoft/TypeScript/blob/8f1cdc9b0c649f1e4fe9d96718be93277baa2ecd/Gulpfile.ts#L168
See 6a737c8 that added esNext target.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mhegazy thank you for the review. I am updating my PR accordingly.
FYI, I see that jake LKG generates diagnosticMessages.generated.json file per locale. I think this is related to PR #19308
Therefore, in my PR you will have 2 commits:
- 'run jake LKG before es2018 addition'
- 'fix(es2018): add a target and an initial lib' (contains the es2018 lib + jake LKG run a second time)
Please let me know if I need to squash both commits
Thanks! For future references please do not include LKG updates in PRs, they happen as part of publishing or manually directly on master. |
@benbraou do you want to pick up adding definitions for the new array methods: https://github.com/tc39/proposal-flatMap (a new |
@mhegazy Thanks you! I got the point to not include LKG updates in future PRs. |
that would be appreciated. thanks! |
values(): IterableIterator<string | File>; | ||
|
||
[Symbol.iterator](): IterableIterator<string | File>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(out of scope for this PR but) this pattern repeats often enough that maybe there should be a virtual interface in lib.es2015.iterable.d.ts
for this 🤔
interface IterableCollection<K, V = K, I = V> {
entries(): IterableIterator<[K, V]>;
keys(): IterableIterator<K>;
values(): IterableIterator<V>;
[Symbol.iterator](): IterableIterator<I>
}
Only useful in lib.*.d.ts
if interface augmentations are allowed to add extends
, though. Alternatively, end the separation between iterable
and non-iterable
declarations; but that might be undesirable for the folks still supporting IE without polyfills (please stop 🙏😉).
* @param mapfn A mapping function to call on every element of the array. | ||
* @param thisArg Value of 'this' used to invoke the mapfn. | ||
*/ | ||
from<T, U = T>(arrayLike: ArrayLike<T>, mapfn?: (v: T, k: number) => U, thisArg?: any): U[]; | ||
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (v: T, k: number) => U, thisArg?: any): U[]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from<T, U, This>(arrayLike: ArrayLike<T>, mapfn: (this: This, v: T, k: number) => U, thisArg?: This): U[]
?
Fixes SchemaStore#403 TypeScript 2.7 now supports `"target": "es2018"`: microsoft/TypeScript#20385
Fixes #403 TypeScript 2.7 now supports `"target": "es2018"`: microsoft/TypeScript#20385
With this PR:
Fixes #20342