Skip to content

Commit

Permalink
target es2021 (#23307)
Browse files Browse the repository at this point in the history
## 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.
  • Loading branch information
CraigMacomber authored Jan 14, 2025
1 parent 40d5824 commit 091b2df
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .changeset/ripe-taxes-press.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion common/build/build-common/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<IDriverErrorBase, "errorType"> {
Expand Down

0 comments on commit 091b2df

Please sign in to comment.