diff --git a/components/Player.js b/components/Player.js
index 364dc82a..d6dc7fc7 100644
--- a/components/Player.js
+++ b/components/Player.js
@@ -30,19 +30,15 @@ function InternalPlayer({ data, children, starred, extraText, condensed }) {
const t = useContext(TranslateContext);
const [countdown, setCountown] = useState(0);
useEffect(() => {
- const id = setInterval(
- () => setCountown((countdown) => countdown - 1),
- 60000,
- );
- return () => {
- clearInterval(id);
- };
- }, []);
- // Makes sure that the countdown is up to date
- useEffect(() => {
- setCountown(
- data.game ? Math.ceil((data.game.gameStart - Date.now() / 1000) / 60) : 0,
- );
+ const check = () =>
+ setCountown(
+ data.game
+ ? Math.ceil((data.game.gameStart - Date.now() / 1000) / 60)
+ : 0,
+ );
+ queueMicrotask(check);
+ const id = setInterval(check, 10000);
+ return () => clearInterval(id);
}, [data]);
const theme = useTheme();
const dark = theme.palette.mode === "dark";
diff --git a/components/Prediction.tsx b/components/Prediction.tsx
index 3360e68c..61b96266 100644
--- a/components/Prediction.tsx
+++ b/components/Prediction.tsx
@@ -1,6 +1,18 @@
import { NotifyContext, TranslateContext } from "#/Modules/context";
import { useContext, useEffect, useState } from "react";
import { TextField } from "@mui/material";
+
+function GameEndHeader({ gameEnd }: { gameEnd: number }) {
+ const t = useContext(TranslateContext);
+ const [isPastGameEnd, setIsPastGameEnd] = useState(false);
+ useEffect(() => {
+ const check = () => setIsPastGameEnd(Date.now() / 1000 > gameEnd);
+ queueMicrotask(check);
+ const id = setInterval(check, 10000);
+ return () => clearInterval(id);
+ }, [gameEnd]);
+ return
{isPastGameEnd ? t("Final Scores") : t("Current Scores")}
;
+}
export interface predictions {
home_team: string;
home_team_name: string | undefined;
@@ -63,18 +75,14 @@ export function Game({
notify(t(await response.text()), response.ok ? "success" : "error");
});
}
- const [countdown, setCountown] = useState(
- Math.ceil((gameStart - Date.now() / 1000) / 60),
- );
+ const [countdown, setCountown] = useState(0);
useEffect(() => {
- const id = setInterval(
- () => setCountown((countdown) => countdown - 1),
- 60000,
- );
- return () => {
- clearInterval(id);
- };
- }, []);
+ const check = () =>
+ setCountown(Math.ceil((gameStart - Date.now() / 1000) / 60));
+ queueMicrotask(check);
+ const id = setInterval(check, 10000);
+ return () => clearInterval(id);
+ }, [gameStart]);
const t = useContext(TranslateContext);
const home_team_text = home_team_name || home_team;
const away_team_text = away_team_name || away_team;
@@ -129,11 +137,7 @@ export function Game({
>
)}
-
- {Date.now() / 1000 > gameEnd
- ? t("Final Scores")
- : t("Current Scores")}
-
+
{home_score} - {away_score}
diff --git a/cypress.config.js b/cypress.config.js
index a2d32ba0..20d4f3a0 100644
--- a/cypress.config.js
+++ b/cypress.config.js
@@ -3,6 +3,7 @@ const { defineConfig } = require("cypress");
module.exports = defineConfig({
video: false,
e2e: {
+ baseUrl: "http://localhost:3000",
setupNodeEvents(on, config) {
// implement node event listeners here
},
diff --git a/cypress/e2e/download.cy.js b/cypress/e2e/download.cy.js
index 3ff08c7b..f980167f 100644
--- a/cypress/e2e/download.cy.js
+++ b/cypress/e2e/download.cy.js
@@ -42,7 +42,6 @@ describe("Download Bundesliga data as JSON and CSV", () => {
});
it("downloads JSON and verifies format", () => {
- cy.visit("http://localhost:3000");
cy.request({
method: "GET",
url: `/api/download`,
@@ -82,7 +81,6 @@ describe("Download Bundesliga data as JSON and CSV", () => {
});
it("downloads CSV and verifies format", () => {
- cy.visit("http://localhost:3000");
cy.request({
method: "GET",
url: `/api/download`,
diff --git a/cypress/e2e/invite.cy.js b/cypress/e2e/invite.cy.js
index 16a24447..a173ab96 100644
--- a/cypress/e2e/invite.cy.js
+++ b/cypress/e2e/invite.cy.js
@@ -12,9 +12,7 @@ describe("Invite User into league and change some league Settings and run throug
let user2;
let matchdays = [];
// Signs in
- cy.visit("http://localhost:3000");
- cy.get("#login").click();
- cy.contains("Click here for creating an account").click();
+ cy.visit("/signup");
cy.get("#username").type("Invite 1");
cy.get("#password").type("password");
cy.get(".center > .MuiButtonBase-root").click();
diff --git a/cypress/e2e/predictions.cy.js b/cypress/e2e/predictions.cy.js
index 3531f4e2..687ce68c 100644
--- a/cypress/e2e/predictions.cy.js
+++ b/cypress/e2e/predictions.cy.js
@@ -7,9 +7,7 @@ describe("Create Predictions league and do some simple predictions.", () => {
// Used to signup change username and password and login again
it("invite", () => {
// Signs in
- cy.visit("http://localhost:3000");
- cy.get("#login").click();
- cy.contains("Click here for creating an account").click();
+ cy.visit("/signup");
cy.get("#username").type("Predictions 1");
cy.get("#password").type("password");
cy.get(".center > .MuiButtonBase-root").click();
diff --git a/eslint.config.mjs b/eslint.config.mjs
index d3f9e844..83a85c39 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -4,6 +4,7 @@ import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
+import nextVitals from "eslint-config-next/core-web-vitals";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
@@ -32,10 +33,8 @@ export default [
"next-env.d.ts",
],
},
- ...compat.extends(
- "next/core-web-vitals",
- "plugin:@typescript-eslint/recommended",
- ),
+ ...nextVitals,
+ ...compat.extends("plugin:@typescript-eslint/recommended"),
{
plugins: {
"@typescript-eslint": typescriptEslint,
diff --git a/next-env.d.ts b/next-env.d.ts
index 254b73c1..19709046 100644
--- a/next-env.d.ts
+++ b/next-env.d.ts
@@ -1,6 +1,6 @@
///
///
-///
+import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
diff --git a/next.config.js b/next.config.js
index 4eaf76bb..fd02dfc0 100644
--- a/next.config.js
+++ b/next.config.js
@@ -8,6 +8,7 @@ const nextConfig = {
images: {
minimumCacheTTL: 60 * 60 * 24 * 365, // There are no dynamic images used here.
},
+ reactCompiler: true,
};
module.exports = nextConfig;
diff --git a/package-lock.json b/package-lock.json
index 5bd06c3f..9d34ccc1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18,7 +18,7 @@
"csv-stringify": "^6.5.2",
"dotenv": "^17.0.0",
"kysely": "^0.28.0",
- "next": "^15.3.3",
+ "next": "^16.1.6",
"next-auth": "^4.24.11",
"react": "^19.1.0",
"react-chartjs-2": "^5.3.0",
@@ -34,14 +34,16 @@
"@types/react": "^19.1.6",
"@typescript-eslint/eslint-plugin": "^8.35.0",
"@typescript-eslint/parser": "^8.35.0",
+ "babel-plugin-react-compiler": "^1.0.0",
"cypress": "^15.0.0",
"eslint": "^9.29.0",
- "eslint-config-next": "^15.3.3",
+ "eslint-config-next": "^16.1.6",
"jest": "^30.0.0",
"kysely-codegen": "^0.19.0",
"prettier": "^3.5.3",
"ts-jest": "^29.4.0",
"typescript": "^5.8.3",
+ "typescript-eslint": "^8.35.0",
"wait-on": "^9.0.0"
},
"engines": {
@@ -2441,15 +2443,15 @@
}
},
"node_modules/@next/env": {
- "version": "15.5.9",
- "resolved": "https://registry.npmjs.org/@next/env/-/env-15.5.9.tgz",
- "integrity": "sha512-4GlTZ+EJM7WaW2HEZcyU317tIQDjkQIyENDLxYJfSWlfqguN+dHkZgyQTV/7ykvobU7yEH5gKvreNrH4B6QgIg==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/@next/env/-/env-16.1.6.tgz",
+ "integrity": "sha512-N1ySLuZjnAtN3kFnwhAwPvZah8RJxKasD7x1f8shFqhncnWZn4JMfg37diLNuoHsLAlrDfM3g4mawVdtAG8XLQ==",
"license": "MIT"
},
"node_modules/@next/eslint-plugin-next": {
- "version": "15.5.9",
- "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-15.5.9.tgz",
- "integrity": "sha512-kUzXx0iFiXw27cQAViE1yKWnz/nF8JzRmwgMRTMh8qMY90crNsdXJRh2e+R0vBpFR3kk1yvAR7wev7+fCCb79Q==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-16.1.6.tgz",
+ "integrity": "sha512-/Qq3PTagA6+nYVfryAtQ7/9FEr/6YVyvOtl6rZnGsbReGLf0jZU6gkpr1FuChAQpvV46a78p4cmHOVP8mbfSMQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2457,9 +2459,9 @@
}
},
"node_modules/@next/swc-darwin-arm64": {
- "version": "15.5.7",
- "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.5.7.tgz",
- "integrity": "sha512-IZwtxCEpI91HVU/rAUOOobWSZv4P2DeTtNaCdHqLcTJU4wdNXgAySvKa/qJCgR5m6KI8UsKDXtO2B31jcaw1Yw==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-16.1.6.tgz",
+ "integrity": "sha512-wTzYulosJr/6nFnqGW7FrG3jfUUlEf8UjGA0/pyypJl42ExdVgC6xJgcXQ+V8QFn6niSG2Pb8+MIG1mZr2vczw==",
"cpu": [
"arm64"
],
@@ -2473,9 +2475,9 @@
}
},
"node_modules/@next/swc-darwin-x64": {
- "version": "15.5.7",
- "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.5.7.tgz",
- "integrity": "sha512-UP6CaDBcqaCBuiq/gfCEJw7sPEoX1aIjZHnBWN9v9qYHQdMKvCKcAVs4OX1vIjeE+tC5EIuwDTVIoXpUes29lg==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-16.1.6.tgz",
+ "integrity": "sha512-BLFPYPDO+MNJsiDWbeVzqvYd4NyuRrEYVB5k2N3JfWncuHAy2IVwMAOlVQDFjj+krkWzhY2apvmekMkfQR0CUQ==",
"cpu": [
"x64"
],
@@ -2489,9 +2491,9 @@
}
},
"node_modules/@next/swc-linux-arm64-gnu": {
- "version": "15.5.7",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.5.7.tgz",
- "integrity": "sha512-NCslw3GrNIw7OgmRBxHtdWFQYhexoUCq+0oS2ccjyYLtcn1SzGzeM54jpTFonIMUjNbHmpKpziXnpxhSWLcmBA==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-16.1.6.tgz",
+ "integrity": "sha512-OJYkCd5pj/QloBvoEcJ2XiMnlJkRv9idWA/j0ugSuA34gMT6f5b7vOiCQHVRpvStoZUknhl6/UxOXL4OwtdaBw==",
"cpu": [
"arm64"
],
@@ -2505,9 +2507,9 @@
}
},
"node_modules/@next/swc-linux-arm64-musl": {
- "version": "15.5.7",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.5.7.tgz",
- "integrity": "sha512-nfymt+SE5cvtTrG9u1wdoxBr9bVB7mtKTcj0ltRn6gkP/2Nu1zM5ei8rwP9qKQP0Y//umK+TtkKgNtfboBxRrw==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-16.1.6.tgz",
+ "integrity": "sha512-S4J2v+8tT3NIO9u2q+S0G5KdvNDjXfAv06OhfOzNDaBn5rw84DGXWndOEB7d5/x852A20sW1M56vhC/tRVbccQ==",
"cpu": [
"arm64"
],
@@ -2521,9 +2523,9 @@
}
},
"node_modules/@next/swc-linux-x64-gnu": {
- "version": "15.5.7",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.5.7.tgz",
- "integrity": "sha512-hvXcZvCaaEbCZcVzcY7E1uXN9xWZfFvkNHwbe/n4OkRhFWrs1J1QV+4U1BN06tXLdaS4DazEGXwgqnu/VMcmqw==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-16.1.6.tgz",
+ "integrity": "sha512-2eEBDkFlMMNQnkTyPBhQOAyn2qMxyG2eE7GPH2WIDGEpEILcBPI/jdSv4t6xupSP+ot/jkfrCShLAa7+ZUPcJQ==",
"cpu": [
"x64"
],
@@ -2537,9 +2539,9 @@
}
},
"node_modules/@next/swc-linux-x64-musl": {
- "version": "15.5.7",
- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.5.7.tgz",
- "integrity": "sha512-4IUO539b8FmF0odY6/SqANJdgwn1xs1GkPO5doZugwZ3ETF6JUdckk7RGmsfSf7ws8Qb2YB5It33mvNL/0acqA==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-16.1.6.tgz",
+ "integrity": "sha512-oicJwRlyOoZXVlxmIMaTq7f8pN9QNbdes0q2FXfRsPhfCi8n8JmOZJm5oo1pwDaFbnnD421rVU409M3evFbIqg==",
"cpu": [
"x64"
],
@@ -2553,9 +2555,9 @@
}
},
"node_modules/@next/swc-win32-arm64-msvc": {
- "version": "15.5.7",
- "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.5.7.tgz",
- "integrity": "sha512-CpJVTkYI3ZajQkC5vajM7/ApKJUOlm6uP4BknM3XKvJ7VXAvCqSjSLmM0LKdYzn6nBJVSjdclx8nYJSa3xlTgQ==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-16.1.6.tgz",
+ "integrity": "sha512-gQmm8izDTPgs+DCWH22kcDmuUp7NyiJgEl18bcr8irXA5N2m2O+JQIr6f3ct42GOs9c0h8QF3L5SzIxcYAAXXw==",
"cpu": [
"arm64"
],
@@ -2569,9 +2571,9 @@
}
},
"node_modules/@next/swc-win32-x64-msvc": {
- "version": "15.5.7",
- "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.5.7.tgz",
- "integrity": "sha512-gMzgBX164I6DN+9/PGA+9dQiwmTkE4TloBNx8Kv9UiGARsr9Nba7IpcBRA1iTV9vwlYnrE3Uy6I7Aj6qLjQuqw==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-16.1.6.tgz",
+ "integrity": "sha512-NRfO39AIrzBnixKbjuo2YiYhB6o9d8v/ymU9m/Xk8cyVk+k7XylniXkHwjs4s70wedVffc6bQNbufk5v0xEm0A==",
"cpu": [
"x64"
],
@@ -2682,13 +2684,6 @@
"dev": true,
"license": "MIT"
},
- "node_modules/@rushstack/eslint-patch": {
- "version": "1.15.0",
- "resolved": "https://registry.npmjs.org/@rushstack/eslint-patch/-/eslint-patch-1.15.0.tgz",
- "integrity": "sha512-ojSshQPKwVvSMR8yT2L/QtUkV5SXi/IfDiJ4/8d6UbTPjiHVmxZzUAzGD8Tzks1b9+qQkZa0isUOvYObedITaw==",
- "dev": true,
- "license": "MIT"
- },
"node_modules/@sinclair/typebox": {
"version": "0.34.48",
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.48.tgz",
@@ -2988,17 +2983,17 @@
}
},
"node_modules/@typescript-eslint/eslint-plugin": {
- "version": "8.53.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.53.1.tgz",
- "integrity": "sha512-cFYYFZ+oQFi6hUnBTbLRXfTJiaQtYE3t4O692agbBl+2Zy+eqSKWtPjhPXJu1G7j4RLjKgeJPDdq3EqOwmX5Ag==",
+ "version": "8.54.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.54.0.tgz",
+ "integrity": "sha512-hAAP5io/7csFStuOmR782YmTthKBJ9ND3WVL60hcOjvtGFb+HJxH4O5huAcmcZ9v9G8P+JETiZ/G1B8MALnWZQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/regexpp": "^4.12.2",
- "@typescript-eslint/scope-manager": "8.53.1",
- "@typescript-eslint/type-utils": "8.53.1",
- "@typescript-eslint/utils": "8.53.1",
- "@typescript-eslint/visitor-keys": "8.53.1",
+ "@typescript-eslint/scope-manager": "8.54.0",
+ "@typescript-eslint/type-utils": "8.54.0",
+ "@typescript-eslint/utils": "8.54.0",
+ "@typescript-eslint/visitor-keys": "8.54.0",
"ignore": "^7.0.5",
"natural-compare": "^1.4.0",
"ts-api-utils": "^2.4.0"
@@ -3011,23 +3006,23 @@
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
- "@typescript-eslint/parser": "^8.53.1",
+ "@typescript-eslint/parser": "^8.54.0",
"eslint": "^8.57.0 || ^9.0.0",
"typescript": ">=4.8.4 <6.0.0"
}
},
"node_modules/@typescript-eslint/parser": {
- "version": "8.53.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.53.1.tgz",
- "integrity": "sha512-nm3cvFN9SqZGXjmw5bZ6cGmvJSyJPn0wU9gHAZZHDnZl2wF9PhHv78Xf06E0MaNk4zLVHL8hb2/c32XvyJOLQg==",
+ "version": "8.54.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.54.0.tgz",
+ "integrity": "sha512-BtE0k6cjwjLZoZixN0t5AKP0kSzlGu7FctRXYuPAm//aaiZhmfq1JwdYpYr1brzEspYyFeF+8XF5j2VK6oalrA==",
"dev": true,
"license": "MIT",
"peer": true,
"dependencies": {
- "@typescript-eslint/scope-manager": "8.53.1",
- "@typescript-eslint/types": "8.53.1",
- "@typescript-eslint/typescript-estree": "8.53.1",
- "@typescript-eslint/visitor-keys": "8.53.1",
+ "@typescript-eslint/scope-manager": "8.54.0",
+ "@typescript-eslint/types": "8.54.0",
+ "@typescript-eslint/typescript-estree": "8.54.0",
+ "@typescript-eslint/visitor-keys": "8.54.0",
"debug": "^4.4.3"
},
"engines": {
@@ -3043,14 +3038,14 @@
}
},
"node_modules/@typescript-eslint/project-service": {
- "version": "8.53.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.53.1.tgz",
- "integrity": "sha512-WYC4FB5Ra0xidsmlPb+1SsnaSKPmS3gsjIARwbEkHkoWloQmuzcfypljaJcR78uyLA1h8sHdWWPHSLDI+MtNog==",
+ "version": "8.54.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.54.0.tgz",
+ "integrity": "sha512-YPf+rvJ1s7MyiWM4uTRhE4DvBXrEV+d8oC3P9Y2eT7S+HBS0clybdMIPnhiATi9vZOYDc7OQ1L/i6ga6NFYK/g==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@typescript-eslint/tsconfig-utils": "^8.53.1",
- "@typescript-eslint/types": "^8.53.1",
+ "@typescript-eslint/tsconfig-utils": "^8.54.0",
+ "@typescript-eslint/types": "^8.54.0",
"debug": "^4.4.3"
},
"engines": {
@@ -3065,14 +3060,14 @@
}
},
"node_modules/@typescript-eslint/scope-manager": {
- "version": "8.53.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.53.1.tgz",
- "integrity": "sha512-Lu23yw1uJMFY8cUeq7JlrizAgeQvWugNQzJp8C3x8Eo5Jw5Q2ykMdiiTB9vBVOOUBysMzmRRmUfwFrZuI2C4SQ==",
+ "version": "8.54.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.54.0.tgz",
+ "integrity": "sha512-27rYVQku26j/PbHYcVfRPonmOlVI6gihHtXFbTdB5sb6qA0wdAQAbyXFVarQ5t4HRojIz64IV90YtsjQSSGlQg==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@typescript-eslint/types": "8.53.1",
- "@typescript-eslint/visitor-keys": "8.53.1"
+ "@typescript-eslint/types": "8.54.0",
+ "@typescript-eslint/visitor-keys": "8.54.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -3083,9 +3078,9 @@
}
},
"node_modules/@typescript-eslint/tsconfig-utils": {
- "version": "8.53.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.53.1.tgz",
- "integrity": "sha512-qfvLXS6F6b1y43pnf0pPbXJ+YoXIC7HKg0UGZ27uMIemKMKA6XH2DTxsEDdpdN29D+vHV07x/pnlPNVLhdhWiA==",
+ "version": "8.54.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.54.0.tgz",
+ "integrity": "sha512-dRgOyT2hPk/JwxNMZDsIXDgyl9axdJI3ogZ2XWhBPsnZUv+hPesa5iuhdYt2gzwA9t8RE5ytOJ6xB0moV0Ujvw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -3100,15 +3095,15 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
- "version": "8.53.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.53.1.tgz",
- "integrity": "sha512-MOrdtNvyhy0rHyv0ENzub1d4wQYKb2NmIqG7qEqPWFW7Mpy2jzFC3pQ2yKDvirZB7jypm5uGjF2Qqs6OIqu47w==",
+ "version": "8.54.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.54.0.tgz",
+ "integrity": "sha512-hiLguxJWHjjwL6xMBwD903ciAwd7DmK30Y9Axs/etOkftC3ZNN9K44IuRD/EB08amu+Zw6W37x9RecLkOo3pMA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@typescript-eslint/types": "8.53.1",
- "@typescript-eslint/typescript-estree": "8.53.1",
- "@typescript-eslint/utils": "8.53.1",
+ "@typescript-eslint/types": "8.54.0",
+ "@typescript-eslint/typescript-estree": "8.54.0",
+ "@typescript-eslint/utils": "8.54.0",
"debug": "^4.4.3",
"ts-api-utils": "^2.4.0"
},
@@ -3125,9 +3120,9 @@
}
},
"node_modules/@typescript-eslint/types": {
- "version": "8.53.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.53.1.tgz",
- "integrity": "sha512-jr/swrr2aRmUAUjW5/zQHbMaui//vQlsZcJKijZf3M26bnmLj8LyZUpj8/Rd6uzaek06OWsqdofN/Thenm5O8A==",
+ "version": "8.54.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.54.0.tgz",
+ "integrity": "sha512-PDUI9R1BVjqu7AUDsRBbKMtwmjWcn4J3le+5LpcFgWULN3LvHC5rkc9gCVxbrsrGmO1jfPybN5s6h4Jy+OnkAA==",
"dev": true,
"license": "MIT",
"engines": {
@@ -3139,16 +3134,16 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
- "version": "8.53.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.53.1.tgz",
- "integrity": "sha512-RGlVipGhQAG4GxV1s34O91cxQ/vWiHJTDHbXRr0li2q/BGg3RR/7NM8QDWgkEgrwQYCvmJV9ichIwyoKCQ+DTg==",
+ "version": "8.54.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.54.0.tgz",
+ "integrity": "sha512-BUwcskRaPvTk6fzVWgDPdUndLjB87KYDrN5EYGetnktoeAvPtO4ONHlAZDnj5VFnUANg0Sjm7j4usBlnoVMHwA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@typescript-eslint/project-service": "8.53.1",
- "@typescript-eslint/tsconfig-utils": "8.53.1",
- "@typescript-eslint/types": "8.53.1",
- "@typescript-eslint/visitor-keys": "8.53.1",
+ "@typescript-eslint/project-service": "8.54.0",
+ "@typescript-eslint/tsconfig-utils": "8.54.0",
+ "@typescript-eslint/types": "8.54.0",
+ "@typescript-eslint/visitor-keys": "8.54.0",
"debug": "^4.4.3",
"minimatch": "^9.0.5",
"semver": "^7.7.3",
@@ -3167,16 +3162,16 @@
}
},
"node_modules/@typescript-eslint/utils": {
- "version": "8.53.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.53.1.tgz",
- "integrity": "sha512-c4bMvGVWW4hv6JmDUEG7fSYlWOl3II2I4ylt0NM+seinYQlZMQIaKaXIIVJWt9Ofh6whrpM+EdDQXKXjNovvrg==",
+ "version": "8.54.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.54.0.tgz",
+ "integrity": "sha512-9Cnda8GS57AQakvRyG0PTejJNlA2xhvyNtEVIMlDWOOeEyBkYWhGPnfrIAnqxLMTSTo6q8g12XVjjev5l1NvMA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@eslint-community/eslint-utils": "^4.9.1",
- "@typescript-eslint/scope-manager": "8.53.1",
- "@typescript-eslint/types": "8.53.1",
- "@typescript-eslint/typescript-estree": "8.53.1"
+ "@typescript-eslint/scope-manager": "8.54.0",
+ "@typescript-eslint/types": "8.54.0",
+ "@typescript-eslint/typescript-estree": "8.54.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -3191,13 +3186,13 @@
}
},
"node_modules/@typescript-eslint/visitor-keys": {
- "version": "8.53.1",
- "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.53.1.tgz",
- "integrity": "sha512-oy+wV7xDKFPRyNggmXuZQSBzvoLnpmJs+GhzRhPjrxl2b/jIlyjVokzm47CZCDUdXKr2zd7ZLodPfOBpOPyPlg==",
+ "version": "8.54.0",
+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.54.0.tgz",
+ "integrity": "sha512-VFlhGSl4opC0bprJiItPQ1RfUhGDIBokcPwaFH4yiBCaNPeld/9VeXbiPO1cLyorQi1G1vL+ecBk1x8o1axORA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@typescript-eslint/types": "8.53.1",
+ "@typescript-eslint/types": "8.54.0",
"eslint-visitor-keys": "^4.2.1"
},
"engines": {
@@ -4052,6 +4047,17 @@
"npm": ">=6"
}
},
+ "node_modules/babel-plugin-react-compiler": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/babel-plugin-react-compiler/-/babel-plugin-react-compiler-1.0.0.tgz",
+ "integrity": "sha512-Ixm8tFfoKKIPYdCCKYTsqv+Fd4IJ0DQqMyEimo+pxUOMUR9cVPlwTrFt9Avu+3cb6Zp3mAzl+t1MrG2fxxKsxw==",
+ "devOptional": true,
+ "license": "MIT",
+ "peer": true,
+ "dependencies": {
+ "@babel/types": "^7.26.0"
+ }
+ },
"node_modules/babel-preset-current-node-syntax": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz",
@@ -4127,7 +4133,6 @@
"version": "2.9.18",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.18.tgz",
"integrity": "sha512-e23vBV1ZLfjb9apvfPk4rHVu2ry6RIr2Wfs+O324okSidrX7pTAnEJPCh/O5BtRlr7QtZI7ktOP3vsqr7Z5XoA==",
- "dev": true,
"license": "Apache-2.0",
"bin": {
"baseline-browser-mapping": "dist/cli.js"
@@ -5487,25 +5492,24 @@
}
},
"node_modules/eslint-config-next": {
- "version": "15.5.9",
- "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-15.5.9.tgz",
- "integrity": "sha512-852JYI3NkFNzW8CqsMhI0K2CDRxTObdZ2jQJj5CtpEaOkYHn13107tHpNuD/h0WRpU4FAbCdUaxQsrfBtNK9Kw==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-16.1.6.tgz",
+ "integrity": "sha512-vKq40io2B0XtkkNDYyleATwblNt8xuh3FWp8SpSz3pt7P01OkBFlKsJZ2mWt5WsCySlDQLckb1zMY9yE9Qy0LA==",
"dev": true,
"license": "MIT",
"dependencies": {
- "@next/eslint-plugin-next": "15.5.9",
- "@rushstack/eslint-patch": "^1.10.3",
- "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
- "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0",
+ "@next/eslint-plugin-next": "16.1.6",
"eslint-import-resolver-node": "^0.3.6",
"eslint-import-resolver-typescript": "^3.5.2",
- "eslint-plugin-import": "^2.31.0",
+ "eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-react": "^7.37.0",
- "eslint-plugin-react-hooks": "^5.0.0"
+ "eslint-plugin-react-hooks": "^7.0.0",
+ "globals": "16.4.0",
+ "typescript-eslint": "^8.46.0"
},
"peerDependencies": {
- "eslint": "^7.23.0 || ^8.0.0 || ^9.0.0",
+ "eslint": ">=9.0.0",
"typescript": ">=3.3.1"
},
"peerDependenciesMeta": {
@@ -5514,6 +5518,19 @@
}
}
},
+ "node_modules/eslint-config-next/node_modules/globals": {
+ "version": "16.4.0",
+ "resolved": "https://registry.npmjs.org/globals/-/globals-16.4.0.tgz",
+ "integrity": "sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/eslint-import-resolver-node": {
"version": "0.3.9",
"resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz",
@@ -5766,13 +5783,20 @@
}
},
"node_modules/eslint-plugin-react-hooks": {
- "version": "5.2.0",
- "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz",
- "integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==",
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz",
+ "integrity": "sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==",
"dev": true,
"license": "MIT",
+ "dependencies": {
+ "@babel/core": "^7.24.4",
+ "@babel/parser": "^7.24.4",
+ "hermes-parser": "^0.25.1",
+ "zod": "^3.25.0 || ^4.0.0",
+ "zod-validation-error": "^3.5.0 || ^4.0.0"
+ },
"engines": {
- "node": ">=10"
+ "node": ">=18"
},
"peerDependencies": {
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0"
@@ -6982,6 +7006,23 @@
"node": ">= 0.4"
}
},
+ "node_modules/hermes-estree": {
+ "version": "0.25.1",
+ "resolved": "https://registry.npmjs.org/hermes-estree/-/hermes-estree-0.25.1.tgz",
+ "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==",
+ "dev": true,
+ "license": "MIT"
+ },
+ "node_modules/hermes-parser": {
+ "version": "0.25.1",
+ "resolved": "https://registry.npmjs.org/hermes-parser/-/hermes-parser-0.25.1.tgz",
+ "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "hermes-estree": "0.25.1"
+ }
+ },
"node_modules/hoist-non-react-statics": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz",
@@ -9191,14 +9232,15 @@
"license": "MIT"
},
"node_modules/next": {
- "version": "15.5.9",
- "resolved": "https://registry.npmjs.org/next/-/next-15.5.9.tgz",
- "integrity": "sha512-agNLK89seZEtC5zUHwtut0+tNrc0Xw4FT/Dg+B/VLEo9pAcS9rtTKpek3V6kVcVwsB2YlqMaHdfZL4eLEVYuCg==",
+ "version": "16.1.6",
+ "resolved": "https://registry.npmjs.org/next/-/next-16.1.6.tgz",
+ "integrity": "sha512-hkyRkcu5x/41KoqnROkfTm2pZVbKxvbZRuNvKXLRXxs3VfyO0WhY50TQS40EuKO9SW3rBj/sF3WbVwDACeMZyw==",
"license": "MIT",
"peer": true,
"dependencies": {
- "@next/env": "15.5.9",
+ "@next/env": "16.1.6",
"@swc/helpers": "0.5.15",
+ "baseline-browser-mapping": "^2.8.3",
"caniuse-lite": "^1.0.30001579",
"postcss": "8.4.31",
"styled-jsx": "5.1.6"
@@ -9207,18 +9249,18 @@
"next": "dist/bin/next"
},
"engines": {
- "node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
+ "node": ">=20.9.0"
},
"optionalDependencies": {
- "@next/swc-darwin-arm64": "15.5.7",
- "@next/swc-darwin-x64": "15.5.7",
- "@next/swc-linux-arm64-gnu": "15.5.7",
- "@next/swc-linux-arm64-musl": "15.5.7",
- "@next/swc-linux-x64-gnu": "15.5.7",
- "@next/swc-linux-x64-musl": "15.5.7",
- "@next/swc-win32-arm64-msvc": "15.5.7",
- "@next/swc-win32-x64-msvc": "15.5.7",
- "sharp": "^0.34.3"
+ "@next/swc-darwin-arm64": "16.1.6",
+ "@next/swc-darwin-x64": "16.1.6",
+ "@next/swc-linux-arm64-gnu": "16.1.6",
+ "@next/swc-linux-arm64-musl": "16.1.6",
+ "@next/swc-linux-x64-gnu": "16.1.6",
+ "@next/swc-linux-x64-musl": "16.1.6",
+ "@next/swc-win32-arm64-msvc": "16.1.6",
+ "@next/swc-win32-x64-msvc": "16.1.6",
+ "sharp": "^0.34.4"
},
"peerDependencies": {
"@opentelemetry/api": "^1.1.0",
@@ -11839,6 +11881,30 @@
"node": ">=14.17"
}
},
+ "node_modules/typescript-eslint": {
+ "version": "8.54.0",
+ "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.54.0.tgz",
+ "integrity": "sha512-CKsJ+g53QpsNPqbzUsfKVgd3Lny4yKZ1pP4qN3jdMOg/sisIDLGyDMezycquXLE5JsEU0wp3dGNdzig0/fmSVQ==",
+ "dev": true,
+ "license": "MIT",
+ "dependencies": {
+ "@typescript-eslint/eslint-plugin": "8.54.0",
+ "@typescript-eslint/parser": "8.54.0",
+ "@typescript-eslint/typescript-estree": "8.54.0",
+ "@typescript-eslint/utils": "8.54.0"
+ },
+ "engines": {
+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "peerDependencies": {
+ "eslint": "^8.57.0 || ^9.0.0",
+ "typescript": ">=4.8.4 <6.0.0"
+ }
+ },
"node_modules/uglify-js": {
"version": "3.19.3",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
@@ -12348,9 +12414,23 @@
"integrity": "sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==",
"dev": true,
"license": "MIT",
+ "peer": true,
"funding": {
"url": "https://github.com/sponsors/colinhacks"
}
+ },
+ "node_modules/zod-validation-error": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/zod-validation-error/-/zod-validation-error-4.0.2.tgz",
+ "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==",
+ "dev": true,
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "peerDependencies": {
+ "zod": "^3.25.0 || ^4.0.0"
+ }
}
}
}
diff --git a/package.json b/package.json
index aefc7ba3..c3f4cc05 100644
--- a/package.json
+++ b/package.json
@@ -25,17 +25,17 @@
"dbtypes:check": "kysely-codegen --url ./test.db --out-file ./types/db.ts --verify --log-level=error"
},
"dependencies": {
- "@types/better-sqlite3": "^7.6.13",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.1",
"@mui/material": "^7.1.1",
+ "@types/better-sqlite3": "^7.6.13",
"bcrypt": "^6.0.0",
"better-sqlite3": "^12.0.0",
"chart.js": "^4.5.0",
"csv-stringify": "^6.5.2",
"dotenv": "^17.0.0",
"kysely": "^0.28.0",
- "next": "^15.3.3",
+ "next": "^16.1.6",
"next-auth": "^4.24.11",
"react": "^19.1.0",
"react-chartjs-2": "^5.3.0",
@@ -54,14 +54,16 @@
"@types/react": "^19.1.6",
"@typescript-eslint/eslint-plugin": "^8.35.0",
"@typescript-eslint/parser": "^8.35.0",
+ "babel-plugin-react-compiler": "^1.0.0",
"cypress": "^15.0.0",
"eslint": "^9.29.0",
- "eslint-config-next": "^15.3.3",
+ "eslint-config-next": "^16.1.6",
"jest": "^30.0.0",
"kysely-codegen": "^0.19.0",
"prettier": "^3.5.3",
"ts-jest": "^29.4.0",
"typescript": "^5.8.3",
+ "typescript-eslint": "^8.35.0",
"wait-on": "^9.0.0"
},
"imports": {
diff --git a/pages/leagues.tsx b/pages/leagues.tsx
index 1cfbd59f..5dd66ae6 100644
--- a/pages/leagues.tsx
+++ b/pages/leagues.tsx
@@ -241,7 +241,7 @@ function Leagues({ leagues }: LeaguesProps) {
};
// Makes sure to get the league data on the mount
useEffect(() => {
- getLeagueData();
+ queueMicrotask(() => getLeagueData());
}, []);
const [favoriteLeague, setFavoriteLeague] = useState<
LeagueListPart | undefined
@@ -255,11 +255,11 @@ function Leagues({ leagues }: LeaguesProps) {
const newFavoriteLeague = leagueList.leagues.filter(
(e) => e.leagueID === session.user.favoriteLeague,
);
- setFavoriteLeague(
+ const newVal =
newFavoriteLeague.length > 0
? JSON.parse(JSON.stringify(newFavoriteLeague[0]))
- : undefined,
- );
+ : undefined;
+ queueMicrotask(() => setFavoriteLeague(newVal));
}, [session, leagueList, favoriteLeague]);
// Used to update the favorite
async function updateFavorite(val: LeagueListPart | undefined) {
diff --git a/tsconfig.json b/tsconfig.json
index c122a845..c6e43f77 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -25,7 +25,7 @@
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
- "jsx": "preserve"
+ "jsx": "react-jsx"
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "**/*.spec.ts", "jest.config.ts"]