semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

Targeting the Semaphore libraries to `ES2020`

Open cedoor opened this issue 1 year ago • 0 comments

Description

The current Semaphore libraries are written in TypeScript and are "compiled" into JavaScript with Rollup and tsc. The target in the current tsconfig.ts configuration is ES5, i.e. the first major revision to JavaScript.

Targeting ES2020 looks like it's generally fine today. It's widely supported across modern browsers and environments and it would allow Semaphore bundles to use new ES features natively, like arrow functions, promises, and classes, which can improve code readability and efficiency.

Can I Use also confirms that the number of people using browsers that might not support ES2020 features is less than 1%.

Discussed in https://github.com/orgs/semaphore-protocol/discussions/644

Originally posted by **cedoor** February 19, 2024 The current Semaphore libraries are written in TypeScript and are "compiled" into JavaScript with Rollup and `tsc`. The target in the current `tsconfig.ts` configuration is ES5, i.e. the first major revision to JavaScript.

Targeting ES6 (ECMAScript 2015) should be generally fine today. It's widely supported across modern browsers and environments and it would allow Semaphore bundles to use many ES6 features natively, like arrow functions, promises, and classes, which can improve code readability and efficiency.

cedoor avatar Mar 11 '24 17:03 cedoor