Skip to content

Commit

Permalink
feat: TypeScript 5.7 (#27857)
Browse files Browse the repository at this point in the history
Co-authored-by: Kenta Moriuchi <[email protected]>
  • Loading branch information
dsherret and petamoriken authored Jan 31, 2025
1 parent 8d82418 commit 8971064
Show file tree
Hide file tree
Showing 255 changed files with 7,930 additions and 22,248 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 34 additions & 10 deletions cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ mod ts {
// Deno built-in type libraries
"decorators",
"decorators.legacy",
"es5",
"dom.asynciterable",
"dom",
"dom.extras",
"dom.iterable",
"es2015.collection",
"es2015.core",
"es2015",
Expand All @@ -145,10 +148,13 @@ mod ts {
"es2015.symbol",
"es2015.symbol.wellknown",
"es2016.array.include",
"es2016.intl",
"es2016",
"es2016.full",
"es2016.intl",
"es2017.arraybuffer",
"es2017",
"es2017.date",
"es2017.full",
"es2017.intl",
"es2017.object",
"es2017.sharedmemory",
Expand All @@ -157,52 +163,70 @@ mod ts {
"es2018.asyncgenerator",
"es2018.asynciterable",
"es2018",
"es2018.full",
"es2018.intl",
"es2018.promise",
"es2018.regexp",
"es2019.array",
"es2019",
"es2019.full",
"es2019.intl",
"es2019.object",
"es2019.string",
"es2019.symbol",
"es2020.bigint",
"es2020",
"es2020.date",
"es2020.full",
"es2020.intl",
"es2020.number",
"es2020.promise",
"es2020.sharedmemory",
"es2020.string",
"es2020.symbol.wellknown",
"es2021",
"es2021.full",
"es2021.intl",
"es2021.promise",
"es2021.string",
"es2021.weakref",
"es2022",
"es2022.array",
"es2022",
"es2022.error",
"es2022.full",
"es2022.intl",
"es2022.object",
"es2022.regexp",
"es2022.sharedmemory",
"es2022.string",
"es2023",
"es2023.array",
"es2023.collection",
"es2023",
"es2023.full",
"es2023.intl",
"esnext",
"es2024.arraybuffer",
"es2024.collection",
"es2024",
"es2024.full",
"es2024.object",
"es2024.promise",
"es2024.regexp",
"es2024.sharedmemory",
"es2024.string",
"es5",
"es6",
"esnext.array",
"esnext.collection",
"esnext",
"esnext.decorators",
"esnext.disposable",
"esnext.full",
"esnext.intl",
"esnext.iterator",
"esnext.object",
"esnext.promise",
"esnext.regexp",
"esnext.string",
"scripthost",
"webworker.asynciterable",
"webworker",
"webworker.importscripts",
"webworker.iterable",
];

let path_dts = cwd.join("tsc/dts");
Expand Down
2 changes: 1 addition & 1 deletion cli/lib/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub fn otel_runtime_config() -> OtelRuntimeConfig {
}

const GIT_COMMIT_HASH: &str = env!("GIT_COMMIT_HASH");
const TYPESCRIPT: &str = "5.6.2";
const TYPESCRIPT: &str = "5.7.3";
const DENO_VERSION: &str = env!("DENO_VERSION");
// TODO(bartlomieju): ideally we could remove this const.
const IS_CANARY: bool = option_env!("DENO_CANARY").is_some();
Expand Down
18 changes: 16 additions & 2 deletions cli/lsp/tsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6015,11 +6015,25 @@ mod tests {

// get some notification when the size of the assets grows
let mut total_size = 0;
for asset in assets {
for asset in &assets {
total_size += asset.text().len();
}
assert!(total_size > 0);
assert!(total_size < 2_000_000); // currently as of TS 4.6, it's 0.7MB
#[allow(clippy::print_stderr)]
// currently as of TS 5.7, it's 3MB
if total_size > 3_500_000 {
let mut sizes = Vec::new();
for asset in &assets {
sizes.push((asset.specifier(), asset.text().len()));
}
sizes.sort_by_cached_key(|(_, size)| *size);
sizes.reverse();
for (specifier, size) in &sizes {
eprintln!("{}: {}", specifier, size);
}
eprintln!("Total size: {}", total_size);
panic!("Assets were quite large.");
}
}

#[tokio::test]
Expand Down
2 changes: 1 addition & 1 deletion cli/npm/installer/resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ fn get_add_pkg_reqs_options(package_reqs: &[PackageReq]) -> AddPkgReqsOptions {
// WARNING: When bumping this version, check if anything needs to be
// updated in the `setNodeOnlyGlobalNames` call in 99_main_compiler.js
types_node_version_req: Some(
VersionReq::parse_from_npm("22.0.0 - 22.5.4").unwrap(),
VersionReq::parse_from_npm("22.9.0 - 22.12.0").unwrap(),
),
}
}
Expand Down
2 changes: 1 addition & 1 deletion cli/snapshot/shared.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// Copyright 2018-2025 the Deno authors. MIT license.

pub static TS_VERSION: &str = "5.6.2";
pub static TS_VERSION: &str = "5.7.3";
Loading

0 comments on commit 8971064

Please sign in to comment.