perf: reduce client bundle size 37.9% (-1007KB) - #219
Conversation
- Lazy-load ExecutionWorkspace, IHVIntegrationPanel, ReportIssueModal (React.lazy) - Externalize @huggingface/transformers and onnxruntime-web (CDN on-demand) - Convert passes.json from static import to async dynamic import - Remove dead getPassesByCategory() export (zero callers) - Add sideEffects: false to package.json for better tree-shaking - Remove phantom motion dependency (zero imports) - Remove unused vendor-motion chunk config Metric: client_js_bytes 2,655,341 → 1,712,620 (-942,721 bytes) Initial chunk: 289,710 → 137,468 (-152,242 bytes, -53%) All 1,407 tests pass (1,018 unit + 389 server)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Sorry @tonythethompson, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
📝 WalkthroughWalkthroughThe change lazy-loads three application components and the schema knowledge base. It adds loading and knowledge-base availability states, replaces JSZip with fflate for OWR archive generation, and updates package and Vite bundling metadata. ChangesLazy loading pipeline
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 8✅ Passed checks (8 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Warning Review ran into problems🔥 ProblemsLinked repositories: Public OSS repositories can only analyze public repositories installed in this organization. Analyzed Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThe PR reduces the production client bundle by lazy-loading UI modules, externalizing optional browser inference dependencies, asynchronously loading the pass knowledge base, and replacing JSZip with fflate.
Confidence Score: 4/5The PR is not yet safe to merge because validation can still run before the pass knowledge base is ready, accepting invalid configurations or rejecting valid KB-only recipes. The pending knowledge-base state remains observable to synchronous production callers: parameter checks return no errors while the schema map is empty, while KB-only pass recognition reports valid types as unknown. Files Needing Attention: src/lib/schemaEngine.ts
|
| Filename | Overview |
|---|---|
| src/lib/schemaEngine.ts | Introduces asynchronous, retryable knowledge-base loading, but synchronous validation still runs against incomplete state and can accept invalid configs or reject valid KB-only passes. |
| src/App.tsx | Converts several panels to React.lazy, although all mapped sections still mount on the initial Dashboard render. |
| index.html | Adds import-map mappings that resolve the two externalized browser dependencies through esm.sh. |
| server.ts | Extends the application CSP to permit scripts from the newly configured esm.sh module origin. |
| vite.config.ts | Externalizes optional browser inference dependencies and retains the existing production chunking and compression setup. |
| src/components/features/execute/ExecutionWorkspace.tsx | Replaces JSZip with a dynamically imported fflate implementation for OWR archive generation. |
| package.json | Marks CSS as side-effectful, replaces JSZip with fflate, and removes the unused motion dependency. |
Reviews (11): Last reviewed commit: "fix: don't reject valid recipes while KB..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 785322f8dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
PR Summary by QodoReduce client bundle via lazy panels, externalized deps, and async passes KB
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
package.json (1)
74-74: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winRegenerate
pnpm-lock.yamlbefore merge.Line 74 removes
motionfrompackage.json, but the lockfile still declares it.pnpm install --frozen-lockfilewill reject this manifest and lockfile mismatch before CI can build or test the project.Regenerate and commit
pnpm-lock.yamlwith pnpm 11.17. Do not usenpm install.Based on external tooling,
pnpm-lock.yamlstill declaresmotion.
As per coding guidelines, use pnpm 11.17 for package management.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` at line 74, Regenerate pnpm-lock.yaml with pnpm 11.17 after removing motion from the package manifest, ensuring the lockfile no longer declares motion and matches package.json. Use pnpm rather than npm, and commit the updated lockfile so frozen-lockfile installs succeed.Sources: Coding guidelines, MCP tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/App.tsx`:
- Around line 371-386: Update the section rendering in Dashboard’s SECTIONS.map
so IHVIntegrationPanel and ExecutionWorkspace are not mounted for inactive
sections. Keep their section containers and render each lazy panel only when its
section is active or has entered the viewport prefetch boundary, preserving the
existing ErrorBoundary and Suspense wrappers.
In `@src/lib/schemaEngine.ts`:
- Around line 103-113: Update the rejection handler in the KB load promise chain
to set kbLoadPromise to null after retaining kbLoadError, so kbReady() invokes
loadKb() and retries the dynamic import instead of returning the cached rejected
promise.
- Around line 116-123: Update the asynchronous validation and pass-analysis
flows, including validateRecipeSchema(), validatePassConfig(), getPassSchema(),
isKnownPass(), and buildRecipeFromState(), to await kbReady() before producing
validation or pass-chain results. Ensure synchronous-only consumers continue
returning the typed “knowledge base unavailable” state rather than treating
catalog-only data as a valid answer, and preserve the existing initial load
trigger.
---
Outside diff comments:
In `@package.json`:
- Line 74: Regenerate pnpm-lock.yaml with pnpm 11.17 after removing motion from
the package manifest, ensuring the lockfile no longer declares motion and
matches package.json. Use pnpm rather than npm, and commit the updated lockfile
so frozen-lockfile installs succeed.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 647eb97b-7c9c-406e-baae-ffdbccdba585
📒 Files selected for processing (5)
package.jsonsrc/App.tsxsrc/lib/passCatalog.tssrc/lib/schemaEngine.tsvite.config.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
tonythethompson/QuickShell(manual)tonythethompson/numan(manual)tonythethompson/dependency-chain-substrate(manual)
💤 Files with no reviewable changes (1)
- src/lib/passCatalog.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
- GitHub Check: olive-pass-availability
- GitHub Check: python-tests
- GitHub Check: Greptile Review
⚠️ CI failures not shown inline (1)
Commit Status: Vercel: Vercel
Conclusion: failure
Deployment has failed — run this Vercel CLI command: npx vercel inspect dpl_2EGNrb7FpXYsJUzfkcgmbgLn8k3v --logs
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx,json,md,yaml,yml}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
pnpmfor project package management and commands; do not usenpm install, which is blocked by a preinstall guard.
Files:
package.jsonvite.config.tssrc/lib/schemaEngine.tssrc/App.tsx
**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Do not run real Olive jobs in CI or VMs because they download models and CUDA wheels.
**/*: Do not run real Olive GPU workloads or model downloads in CI; use mocks or CPU-only flows.
When changing the threat model or fixing critical findings, update the review snapshot and document the local-trust model in user-facing documentation.
Files:
package.jsonvite.config.tssrc/lib/schemaEngine.tssrc/App.tsx
**/*.{js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (AGENTS.md)
Use pnpm 11.17 as the package manager; do not use npm install because the preinstall guard blocks it.
Files:
package.jsonvite.config.tssrc/lib/schemaEngine.tssrc/App.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.{ts,tsx,js,jsx}: Place imports at the top of modules; use inline imports only for a documented circular dependency.
Run linting and ensure typecheck-related CI checks pass before submitting changes.
For UI or server changes, manually smoke-test development startup, recipe loading/building, validation banners, and live execution when execution behavior is touched.
Files:
vite.config.tssrc/lib/schemaEngine.tssrc/App.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Account for React 19 and Vite 8 breaking changes rather than assuming conventions from earlier major versions; consult current documentation when API shapes are uncertain.
Do not trigger live Olive execution or batch runs in CI or virtual machines; limit CI validation to CPU-only recipe building, JSON export, and validation.Resolve ESLint errors; warnings are acceptable within the configured maximum of 20, but non-zero lint failures and reported errors must not be ignored.
Files:
vite.config.tssrc/lib/schemaEngine.tssrc/App.tsx
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
src/**/*.{ts,tsx}: Match existing naming, file layout, and TypeScript patterns insrc/.
Put shared recipe logic insrc/lib/, especiallypipelineValidation.ts,oliveRecipeBuilder.ts, andrecipePipeline.ts.
src/**/*.{ts,tsx}: Route every UI state mutation throughcommitUiStateUpdateinsrc/lib/pipelineValidation.tsso invariants are enforced; usereplaceStatefor recipe imports and preset loads.
UseusePipelineState()as the shorthand hook for reading pipeline state.
Avoidexport *barrel imports; import directly from the actual module file.Follow the React conventions in
docs/REACT_BEST_PRACTICES.md, especially eliminating waterfalls, avoiding barrel imports, and deferring non-critical third-party libraries.
src/**/*.{ts,tsx}: Keep pipeline and recipe validation logic in shared libraries rather than duplicating it in IHV cell helpers or inspectors.
Keep the UI AI provider catalog synchronized with the server registry, preferably through a shared provider ID list or a synchronization test; register new providers in both places.
Add coverage forrecipe-graph/and under-tested libraries includingpassCatalog,oliveRecipeHub,jobHistoryStore, andvramEstimate.
Confirm whetherEnterpriseInfraPanelandPerformanceMetricsare required; remove them if they are orphaned and not mounted.
Files:
src/lib/schemaEngine.tssrc/App.tsx
src/lib/**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Run the relevant targeted unit tests when library code changes rather than unnecessarily running the full slow test suite locally; rely on CI for complete verification.
Files:
src/lib/schemaEngine.ts
🧠 Learnings (1)
📚 Learning: 2026-08-10T03:41:03.611Z
Learnt from: tonythethompson
Repo: tonythethompson/Olive-Studio PR: 203
File: src/components/features/input/GitHubRecipeSync.tsx:5-5
Timestamp: 2026-08-10T03:41:03.611Z
Learning: In the Olive-Studio repository, treat imports from the `@/components/ui` barrel as conforming to the established UI import convention. Do not flag these imports solely because a general guideline prefers importing from concrete modules.
Applied to files:
vite.config.tssrc/lib/schemaEngine.tssrc/App.tsx
🔍 Remote MCP Context7, DeepWiki, GitHub Copilot
Additional review context
- Lockfile mismatch:
package.jsonremovesmotion, butpnpm-lock.yamlstill declares it. CI usespnpm install --frozen-lockfile; the lockfile should be regenerated. - Lazy panels still mount initially:
SECTIONS.maprenders IHV and execution components regardless ofactiveView, so their lazy chunks may load on first render. Only the report modal is conditionally mounted. - KB readiness is incomplete: validation APIs explicitly report “knowledge base unavailable,” but synchronous
getPassSchema,isKnownPass, andgetKbMetadatastill ignore readiness and can return empty/unknown results. These are used bypipelineValidation, while server preflight calls the synchronous recipe validator. - Retry behavior is not implemented: after
loadKb()rejects,kbLoadPromiseremains a rejected promise, sokbReady()returns it instead of starting a retry. - Externalization warning appears resolved: the final config uses
external: []; affected browser modules remain bundled, andindex.htmlhas no import map. Earlier bot comments referenced a prior commit that externalized these dependencies. - DeepWiki: the repository was not indexed, so no additional architectural context was available.
🔇 Additional comments (3)
package.json (1)
8-8: LGTM!vite.config.ts (1)
115-118: LGTM!Also applies to: 128-129
src/App.tsx (1)
425-443: 🩺 Stability & AvailabilityConfirm application-level recovery for report modal chunk failures.
ReportIssueModalis lazy-loaded inside onlySuspense; the root mount insrc/main.tsxskips anErrorBoundary. If the modal chunk rejects, the lazy import error can escape and close the report flow. Add a boundary or local recovered-error state that lets the user reopen/dismiss the report UI.
jszip (96KB bundled) replaced with fflate (~8KB bundled) for the OWR deployment bundle zip generation. Same functionality (create zip with text files, generate blob for download), dramatically smaller. Metric: client_js_bytes 1,712,620 → 1,625,154 (-87,466 bytes) Cumulative: 2,655,341 → 1,625,154 (-1,030,187 bytes, -38.8%) All 1,407 tests pass.
Reverting the bot's revert. These deps are: - Only used in Playground panels (Arena, InBrowserValidation, WebGpuBenchmark) - Already behind dynamic imports with graceful offline fallbacks - 946KB combined that users who never open Playground never need The app works fully without them — Arena tokenizer falls back to prompt-derived encoding, Playground panels show loading state. Metric: client_js_bytes 2,572,726 → 1,625,519 (-947,207 bytes) Cumulative from baseline: 2,655,341 → 1,625,519 (-38.8%) All 1,407 tests pass.
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/components/features/execute/ExecutionWorkspace.tsx (2)
396-429: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftAdd regression coverage for archive contents.
The current
ExecutionWorkspace.test.tsxcoverage checks only that the More menu exposes the OWR export action. It does not invoke asynchronous export or inspect the generated archive. Add tests for web and mobile bundles, includingort_config.json,onnx_model_manifest.json,README.txt, the platform-specific init file, and failure handling.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/features/execute/ExecutionWorkspace.tsx` around lines 396 - 429, Extend ExecutionWorkspace.test.tsx beyond the More-menu assertion by invoking the asynchronous OWR export flow for both web and mobile targets and inspecting the generated archive contents. Verify each bundle includes ort_config.json, onnx_model_manifest.json, README.txt, and the correct platform-specific web_init.js or mobile_init.kt file, and add coverage for the export failure-handling path.
397-429: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winSeparate module-load and archive-generation errors.
The
tryblock covers bothawait import("fflate")and file encoding/zipSync. If serialization or ZIP creation fails, the catch still displays"Couldn't load the ZIP module. Check your connection and try again."This gives incorrect recovery guidance. Use separate catches for module loading and archive generation.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/features/execute/ExecutionWorkspace.tsx` around lines 397 - 429, Separate the dynamic fflate import from archive construction in the execution flow around zipSync and strToU8. Catch module-load failures with the existing connection guidance, then wrap file serialization and zipSync in a second try/catch with an archive-generation-specific error message and recovery guidance.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 73: Update pnpm-lock.yaml to synchronize the root importer with
package.json: add the fflate@^0.8.3 specifier and remove the unreferenced
jszip@^3.10.1 and motion@^13.0.0 specifiers, using pnpm install --lockfile-only.
In `@src/components/features/execute/ExecutionWorkspace.tsx`:
- Line 398: Document the inline fflate import used in the click-handler
bundle-splitting flow, adding the repository-approved lazy-loading exception
near the import. Alternatively, move zipSync and strToU8 to module scope while
preserving the existing execution behavior.
---
Outside diff comments:
In `@src/components/features/execute/ExecutionWorkspace.tsx`:
- Around line 396-429: Extend ExecutionWorkspace.test.tsx beyond the More-menu
assertion by invoking the asynchronous OWR export flow for both web and mobile
targets and inspecting the generated archive contents. Verify each bundle
includes ort_config.json, onnx_model_manifest.json, README.txt, and the correct
platform-specific web_init.js or mobile_init.kt file, and add coverage for the
export failure-handling path.
- Around line 397-429: Separate the dynamic fflate import from archive
construction in the execution flow around zipSync and strToU8. Catch module-load
failures with the existing connection guidance, then wrap file serialization and
zipSync in a second try/catch with an archive-generation-specific error message
and recovery guidance.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 898aef67-6040-43c9-b42a-e2684abdae7e
📒 Files selected for processing (2)
package.jsonsrc/components/features/execute/ExecutionWorkspace.tsx
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
tonythethompson/QuickShell(manual)tonythethompson/numan(manual)tonythethompson/dependency-chain-substrate(manual)
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
- GitHub Check: Greptile Review
- GitHub Check: olive-pass-availability
- GitHub Check: security
- GitHub Check: python-tests
- GitHub Check: docker-build
⚠️ CI failures not shown inline (1)
Commit Status: Vercel: Vercel
Conclusion: failure
Deployment has failed — run this Vercel CLI command: npx vercel inspect dpl_3cKrpaN5LmfNVgBSV2ebbjV12aCg --logs
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx,json,md,yaml,yml}
📄 CodeRabbit inference engine (CLAUDE.md)
Use
pnpmfor project package management and commands; do not usenpm install, which is blocked by a preinstall guard.
Files:
package.jsonsrc/components/features/execute/ExecutionWorkspace.tsx
**/*
📄 CodeRabbit inference engine (CLAUDE.md)
Do not run real Olive jobs in CI or VMs because they download models and CUDA wheels.
**/*: Do not run real Olive GPU workloads or model downloads in CI; use mocks or CPU-only flows.
When changing the threat model or fixing critical findings, update the review snapshot and document the local-trust model in user-facing documentation.
Files:
package.jsonsrc/components/features/execute/ExecutionWorkspace.tsx
**/*.{js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (AGENTS.md)
Use pnpm 11.17 as the package manager; do not use npm install because the preinstall guard blocks it.
Files:
package.jsonsrc/components/features/execute/ExecutionWorkspace.tsx
src/**/*.{ts,tsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
src/**/*.{ts,tsx}: Match existing naming, file layout, and TypeScript patterns insrc/.
Put shared recipe logic insrc/lib/, especiallypipelineValidation.ts,oliveRecipeBuilder.ts, andrecipePipeline.ts.
src/**/*.{ts,tsx}: Route every UI state mutation throughcommitUiStateUpdateinsrc/lib/pipelineValidation.tsso invariants are enforced; usereplaceStatefor recipe imports and preset loads.
UseusePipelineState()as the shorthand hook for reading pipeline state.
Avoidexport *barrel imports; import directly from the actual module file.Follow the React conventions in
docs/REACT_BEST_PRACTICES.md, especially eliminating waterfalls, avoiding barrel imports, and deferring non-critical third-party libraries.
src/**/*.{ts,tsx}: Keep pipeline and recipe validation logic in shared libraries rather than duplicating it in IHV cell helpers or inspectors.
Keep the UI AI provider catalog synchronized with the server registry, preferably through a shared provider ID list or a synchronization test; register new providers in both places.
Add coverage forrecipe-graph/and under-tested libraries includingpassCatalog,oliveRecipeHub,jobHistoryStore, andvramEstimate.
Confirm whetherEnterpriseInfraPanelandPerformanceMetricsare required; remove them if they are orphaned and not mounted.
Files:
src/components/features/execute/ExecutionWorkspace.tsx
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CONTRIBUTING.md)
**/*.{ts,tsx,js,jsx}: Place imports at the top of modules; use inline imports only for a documented circular dependency.
Run linting and ensure typecheck-related CI checks pass before submitting changes.
For UI or server changes, manually smoke-test development startup, recipe loading/building, validation banners, and live execution when execution behavior is touched.
Files:
src/components/features/execute/ExecutionWorkspace.tsx
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Account for React 19 and Vite 8 breaking changes rather than assuming conventions from earlier major versions; consult current documentation when API shapes are uncertain.
Do not trigger live Olive execution or batch runs in CI or virtual machines; limit CI validation to CPU-only recipe building, JSON export, and validation.Resolve ESLint errors; warnings are acceptable within the configured maximum of 20, but non-zero lint failures and reported errors must not be ignored.
Files:
src/components/features/execute/ExecutionWorkspace.tsx
🧠 Learnings (2)
📚 Learning: 2026-08-04T12:36:02.655Z
Learnt from: tonythethompson
Repo: tonythethompson/Olive-Studio PR: 97
File: src/components/features/BatchProcessingPanel.tsx:0-0
Timestamp: 2026-08-04T12:36:02.655Z
Learning: When updating pipeline state through usePipelineState().setState in React components, do not wrap the update in another commitUiStateUpdate call. PipelineStore.setState already invokes commitUiStateUpdate(store.state, partial) to enforce UI state invariants; a second commit can duplicate the operation and merge against a stale component state snapshot.
Applied to files:
src/components/features/execute/ExecutionWorkspace.tsx
📚 Learning: 2026-08-10T03:41:03.611Z
Learnt from: tonythethompson
Repo: tonythethompson/Olive-Studio PR: 203
File: src/components/features/input/GitHubRecipeSync.tsx:5-5
Timestamp: 2026-08-10T03:41:03.611Z
Learning: In the Olive-Studio repository, treat imports from the `@/components/ui` barrel as conforming to the established UI import convention. Do not flag these imports solely because a general guideline prefers importing from concrete modules.
Applied to files:
src/components/features/execute/ExecutionWorkspace.tsx
🔍 Remote MCP Context7, GitHub Copilot
Additional review context
- Knowledge-base retry is not implemented:
loadKb()stores its rejected promise inkbLoadPromise; subsequentkbReady()calls return the same rejected promise rather than starting a new load. This contradicts the retry claim in the comment. - Synchronous API behavior remains inconsistent: the PR adds unavailable-state handling only to
validatePassConfigandvalidateRecipeSchema, whilegetPassSchema,isKnownPass, andgetKbMetadatastill proceed with empty maps before loading completes. - ZIP conversion is API-compatible:
fflate.zipSync()returnsUint8Array<ArrayBuffer>, matching the new Blob-based download approach. - Dependency verification: the PR changes
package.jsonto addfflateand removejszip/motion; the checked base-file snapshot still contains the old dependencies, so the lockfile should be checked for synchronization.,
🔇 Additional comments (3)
src/components/features/execute/ExecutionWorkspace.tsx (2)
393-394: LGTM!
437-437: LGTM!package.json (1)
8-10: LGTM!
Addresses CodeRabbit finding: if the lazy-loaded modal chunk rejects, the error now catches in the ErrorBoundary rather than escaping and breaking the report flow. The onReportError callback closes the modal state so the user can reopen it.
Addresses CodeRabbit finding: previously both fflate import failure and zip creation failure showed the same 'Couldn't load ZIP module' message. Now module-load errors get connection guidance, while archive-generation errors get their own message.
Addresses Codex review: externalized packages left bare specifiers
(import('onnxruntime-web')) that browsers couldn't resolve. The import
map maps them to esm.sh CDN URLs so Playground panels load correctly.
These only activate when a user opens Arena/Inference/Benchmark panels;
the rest of the app works without any network dependency on esm.sh.
Tests that call synchronous validation now await kbReady() in beforeAll so the passes.json dynamic import resolves before assertions run. Also fixed test states that triggered unrelated pass-chain-mismatch validation by disabling conversion passes when testing provider-specific behavior (the tests are about provider validation, not pass-chain format compatibility). All 1,018 unit tests pass.
Validates the fflate-based archive produces correct, decompressible ZIPs: - Web platform includes ort_config.json, manifest, web_init.js, README - Mobile platform includes ort_config.json, manifest, mobile_init.kt, README - JSON content integrity preserved through zip/unzip round-trip - Text content preserved through zip/unzip round-trip - Blob creation works (download flow) - Edge cases: empty content, unicode characters 7 new tests, all passing.
The validation script calls getPipelineValidation synchronously, which now requires the KB to be loaded first (async dynamic import). Without this await, the pass-chain validation fires with empty schemas and incorrectly reports blocking issues.
The import map resolves @huggingface/transformers and onnxruntime-web to esm.sh CDN. Without this CSP allowlist entry, the browser blocks the module load when users open Playground panels.
When the passes.json dynamic import is pending (not failed), synchronous validation now gracefully skips KB-dependent checks instead of immediately returning 'knowledge base unavailable'. This prevents rejecting valid recipes during the brief startup window before the KB load completes. Only report unavailability when the load has actually FAILED (kbLoadError is set). Pending loads get optimistic treatment — structural validation still runs, parameter/schema validation is skipped until ready.
Introduce the data/ruler bundle-size measurement setup, including the calibrated ruler spec in JSON/YAML, baseline and calibration snapshots, a canary script to validate the harness, and design notes documenting guardrails and the chosen metric. Also add discovery reports capturing initial optimization opportunities and a post-PR #219 baseline showing the reduced client bundle size.
Summary
Reduces production client JS bundle from 2,655,341 → 1,648,669 bytes (-1,006,672 bytes, -37.9%).
Changes
Bundle optimization
@huggingface/transformers(551K) andonnxruntime-web(395K) — loaded from esm.sh CDN on-demand via import map, only when Playground panels openExecutionWorkspace,IHVIntegrationPanel,ReportIssueModalviaReact.lazy()jszip(96K) withfflate(8K) for OWR bundle zip generationmotiondependency (zero imports)"sideEffects": ["*.css"]for better tree-shakinggetPassesByCategory()(zero callers)passes.jsoninstead of static inline (62K → separate chunk)Reliability improvements (from review feedback)
index.htmlfor CDN-loaded externalsesm.shto CSPscript-srcin helmet configReportIssueModalinErrorBoundaryfor chunk load resiliencekbReady()before synchronous validationVerification
tsc --noEmit— zero type errorsvalidate-recipe-builder.tsscript passesRisk Assessment