fix frontend dependency resolution and VChart browser mode - #5674
fix frontend dependency resolution and VChart browser mode#5674jiahao-jayden wants to merge 4 commits into
Conversation
WalkthroughAdds conditional VChart browser environment registration modules to both the classic and default web apps, bootstrapped via side-effect imports in each app's entrypoint. The classic app also aliases ChangesVChart and Build Fixes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@web/classic/rsbuild.config.ts`:
- Around line 14-26: The vchartDependencyAliases object uses hardcoded nested
paths via path.join(vchartVisactorDir, name) which assumes a specific directory
structure that may not exist due to package manager hoisting. Instead of
constructing paths relative to vchartVisactorDir, dynamically resolve each
VChart sub-package using require.resolve() for each name in the array, similar
to how the initial `@visactor/vchart` package is resolved. This will ensure the
aliases point to the actual installed locations regardless of hoisting behavior.
🪄 Autofix (Beta)
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: CHILL
Plan: Pro
Run ID: cd00a2ca-3439-4110-8851-d37f4ef917c0
📒 Files selected for processing (1)
web/classic/rsbuild.config.ts
51fdfc5 to
2b6f1df
Compare
Summary
date-fns-tzconsumers todate-fns-v2so the classic build does not resolve against the workspacedate-fns@4options, which is the prop name used by@visactor/react-vchart@1.8; this ensuresmode: 'desktop-browser'reaches the VChart constructor@visactor/vchart@1.8dependency tree, avoiding multiplevrender-corecontainers and preventingcreateCanvasruntime crashesVerification
cd web/default && DISABLE_ESLINT_PLUGIN='true' VITE_REACT_APP_VERSION=codex-pr-test bun run buildcd web && bun install --frozen-lockfilecd web/classic && VITE_REACT_APP_VERSION=codex-pr-test bun run build9709.d7e98865f4.jsbundle to a rebuilt5586.67c0e35701.jsbundle locallySummary by CodeRabbit
Bug Fixes
Chores