From 091b2df3601ab2b069c0fc1836d20dbb13e11661 Mon Sep 17 00:00:00 2001 From: "Craig Macomber (Microsoft)" <42876482+CraigMacomber@users.noreply.github.com> Date: Tue, 14 Jan 2025 14:18:32 -0800 Subject: [PATCH] target es2021 (#23307) ## Description Target es2021. This should reduce bundle size a little by allowing TypeScript to use slightly newer language features. ## Breaking Changes According to https://github.com/microsoft/FluidFramework/blob/main/ClientRequirements.md to require customers to have es2022 support or polyfill, so this should be allowed. This does NOT change the "lib" version, so customers should not need to add new library polyfills and does not change what APIs are allowed to be used in our code: this only updates the language version to allow using newer language features. As we don't actually have any tooling in place to prevent our dependencies from using newer language (or library) features, its likely we already implicitly have this requirement. --- .changeset/ripe-taxes-press.md | 16 ++++++++++++++++ common/build/build-common/tsconfig.base.json | 2 +- .../driver-definitions.legacy.alpha.api.md | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 .changeset/ripe-taxes-press.md diff --git a/.changeset/ripe-taxes-press.md b/.changeset/ripe-taxes-press.md new file mode 100644 index 000000000000..58f6e0ecf12f --- /dev/null +++ b/.changeset/ripe-taxes-press.md @@ -0,0 +1,16 @@ +--- +--- +--- +"section": other +--- + +Target ES2021 + +The TypeScript build for Fluid Framework packages has been updated to target ES2021 instead of ES2020. +This may result in newer JavaScript language features being used. +This does not change TypeScript types, nor the JavaScript libraries being used. +We only support users which support ES2022, so updating to target ES2021 should not break any supported use-case. +Any users which do not have at least ES2021 language feature support may need to transpile out some additional cases after this change. + +This should result in slightly reduced bundle size and slightly improved performance for users not transpiling these features out. +No major impact is expected. diff --git a/common/build/build-common/tsconfig.base.json b/common/build/build-common/tsconfig.base.json index 9420d5c7d2c7..c252a63b1a15 100644 --- a/common/build/build-common/tsconfig.base.json +++ b/common/build/build-common/tsconfig.base.json @@ -13,7 +13,7 @@ "pretty": true, "sourceMap": true, "strict": true, - "target": "ES2020", + "target": "ES2021", "types": [], // Enabling these compiler flags is necessary for typechecking compliance with semver as per https://www.semver-ts.org/ // See specifically https://www.semver-ts.org/formal-spec/5-compiler-considerations.html#strictness. diff --git a/packages/common/driver-definitions/api-report/driver-definitions.legacy.alpha.api.md b/packages/common/driver-definitions/api-report/driver-definitions.legacy.alpha.api.md index 1ad7ec6861b9..7d8a99a691de 100644 --- a/packages/common/driver-definitions/api-report/driver-definitions.legacy.alpha.api.md +++ b/packages/common/driver-definitions/api-report/driver-definitions.legacy.alpha.api.md @@ -70,7 +70,7 @@ export enum FileMode { } // @alpha (undocumented) -export type FiveDaysMs = 432000000; +export type FiveDaysMs = 432_000_000; // @alpha export interface IAnyDriverError extends Omit {