[PR #1756] [MERGED] Add explicit Vite vendor chunk policy #5264

Closed
opened 2026-10-22 04:14:43 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1756
Author: @cha1latte
Created: 5/31/2026
Status: ✅ Merged
Merged: 5/31/2026
Merged by: @cha1latte

Base: refactor ← Head: feat/issue-1577-vite-manual-chunks


📝 Commits (1)

  • 8294958 Add Vite manual vendor chunk policy

📊 Changes

1 file changed (+32 additions, -3 deletions)

View changed files

📝 vite.config.ts (+32 -3)

📄 Description

Linked issue

Closes #1577

Why this change

  • Split stable framework/vendor code out of the startup entry so Vite chunk warnings are meaningful again and future startup leakage is easier to spot.

What changed

  • Added an explicit function-based manualChunks policy for React, runtime utilities, UI support libraries, and Tauri helper packages.
  • Lowered the Vite chunk warning limit to 650 with an inline note that the largest remaining JS chunk is lazy Game mode route code.

Refactor impact

Primary owner:

  • app shell / build tooling

Impact areas reviewed:

  • Vite production bundle output
  • startup entry chunk size
  • lazy Game mode route chunk size
  • existing Tauri/Vite asset pipeline assumptions

Boundary notes:

  • No runtime API, engine, shared API, Rust, schema, storage, or user-facing behavior changes.
  • The policy only groups selected packages from node_modules; it does not add a broad vendor fallback or pull lucide-react into a shared startup chunk.

Pressure points touched:

  • Vite build output only.
  • GameSurface remains a lazy route chunk.

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • pnpm check passes locally before PR push/handoff, including the unused-code check
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Browser screenshot/recording evidence added when UI/browser state is the claim
  • Remote runtime smoke checked when relevant

Manual verification notes

  • pnpm build passed and emitted explicit vendor-react, vendor-runtime, vendor-ui, and vendor-tauri chunks.
  • Largest observed JS chunks after the policy: startup index about 270.63 kB; lazy GameSurface about 640.63 kB.
  • pnpm check passed locally.
  • pnpm test:ui:run tests/e2e/app.spec.ts passed locally.
  • Tauri desktop smoke was not run in this agent session.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

No UI changes.

Summary by CodeRabbit

  • Chores
    • Updated build configuration to optimize dependency bundling and improve chunk size management for enhanced application distribution efficiency.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/1756 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/31/2026 **Status:** ✅ Merged **Merged:** 5/31/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `feat/issue-1577-vite-manual-chunks` --- ### 📝 Commits (1) - [`8294958`](https://github.com/Pasta-Devs/Marinara-Engine/commit/82949585fba52bd0451e8a4cdee3162f6ca67567) Add Vite manual vendor chunk policy ### 📊 Changes **1 file changed** (+32 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `vite.config.ts` (+32 -3) </details> ### 📄 Description ## Linked issue Closes #1577 ## Why this change - Split stable framework/vendor code out of the startup entry so Vite chunk warnings are meaningful again and future startup leakage is easier to spot. ## What changed - Added an explicit function-based `manualChunks` policy for React, runtime utilities, UI support libraries, and Tauri helper packages. - Lowered the Vite chunk warning limit to `650` with an inline note that the largest remaining JS chunk is lazy Game mode route code. ## Refactor impact Primary owner: - app shell / build tooling Impact areas reviewed: - Vite production bundle output - startup entry chunk size - lazy Game mode route chunk size - existing Tauri/Vite asset pipeline assumptions Boundary notes: - No runtime API, engine, shared API, Rust, schema, storage, or user-facing behavior changes. - The policy only groups selected packages from `node_modules`; it does not add a broad vendor fallback or pull `lucide-react` into a shared startup chunk. Pressure points touched: - Vite build output only. - `GameSurface` remains a lazy route chunk. ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] `pnpm check` passes locally before PR push/handoff, including the unused-code check - [ ] `pnpm typecheck` passes locally - [ ] `pnpm build` passes locally - [ ] `pnpm check:architecture` passes locally - [ ] `pnpm check:docs` passes locally - [ ] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [ ] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Browser screenshot/recording evidence added when UI/browser state is the claim - [ ] Remote runtime smoke checked when relevant ### Manual verification notes - `pnpm build` passed and emitted explicit `vendor-react`, `vendor-runtime`, `vendor-ui`, and `vendor-tauri` chunks. - Largest observed JS chunks after the policy: startup `index` about `270.63 kB`; lazy `GameSurface` about `640.63 kB`. - `pnpm check` passed locally. - `pnpm test:ui:run tests/e2e/app.spec.ts` passed locally. - Tauri desktop smoke was not run in this agent session. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence No UI changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated build configuration to optimize dependency bundling and improve chunk size management for enhanced application distribution efficiency. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:14:43 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5264
No description provided.