Skip to content

Update frontend to next 16 - #128

Merged
sergiosja merged 6 commits into
mainfrom
update-frontend-to-next-16
Mar 19, 2026
Merged

Update frontend to next 16#128
sergiosja merged 6 commits into
mainfrom
update-frontend-to-next-16

Conversation

@stianjsu

Copy link
Copy Markdown
Collaborator

Update the Next.js frontend from v13 to v16, bump Node.js from 20 to 24, and modernize the surrounding toolchain (ESLint 9 flat config, stricter TypeScript, latest dependency versions). Also fixes cookie forwarding for the login flow and corrects optimistic-update bugs in the API hooks.

Loooots of things were deprecated and had tons of sec vuln. Heroku would not deploy

Key additions

  • Next.js 13 → 16 — all next/image usages updated with explicit style={{ maxWidth: '100%', height: 'auto' }} to match the new image optimization defaults
  • Node.js 20 → 24 — Docker dev image and engines field updated
  • ESLint flat config — migrated from .eslintrc.json to eslint.config.mjs with ESLint 9; dropped @typescript-eslint/eslint-plugin in favor of eslint-config-next/typescript; disabled new React Compiler lint rules (react-hooks/purity, react-hooks/set-state-in-effect, react-hooks/refs) that don't apply yet
  • TypeScriptjsx changed from "preserve" to "react-jsx" for Next 16 compatibility; formatting normalized to 2-space indent
  • CSRF / cookie fix — login callback now uses getSetCookie() to forward multiple Set-Cookie headers (auth + CSRF token) instead of collapsing them with get('set-cookie')
  • API hook fixesuseEvents.createEvent now types the response as ApiEvent instead of ApiEventPost; useRestaurants.createRestaurant uses the server response for optimistic cache update instead of the local input object
  • Dependency bumps — TypeScript 5.1 → 5.9, Tailwind 3.3 → 3.4, Prettier 3.0 → 3.8, autoprefixer/postcss pinned → caret ranges, and ~40 transitive dependency updates

How Has This Been Tested?

  • npm run build — production build passes with the new Next.js version
  • npm run lint — ESLint 9 flat config lints cleanly with zero warnings
  • npm run typecheck — TypeScript strict mode passes with the updated tsconfig.json

- Changed Node.js engine requirement from ">=20.x" to "24.x".
- Upgraded Next.js from "13.4.13" to "^16.0.10".
- Updated PostCSS from "8.4.27" to "^8.5.8".
- Adjusted TypeScript configuration to use "react-jsx" for JSX transformation.
@stianjsu
stianjsu requested a review from sergiosja March 18, 2026 23:02
@sergiosja
sergiosja merged commit 08d001b into main Mar 19, 2026
3 checks passed
@sergiosja
sergiosja deleted the update-frontend-to-next-16 branch March 19, 2026 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants