Skip to content

Upgrade frontend to Node 22 and Vite 8 - #287

Merged
kargig merged 1 commit into
mainfrom
feature/vite-8-node-22-upgrade
Oct 25, 2026
Merged

kargig merged 1 commit into
mainfrom
feature/vite-8-node-22-upgrade

Conversation

@kargig

@kargig kargig commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Move the frontend runtime to Node.js 22 LTS and the bundler to Vite 8.3 with Rolldown so builds stay on Active LTS, satisfy modern package engines, and use native code-splitting instead of deprecated Rollup manualChunks.

Align Capacitor CLI/core, Vitest, PWA/SVGR plugins, and related overrides; run e2e scripts on Alpine system Chromium via Playwright; and refresh unit tests for Vitest 5 mock strictness, consent preferences, and DivingCenterDetail tab/ownership UI.

Move the frontend runtime to Node.js 22 LTS and the bundler to Vite
8.3 with Rolldown so builds stay on Active LTS, satisfy modern package
engines, and use native code-splitting instead of deprecated Rollup
manualChunks.

Align Capacitor CLI/core, Vitest, PWA/SVGR plugins, and related
overrides; run e2e scripts on Alpine system Chromium via Playwright;
and refresh unit tests for Vitest 5 mock strictness, consent
preferences, and DivingCenterDetail tab/ownership UI.
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

The resolve.alias for @ was changed from path.resolve(__dirname, './src') to path.resolve(import.meta.dirname, './src'). import.meta.dirname is only available on Node.js 20.11+/21.2+ and only in ESM contexts. If this config is ever loaded through a CJS interop path or an older toolchain, import.meta.dirname is undefined and path.resolve(undefined, ...) throws, breaking the build. Since the PR pins Node 22 this is likely fine, but confirm the config is always evaluated as ESM.

'@': path.resolve(import.meta.dirname, './src'),
Sandbox Disabled

launchChromium unconditionally passes --no-sandbox and --disable-setuid-sandbox for every launch, including any future non-container usage. This is required for Alpine root containers but weakens Chromium's sandbox if these scripts are ever run outside Docker. Consider gating the sandbox flags behind an env var (e.g. only when running as root/in container) rather than always applying them.

args: [
  '--no-sandbox',
  '--disable-setuid-sandbox',
  '--disable-dev-shm-usage',
  ...extraArgs,
],
Brittle Assertion

testDockerfile asserts the exact string FROM node:22-alpine as build / as production. Docker stage names are case-insensitive and the AS keyword casing or spacing may change, so this check can fail on a valid Dockerfile. Prefer a case-insensitive regex like /FROM\s+node:22-alpine\s+as\s+build/i.

if (
  dockerfileContent.includes('FROM node:22-alpine as build') &&
  dockerfileContent.includes('FROM node:22-alpine as production')
) {
  console.log('  ✅ Dockerfile build and production stages use node:22-alpine');
} else {
  console.log('  ❌ Dockerfile does not configure node:22-alpine for build & production');
  return false;
}

@kargig
kargig merged commit 62c964e into main Oct 25, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant