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

Fix library inclusions for ES2024 target #60622

Merged
merged 5 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ export const inverseJsxOptionMap: Map<string, string> = new Map(mapIterator(jsxO
// augmented in another lib.
// NOTE: We must reevaluate the target for upcoming features when each successive TC39 edition is ratified in
// June of each year. This includes changes to `LanguageFeatureMinimumTarget`, `ScriptTarget`,
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts and the contents of each
// lib/esnext.*.d.ts file.
// `ScriptTargetFeatures` transformers/esnext.ts, compiler/commandLineParser.ts,
// compiler/utilitiesPublic.ts, and the contents of each lib/esnext.*.d.ts file.
Comment on lines 148 to +151
Copy link
Contributor

@petamoriken petamoriken Nov 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billyjanitsch Sorry for the lack of information 🙇

NOTE comments exist in multiple files and I would like to have them updated as well:

  • src/compiler/types.ts (two places)
  • src/compiler/utilities.ts
  • src/compiler/transformers/esnext.ts

Also, please add these comments to src/compiler/utilitiesPublic.ts.

const libEntries: [string, string][] = [
// JavaScript only
["es5", "lib.es5.d.ts"],
Expand Down
2 changes: 2 additions & 0 deletions src/compiler/utilitiesPublic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ export function sortAndDeduplicateDiagnostics<T extends Diagnostic>(diagnostics:
/** @internal */
billyjanitsch marked this conversation as resolved.
Show resolved Hide resolved
export const targetToLibMap: Map<ScriptTarget, string> = new Map([
[ScriptTarget.ESNext, "lib.esnext.full.d.ts"],
[ScriptTarget.ES2024, "lib.es2024.full.d.ts"],
[ScriptTarget.ES2023, "lib.es2023.full.d.ts"],
[ScriptTarget.ES2022, "lib.es2022.full.d.ts"],
[ScriptTarget.ES2021, "lib.es2021.full.d.ts"],
Expand All @@ -322,6 +323,7 @@ export function getDefaultLibFileName(options: CompilerOptions): string {
const target = getEmitScriptTarget(options);
switch (target) {
case ScriptTarget.ESNext:
case ScriptTarget.ES2024:
case ScriptTarget.ES2023:
case ScriptTarget.ES2022:
case ScriptTarget.ES2021:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,14 @@ DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/packag
Elapsed:: *ms DirectoryWatcher:: Added:: WatchInfo: /home/src/projects/project/packages/package2 1 undefined Wild card directory


//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 30
//// [/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts] *Lib* Inode:: 31

//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 118
//// [/home/src/projects/project/packages/package2/dist/index.js] Inode:: 119
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });


//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 119
//// [/home/src/projects/project/packages/package2/dist/index.d.ts] Inode:: 120
export {};


Expand Down Expand Up @@ -242,15 +242,15 @@ FsWatches::
/home/src/projects/project/packages/package2: *new*
{"inode":11}
/home/src/projects/project/packages/package2/dist: *new*
{"inode":117}
{"inode":118}
/home/src/projects/project/packages/package2/src: *new*
{"inode":14}
/home/src/projects/project/packages/package2/src/index.ts: *new*
{"inode":15}
/home/src/projects/project/packages/package2/tsconfig.json: *new*
{"inode":13}
/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts: *new*
{"inode":30}
{"inode":31}

Program root files: [
"/home/src/projects/project/packages/package2/src/index.ts"
Expand Down Expand Up @@ -290,20 +290,20 @@ exitCode:: ExitStatus.undefined
Change:: Build dependencies

Input::
//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 121
//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 122
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });


//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 122
//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 123
export type FooType = "foo";
export type BarType = "bar";


//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 123
//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] Inode:: 124
{"root":["./src/index.ts"],"version":"FakeTSVersion"}

//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 124
//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] Inode:: 125
{
"root": [
"./src/index.ts"
Expand Down Expand Up @@ -355,23 +355,23 @@ FsWatches::
/home/src/projects/project/packages/package1:
{"inode":6}
/home/src/projects/project/packages/package1/dist: *new*
{"inode":120}
{"inode":121}
/home/src/projects/project/packages/package1/package.json:
{"inode":7}
/home/src/projects/project/packages/package1/src:
{"inode":9}
/home/src/projects/project/packages/package2:
{"inode":11}
/home/src/projects/project/packages/package2/dist:
{"inode":117}
{"inode":118}
/home/src/projects/project/packages/package2/src:
{"inode":14}
/home/src/projects/project/packages/package2/src/index.ts:
{"inode":15}
/home/src/projects/project/packages/package2/tsconfig.json:
{"inode":13}
/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts:
{"inode":30}
{"inode":31}

Timeout callback:: count: 1
8: timerToInvalidateFailedLookupResolutions *new*
Expand Down Expand Up @@ -436,8 +436,8 @@ packages/package2/src/index.ts



//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 118
//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 119
//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 119
//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 120

PolledWatches::
/home/src/projects/node_modules/@types:
Expand Down Expand Up @@ -465,25 +465,25 @@ FsWatches::
/home/src/projects/project/packages/package1:
{"inode":6}
/home/src/projects/project/packages/package1/dist:
{"inode":120}
{"inode":121}
/home/src/projects/project/packages/package1/dist/index.d.ts: *new*
{"inode":122}
{"inode":123}
/home/src/projects/project/packages/package1/package.json:
{"inode":7}
/home/src/projects/project/packages/package1/src:
{"inode":9}
/home/src/projects/project/packages/package2:
{"inode":11}
/home/src/projects/project/packages/package2/dist:
{"inode":117}
{"inode":118}
/home/src/projects/project/packages/package2/src:
{"inode":14}
/home/src/projects/project/packages/package2/src/index.ts:
{"inode":15}
/home/src/projects/project/packages/package2/tsconfig.json:
{"inode":13}
/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts:
{"inode":30}
{"inode":31}


Program root files: [
Expand Down Expand Up @@ -568,21 +568,21 @@ FsWatches::
/home/src/projects/project/packages/package2:
{"inode":11}
/home/src/projects/project/packages/package2/dist:
{"inode":117}
{"inode":118}
/home/src/projects/project/packages/package2/src:
{"inode":14}
/home/src/projects/project/packages/package2/src/index.ts:
{"inode":15}
/home/src/projects/project/packages/package2/tsconfig.json:
{"inode":13}
/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts:
{"inode":30}
{"inode":31}

FsWatches *deleted*::
/home/src/projects/project/packages/package1/dist:
{"inode":120}
{"inode":121}
/home/src/projects/project/packages/package1/dist/index.d.ts:
{"inode":122}
{"inode":123}

Timeout callback:: count: 2
10: timerToUpdateProgram *new*
Expand Down Expand Up @@ -690,8 +690,8 @@ Scheduling invalidateFailedLookup, Cancelled earlier one
Elapsed:: *ms DirectoryWatcher:: Triggered with /home/src/projects/project/node_modules/package1 :: WatchInfo: /home/src/projects/project/node_modules/package1 1 undefined Failed Lookup Locations


//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 118
//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 119
//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 119
//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 120

PolledWatches::
/home/src/projects/node_modules: *new*
Expand Down Expand Up @@ -729,15 +729,15 @@ FsWatches::
/home/src/projects/project/packages/package2:
{"inode":11}
/home/src/projects/project/packages/package2/dist:
{"inode":117}
{"inode":118}
/home/src/projects/project/packages/package2/src:
{"inode":14}
/home/src/projects/project/packages/package2/src/index.ts:
{"inode":15}
/home/src/projects/project/packages/package2/tsconfig.json:
{"inode":13}
/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts:
{"inode":30}
{"inode":31}

Timeout callback:: count: 1
16: timerToInvalidateFailedLookupResolutions *new*
Expand Down Expand Up @@ -927,14 +927,14 @@ exitCode:: ExitStatus.undefined
Change:: Build dependencies

Input::
//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 123
//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 124
//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 126
//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo] file written with same contents Inode:: 124
//// [/home/src/projects/project/packages/package1/tsconfig.tsbuildinfo.readable.baseline.txt] file written with same contents Inode:: 125
//// [/home/src/projects/project/packages/package1/dist/index.js] Inode:: 127
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });


//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 127
//// [/home/src/projects/project/packages/package1/dist/index.d.ts] Inode:: 128
export type FooType = "foo";
export type BarType = "bar";

Expand Down Expand Up @@ -981,23 +981,23 @@ FsWatches::
/home/src/projects/project/packages/package1:
{"inode":6}
/home/src/projects/project/packages/package1/dist: *new*
{"inode":125}
{"inode":126}
/home/src/projects/project/packages/package1/package.json:
{"inode":7}
/home/src/projects/project/packages/package1/src:
{"inode":9}
/home/src/projects/project/packages/package2:
{"inode":11}
/home/src/projects/project/packages/package2/dist:
{"inode":117}
{"inode":118}
/home/src/projects/project/packages/package2/src:
{"inode":14}
/home/src/projects/project/packages/package2/src/index.ts:
{"inode":15}
/home/src/projects/project/packages/package2/tsconfig.json:
{"inode":13}
/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts:
{"inode":30}
{"inode":31}

Timeout callback:: count: 1
21: timerToInvalidateFailedLookupResolutions *new*
Expand Down Expand Up @@ -1062,8 +1062,8 @@ packages/package2/src/index.ts



//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 118
//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 119
//// [/home/src/projects/project/packages/package2/dist/index.js] file written with same contents Inode:: 119
//// [/home/src/projects/project/packages/package2/dist/index.d.ts] file written with same contents Inode:: 120

PolledWatches::
/home/src/projects/node_modules/@types:
Expand Down Expand Up @@ -1091,25 +1091,25 @@ FsWatches::
/home/src/projects/project/packages/package1:
{"inode":6}
/home/src/projects/project/packages/package1/dist:
{"inode":125}
{"inode":126}
/home/src/projects/project/packages/package1/dist/index.d.ts: *new*
{"inode":127}
{"inode":128}
/home/src/projects/project/packages/package1/package.json:
{"inode":7}
/home/src/projects/project/packages/package1/src:
{"inode":9}
/home/src/projects/project/packages/package2:
{"inode":11}
/home/src/projects/project/packages/package2/dist:
{"inode":117}
{"inode":118}
/home/src/projects/project/packages/package2/src:
{"inode":14}
/home/src/projects/project/packages/package2/src/index.ts:
{"inode":15}
/home/src/projects/project/packages/package2/tsconfig.json:
{"inode":13}
/home/src/tslibs/TS/Lib/lib.es2016.full.d.ts:
{"inode":30}
{"inode":31}


Program root files: [
Expand Down
Loading