Skip to content

Migrate MyApp.Client to the Vite+ (VoidZero) toolchain - #8

Merged
mythz merged 4 commits into
mainfrom
voidzero
Oct 31, 2026
Merged

mythz merged 4 commits into
mainfrom
voidzero

Conversation

@mythz

@mythz mythz commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Migrates MyApp.Client from Vite 7 + ESLint + tsc to Vite+ (vite-plus 1.4.0): Vite 8 (Rolldown), Vitest 5, Oxlint (type-aware, via tsgolint) and Oxfmt, all configured in vite.config.ts. Follows the same approach as the react-static migration.

npm scripts stay the entry points used by .NET (npm run dev / npm run build), so a global vp install isn't required.

Commits

  1. Migrate MyApp.Client to the Vite+ toolchain
    • vite-plus pinned, with npm overrides mapping vite → @voidzero-dev/vite-plus-core; package-lock.json committed
    • Scripts: dev, build, preview, check, lint, fmt, test, test:run, test:ui
    • Lint rules ported from .eslintrc.cjs, which ESLint 9 couldn't load, so lint hadn't been running. typescript/no-explicit-any is a warning because the markdown/press components use any throughout
    • Removed the ESLint config and packages, the duplicate PostCSS config, the stale Vite README and postinstall.mjs (empty databases are already migrated on app startup)
    • Seed tests added (utils, gateway, HelloApi)
    • Upgraded only the majors the toolchain needs: TypeScript 7, @vitejs/plugin-react 6, vite-plugin-svgr 5. react-router, @tanstack/react-table and lucide-react stay on their current majors
  2. Format MyApp.Client with Oxfmt: formatting only, listed in .git-blame-ignore-revs
  3. Update CI and docs for Vite+, add VS Code workspace
    • build.yml: new client job (vp check, vp test run, vp build)
    • build-container.yml: voidzero-dev/setup-vp replaces setup-node + npm install
    • AGENTS.md / README.md: Vite+ commands; dtos.ts is regenerated on .NET startup, so npm run dtos is rarely needed
    • MyApp.code-workspace: makes MyApp.Client its own root so the Oxc extension resolves the local vite-plus

Bugs fixed (found by the new lint rules)

  • LiteYouTube added &undefined to YouTube embed URLs when params wasn't set
  • The markdown Include component recreated its lazy() component on every render; it's now cached per src
  • Missing React keys in the blog tag and year lists
  • rules-of-hooks fixes in lib/auth.tsx (no behaviour change; the shared appAuth() API keeps its name)

Verification

  • npm ci, npm run check (0 errors), npm run test:run (6 tests), npm run build
  • MDX, vite-plugin-pages, vite-plugin-press and svgr build and run on Vite 8 / Rolldown
  • dotnet run against an empty DB: "Empty database detected" bootstrap, and "DTO generation complete"
  • Dev at https://localhost:5001: pages render, /api calls work, Vite HMR connects through the .NET proxy and applies component edits without a full reload
  • dotnet publish -c Release copies dist into wwwroot
  • CI green on this PR

Notes

  • Rolldown chunks differently: the main chunk went from 870 to 612 kB (dtos is split into its own chunk), and total dist went from 3.0 to 3.2 MB
  • MyApp.Client.esproj still lists Jest as JavaScriptTestFramework, same as react-static
  • Unused deps were left as-is for a later cleanup: tailwindcss-animate, gray-matter, classnames, @types/react-helmet

🤖 Generated with Claude Code

mythz and others added 4 commits October 31, 2026 22:51
Replace Vite 7 + ESLint + tsc with Vite+ (vite-plus 1.4.0): Vite 8 (Rolldown),
Vitest 5, Oxlint (type-aware, via tsgolint) and Oxfmt, configured in one
vite.config.ts. npm scripts stay the entry points for the .NET build/dev
integration, so no global `vp` install is required.

- vite-plus pinned with npm overrides for vite -> @voidzero-dev/vite-plus-core
- lint rules ported from .eslintrc.cjs (which ESLint 9 could not load);
  no-explicit-any is a warning as the markdown/press components use `any`
- `npm run check` replaces `tsc` in the build
- remove ESLint config + packages, duplicate PostCSS config, stale Vite
  README and postinstall.mjs (empty DBs are migrated on app startup)
- add test scripts and seed tests (utils, gateway, HelloApi)
- fix lint findings: rules-of-hooks in lib/auth.tsx (keeping the shared
  appAuth() API), missing keys, useless regex escapes, `&undefined` in
  LiteYouTube URLs, and Include recreating its lazy component every render
- upgrade deps within majors, plus TypeScript 7, @vitejs/plugin-react 6
  and vite-plugin-svgr 5

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- build.yml: new client job (vp check, vp test run, vp build)
- build-container.yml: voidzero-dev/setup-vp replaces setup-node + npm install
- AGENTS.md / README.md: Vite+ commands; dtos.ts is regenerated on .NET
  startup, so `npm run dtos` is typically never needed
- MyApp.code-workspace: adds MyApp.Client as its own root so the Oxc
  extension resolves the local vite-plus; TypeScript 7 language server
- .git-blame-ignore-revs: ignore the Oxfmt formatting commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mythz
mythz merged commit 20b7aa6 into main Oct 31, 2026
4 checks passed
@mythz
mythz deleted the voidzero branch October 31, 2026 15:31
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