chore(deps): refresh dependencies to latest - #6
Conversation
Bump the Solana + tooling stack and drop dead/redundant packages: - @solana/kit ^6.3.1 -> ^7.0.0 (major; used APIs unchanged) - @solana-program/program-metadata ^0.5.1 -> ^0.8.0 (peer-requires kit 7) - pako ^2.1.0 -> ^3.0.1 (major; both call sites use named imports) - next ^16.1.7 -> ^16.2.10, eslint-config-next 16.1.7 -> 16.2.10 - react/react-dom pinned 19.2.3 -> 19.2.7 - codama family, shiki, @types/node ^20 -> ^22 bumped - remove @limechain/codama-dart (unused) and @types/pako (pako 3 ships types) Refactor IdlViewer to derive json/collapsed at render instead of via setState-in-effect, and document the URL-hydration effect suppression in page.tsx, both flagged by the stricter eslint-config-next react-hooks rules. TypeScript held at ^5 (TS 7 breaks typescript-eslint until 7.1) and ESLint held at ^9.
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR refactors ChangesIDL viewer and project updates
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
components/IdlViewer.tsx (1)
35-53: 🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick winPrevent redundant syntax highlighting when uncollapsing.
When toggling the view from collapsed back to expanded, the component instantly renders the cached
hl.htmlbecausehl.src === json. However, thisuseEffectstill fires (becausecollapsedandjsonchanged), redundantly re-executing the expensive ShikicodeToHtmlprocess.Bail out early if the highlighted source already matches the current
json.⚡ Proposed optimization
useEffect(() => { - if (collapsed || !shouldHighlight) return; + if (collapsed || !shouldHighlight || hl?.src === json) return; let cancelled = false; import("shiki") .then(({ codeToHtml }) => codeToHtml(json, { lang: "json", theme: "github-dark-dimmed" }) ) .then((html) => { if (!cancelled) setHl({ src: json, html }); }) .catch(() => { /* silently fall back to plain text */ }); return () => { cancelled = true; }; - }, [json, collapsed, shouldHighlight]); + }, [json, collapsed, shouldHighlight, hl?.src]);🤖 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 `@components/IdlViewer.tsx` around lines 35 - 53, Update the highlighting useEffect in IdlViewer to return early when the existing highlighted result’s source matches the current json, before importing Shiki or invoking codeToHtml. Preserve highlighting for changed or uncached JSON and the existing collapsed/shouldHighlight guards.
🤖 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 `@components/IdlViewer.tsx`:
- Line 29: Memoize the JSON string derivation in IdlViewer using React’s
useMemo, recomputing only when collapsed or idl changes; preserve the
empty-string result while collapsed and the existing JSON.stringify formatting
otherwise.
---
Outside diff comments:
In `@components/IdlViewer.tsx`:
- Around line 35-53: Update the highlighting useEffect in IdlViewer to return
early when the existing highlighted result’s source matches the current json,
before importing Shiki or invoking codeToHtml. Preserve highlighting for changed
or uncached JSON and the existing collapsed/shouldHighlight guards.
🪄 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: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: e90fc27c-6f9c-48aa-9b1d-80ce28b26115
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (3)
app/page.tsxcomponents/IdlViewer.tsxpackage.json
Avoid re-running JSON.stringify on every render (e.g. copy-address or async highlight state changes) by keying it to [collapsed, idl]. Addresses PR review.
|
Thanks @coderabbitai — went through both:
|
|
Tip For best results, initiate chat on the files or code changes.
🐇✨ If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! |
What
Refreshes the Solana + tooling stack to current versions and drops dead/redundant packages.
Dependency changes
@solana/kit^6.3.1→^7.0.0(major — used APIs unaffected by v7 removals)@solana-program/program-metadata^0.5.1→^0.8.0(peer-requires kit 7, so upgraded as a unit)pako^2.1.0→^3.0.1(major — both call sites use named imports, unaffected by the dropped default export)next^16.1.7→^16.2.10,eslint-config-next16.1.7→16.2.10react/react-dompinned19.2.3→19.2.7codamafamily,shiki,@types/node^20→^22bumped@limechain/codama-dart(unused) and@types/pako(pako 3 ships its own types)Code
IdlViewer: derivejson/collapsedat render instead ofsetState-in-effectpage.tsx: document the URL-hydration effect suppressioneslint-config-next16.2.10Held back
^5— TS 7 breakstypescript-eslintuntil 7.1^9Verification
npm run lintclean ·npm test25/25 ·npm run buildpasses · live fetch of a program IDL exercises kit 7 + program-metadata 0.8 + pako 3 inflate end-to-end.Summary by CodeRabbit
Bug Fixes
Maintenance