-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore(wren-ui): upgrade vega-lite version to align dependent library vega-epression #2078
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughVersion bump of vega-lite dependency from ^5.21.0 to ^6.2.0 in wren-ui/package.json. No code modifications introduced. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
wren-ui/yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (1)
wren-ui/package.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
wren-ui/package.json (1)
95-95: Verify vega-lite v6 compatibility and breaking changes.Vega-lite v6 updates to Vega 6, which is now ESM only. This is a major version bump with potential breaking changes. Ensure:
- All code using vega-lite has been updated for v6 API changes
- The application builds and renders charts correctly with v6.2.0
- No module format conflicts (ESM-only Vega v6 with your bundler setup)
- All tests pass, including visualization rendering tests
Please verify these items and share test results confirming compatibility before merging.
| "vega": "^6.2.0", | ||
| "vega-embed": "^6.29.0", | ||
| "vega-lite": "^5.21.0" | ||
| "vega-lite": "^6.2.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
vega-lite v6 breaking changes migration from v5
💡 Result:
Here’s a concise migration checklist and the main breaking changes when moving Vega‑Lite v5 → v6, with links to the upstream notes.
Key breaking changes
- Vega‑Lite now targets Vega 6 (you should update any direct Vega dependency and test specs against Vega 6). [1][2]
- Package is ESM-only (no CommonJS build) — update imports (use ES import syntax / bundler config) if your environment relied on require()/CJS. [1]
- Default continuous size behavior changed — check any specs that relied on previous continuous size defaults (you may need to set explicit size/scale settings). [2]
- Minor/behavioral changes to handling of invalid data and scales — review mark.invalid / config.scale.invalid behavior in your specs (see docs on invalid-data modes). [3]
Migration steps (practical)
- Upgrade vega-lite to v6.x and vega to v6.x in your project and run your test/spec suite. [1][2]
- If your code used require('vega-lite') / require('vega'), convert to ES module imports (or configure your bundler to handle ESM). [1]
- Search your specs for any reliance on implicit continuous size defaults (e.g., point/bar sizing, rangeStep) and explicitly set size/scale or config if visuals changed. [2]
- Review invalid-data behavior in any line/area/trail or scale-dependent specs and add mark.invalid or config.scale.invalid explicitly if needed. Test path marks for breaks/filters. [3]
- Run full visual/regression tests and address any warnings/errors reported by the v6 schema validator.
References
- vega‑lite v6.0.0 release notes (includes ESM-only, update to Vega 6, change default continuous size). [1][2]
- Vega‑Lite docs: Modes for Handling Invalid Data (mark.invalid / config.scale.invalid). [3]
If you want, I can:
- scan a sample of your v5 specs and point out exact fields likely to break, or
- produce a one‑file checklist script/regexes to find risky encodings (invalid-data, size/rangeStep, require/import).
🏁 Script executed:
# Search for vega-lite usage in wren-ui
fd -e ts -e tsx -e js -e jsx . wren-ui/src | head -20Repository: Canner/WrenAI
Length of output: 1101
🏁 Script executed:
# Check for vega-lite imports and usage
rg "vega-lite|from\s+['\"].*vega" wren-ui/src --type ts --type tsx --type js --type jsx -i -A 2Repository: Canner/WrenAI
Length of output: 84
🏁 Script executed:
# Examine the package.json context more closely
head -100 wren-ui/package.json | tail -15Repository: Canner/WrenAI
Length of output: 424
🏁 Script executed:
# Check if there are test files and build scripts
cat wren-ui/package.json | grep -A 50 '"scripts"'Repository: Canner/WrenAI
Length of output: 1788
🏁 Script executed:
# Search for vega-lite and vega imports with correct syntax
rg "from\s+['\"].*vega|import.*vega" wren-ui/src -A 3 -B 1Repository: Canner/WrenAI
Length of output: 1980
🏁 Script executed:
# Also search for require patterns with vega
rg "require\s*\(\s*['\"].*vega" wren-ui/srcRepository: Canner/WrenAI
Length of output: 39
🏁 Script executed:
# Look for files that might use vega specs or configurations
fd -e ts -e js wren-ui/src | xargs grep -l "vega\|spec\|mark\|encoding" | head -15Repository: Canner/WrenAI
Length of output: 406
🏁 Script executed:
# Check for vega-related test files
fd "vega|chart|visualization" wren-ui/src -iRepository: Canner/WrenAI
Length of output: 360
🏁 Script executed:
# Look at the actual imports more broadly
rg "^import.*vega|^from.*vega" wren-ui/src -B 1 -A 3Repository: Canner/WrenAI
Length of output: 1980
🏁 Script executed:
# Examine vegaSpecUtils.ts - the main spec utility
cat wren-ui/src/utils/vegaSpecUtils.tsRepository: Canner/WrenAI
Length of output: 7381
🏁 Script executed:
# Check chart handler for mark definitions and spec building
cat wren-ui/src/components/chart/handler.tsRepository: Canner/WrenAI
Length of output: 14333
🏁 Script executed:
# Look at the test file to see what's being tested
cat wren-ui/src/utils/vegaSpecUtils.test.tsRepository: Canner/WrenAI
Length of output: 8719
🏁 Script executed:
# Check for any size, rangeStep, or mark.invalid patterns in specs
rg "size|rangeStep|mark\.|invalid" wren-ui/src/utils/vegaSpecUtils.ts wren-ui/src/components/chart/handler.tsRepository: Canner/WrenAI
Length of output: 1703
🏁 Script executed:
# Check if there are any other schema version references
rg "vega-lite/v5|vega-lite/v4|vega-lite/v6" wren-ui/srcRepository: Canner/WrenAI
Length of output: 379
🏁 Script executed:
# Verify the full chart index.tsx to see how specs are used
cat wren-ui/src/components/chart/index.tsx | head -100Repository: Canner/WrenAI
Length of output: 2880
Update vega-lite schema version references to v6.
The upgrade to vega-lite v6.2.0 requires updating the hardcoded schema references. In wren-ui/src/utils/vegaSpecUtils.ts (line 46), the $schema property references https://vega.github.io/schema/vega-lite/v5.json and should be updated to https://vega.github.io/schema/vega-lite/v6.json. The same update should be made in wren-ui/src/utils/vegaSpecUtils.test.ts test fixtures.
The codebase is otherwise compatible with v6.2.0: ES module imports are already in use, related vega packages are at v6.x, and explicit sizing configuration (width: 'container', height: 'container') avoids reliance on changed default behaviors. No breaking API changes affect the current spec-building logic.
🤖 Prompt for AI Agents
In wren-ui/src/utils/vegaSpecUtils.ts around line 46 and in
wren-ui/src/utils/vegaSpecUtils.test.ts (test fixtures), the $schema hardcoded
URL references v5; update these to
"https://vega.github.io/schema/vega-lite/v6.json" in both the spec builder and
any test fixtures/expected specs so they match vega-lite v6.2.0, then run the
unit tests to ensure no other references to v5 remain.
fix https://github.com/Canner/WrenAI/security/dependabot/123
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.