From 22d13d4aba84c5284faf87c024d1a6d24a43972f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Fern=C3=A1ndez?= Date: Mon, 25 Nov 2024 12:34:34 +0000 Subject: [PATCH] chore(ecmascript): switch to ES2024 --- frontend/src/main.ts | 7 ++++--- frontend/tsconfig.json | 2 +- frontend/vite.config.ts | 2 +- packages/configs/typescript/base.json | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 0463ac07449..8dc5828d76a 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -1,7 +1,8 @@ /** - * Top-level await requires ES2022 (at least) as target and module - * for TypeScript compiler (check tsconfig.json) - * https://caniuse.com/mdn-javascript_operators_await_top_level + * These features are used across the codebase and requires specific + * ECMAScript versions as target in TypeScript compiler (check tsconfig.json): + * - Top-level: ES2022 https://caniuse.com/mdn-javascript_operators_await_top_level + * - Object.groupBy: ES2024 https://caniuse.com/mdn-javascript_builtins_object_groupby */ import { createApp } from 'vue'; import { routes } from 'vue-router/auto-routes'; diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index ab663916f4d..0e1e20c0c77 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -2,7 +2,7 @@ "extends": "@jellyfin-vue/configs/typescript", "compilerOptions": { "lib": [ - "ESNext", + "ES2024", "DOM", "WebWorker" ], diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 985bd8c9641..3d144e4341a 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -74,7 +74,7 @@ export default defineConfig({ /** * See main.ts for an explanation of this target */ - target: 'esnext', + target: 'es2024', /** * Disable chunk size warnings */ diff --git a/packages/configs/typescript/base.json b/packages/configs/typescript/base.json index 12f09af43c4..77bc73d08b1 100644 --- a/packages/configs/typescript/base.json +++ b/packages/configs/typescript/base.json @@ -1,7 +1,7 @@ { "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { - "target": "ESNext", + "target": "ES2024", "module": "Preserve", "moduleResolution": "Bundler", "esModuleInterop": true,