Skip to content

chore(deps): upgrade build/test majors (Vite 8, Vitest 4, plugin-react 6, jsdom 29)#153

Merged
stid merged 1 commit into
masterfrom
chore/deps-major-build-test
May 23, 2026
Merged

chore(deps): upgrade build/test majors (Vite 8, Vitest 4, plugin-react 6, jsdom 29)#153
stid merged 1 commit into
masterfrom
chore/deps-major-build-test

Conversation

@stid

@stid stid commented May 23, 2026

Copy link
Copy Markdown
Owner

What

TS Tier B — the build/test toolchain majors. The final tier of the major-upgrade effort. Each major needed a real migration fix; several only surfaced via yarn build or a browser smoke test (not the unit suite).

Bumped + migration fixes

  • vite 7.3 → 8.0 — Vite 8 bundles with Rolldown, which rejects the object form of output.manualChunks. Converted to the function form (groups React runtime + scheduler into react-vendor). terser minify still supported.
  • @vitejs/plugin-react 4 → 6 (required by vite 8's peer range)
  • vitest 3 → 4 + @vitest/ui 4:
    • removed minWorkers (deprecated option removed in v4)
    • vitest-setup.ts: ResizeObserver mock switched from arrow → function impl — v4 requires constructor mocks be function/class, so new ResizeObserver() in components broke (20 tests)
    • useWorkerState test: v4 types vi.fn() strictly; gave the shared mocks explicit Mock<Fn> signatures
  • jsdom 26 → 29getComputedStyle no longer surfaces the inherit keyword; AddressLink's style check reads the inline style object for the inherit values

Verification

  • yarn test:ci: 685 pass / 18 skipped, lint + type-check clean
  • yarn build: production build succeeds (Vite 8 + Rolldown) — WASM + Comlink worker + react-vendor chunk all emitted
  • Browser smoke test (yarn dev): app renders, Comlink worker boots, emulator initializes, video subscription succeeds, zero console errors

Deferred (unchanged)

  • Tailwind 3→4 + cssnano 7→8 (design-system rewrite)
  • ESLint 10 (blocked on eslint-plugin-react upstream)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores

    • Upgraded development dependencies including build tools and testing frameworks for improved development experience and application performance.
    • Optimized application bundle chunking configuration.
    • Version bumped to 4.42.6.
  • Tests

    • Updated test infrastructure and environment configurations to support latest testing framework updates.

Review Change Stack

…t 6, jsdom 29)

TS Tier B of the major-upgrade effort — the build/test toolchain. Each major
required a real migration fix (tests + a production build don't overlap, so
several only surfaced via `yarn build` / a browser smoke test):

- vite 7.3 -> 8.0: Vite 8 bundles with Rolldown, which rejects the object
  form of `output.manualChunks`. Converted to the function form (groups the
  React runtime incl. scheduler into react-vendor). terser minify still works.
- @vitejs/plugin-react 4 -> 6 (required by vite 8 peer range)
- vitest 3 -> 4 + @vitest/ui 4:
    * removed `minWorkers` from vitest.config.ts (deprecated option removed in v4)
    * vitest-setup.ts: ResizeObserver mock must use a `function` impl, not an
      arrow fn — v4 enforces constructor mocks be `function`/`class`, so
      `new ResizeObserver()` in components stopped working (broke 20 tests)
    * useWorkerState test: vi.fn() is strictly typed in v4; gave the shared
      fetcher/subscriber mocks explicit Mock<Fn> signatures
- jsdom 26 -> 29: getComputedStyle no longer surfaces the `inherit` keyword,
  so AddressLink's toHaveStyle check now reads the inline style object for the
  inherit values (display, a concrete value, still uses toHaveStyle)

Verification:
- yarn test:ci: 685 pass / 18 skipped, lint + type-check clean
- yarn build: production build succeeds (Vite 8 + Rolldown), WASM + Comlink
  worker + react-vendor chunk all emitted
- browser smoke test (yarn dev): app renders, Comlink worker boots, emulator
  initializes, video subscription succeeds, ZERO console errors

Completes the major-upgrade effort (Tailwind v4 + ESLint 10 remain deferred).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 23, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9488dc58-2aa9-4d4f-accf-771cab293e25

📥 Commits

Reviewing files that changed from the base of the PR and between f86cf25 and 84605c4.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (7)
  • package.json
  • src/components/__tests__/AddressLink.vitest.test.tsx
  • src/hooks/worker/__tests__/useWorkerState.vitest.test.ts
  • src/test-support/vitest-setup.ts
  • src/version.ts
  • vite.config.ts
  • vitest.config.ts

📝 Walkthrough

Walkthrough

This PR upgrades the build tooling stack to Vite 8 and Vitest 4, updating dependency versions in package.json, refactoring Vite's chunk configuration, adjusting test environment mocks to align with Vitest 4 constructor patterns, and adapting test suites across the codebase for type safety and compatibility.

Changes

Vitest 4 and Vite 8 Upgrade

Layer / File(s) Summary
Dependency Updates
package.json
Core build and test tooling versions upgraded: vite 7.3.2 → 8.0.14, vitest ^3.2.4 → ^4.1.7, @vitejs/plugin-react 4.6.0 → 6.0.2, @vitest/ui ^3.2.4 → ^4.1.7, jsdom ^26.1.0 → ^29.1.1.
Build Configuration Updates
vite.config.ts, vitest.config.ts
Vite's Rollup manualChunks refactored from object form to function form, routing React runtime modules (react, react-dom, scheduler) into a dedicated react-vendor chunk. Vitest worker configuration removes minWorkers setting while retaining maxWorkers: 2.
Test Environment Setup for Vitest 4
src/test-support/vitest-setup.ts
ResizeObserver mock changed to non-arrow function constructor style to comply with Vitest 4 mock requirements; mocked canvas getContext now includes canvas.height property alongside canvas.width.
AddressLink Component Test Compatibility
src/components/__tests__/AddressLink.vitest.test.tsx
Test suite refactored for Vitest 4 compatibility: useDebuggerNavigation mock configuration updated, assertion formatting restructured, and style validation changed from combined toHaveStyle object to individual property checks via toHaveStyle and direct button.style.* access.
useWorkerState Hook Test Compatibility
src/hooks/worker/__tests__/useWorkerState.vitest.test.ts
Vitest 4 type safety improvements: Vitest type Mock imported, FetcherFn and SubscriberFn function types defined, and mockFetcher/mockSubscriber explicitly typed. All behavioral test assertions remain functionally identical; changes confined to typing, imports, and formatting.
Version Bump
src/version.ts
APP_VERSION constant incremented from 4.42.5 to 4.42.6.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • stid/Apple1JS#149: Both PRs overlap on package.json devDependency updates (notably vite) and src/version.ts version increments, representing shared dependency/versioning surfaces.
  • stid/Apple1JS#152: Both PRs address versioning chores touching src/version.ts's APP_VERSION constant and package.json dependency updates, though the main PR additionally introduces Vitest/Vite config and test compatibility changes.

Poem

🐰 Hops of joy as tooling ascends,
Vitest four and Vite eight blend,
Mocks are fixed, configs refined,
Tests now typed with careful mind.
Versions bumped, the upgrade's done,
Building brighter in the sun!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main change: a comprehensive upgrade of major build and test dependencies, specifically naming the key versions (Vite 8, Vitest 4, plugin-react 6, jsdom 29).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/deps-major-build-test

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

vite.config.ts

Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): vite.config.ts

vitest.config.ts

Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): vitest.config.ts


Comment @coderabbitai help to get the list of available commands and usage tips.

@stid stid merged commit 9c74ce1 into master May 23, 2026
8 checks passed
@stid stid deleted the chore/deps-major-build-test branch May 23, 2026 23:29
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.

1 participant