Skip to content

chore(deps): refresh dependencies to latest - #6

Merged
dev-jodee merged 2 commits into
mainfrom
chore/refresh-deps
Jul 17, 2026
Merged

chore(deps): refresh dependencies to latest#6
dev-jodee merged 2 commits into
mainfrom
chore/refresh-deps

Conversation

@dev-jodee

@dev-jodee dev-jodee commented Jul 17, 2026

Copy link
Copy Markdown
Owner

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-next 16.1.716.2.10
  • react/react-dom pinned 19.2.319.2.7
  • codama family, shiki, @types/node ^20^22 bumped
  • Removed @limechain/codama-dart (unused) and @types/pako (pako 3 ships its own types)

Code

  • IdlViewer: derive json/collapsed at render instead of setState-in-effect
  • page.tsx: document the URL-hydration effect suppression
  • Both flagged by the stricter react-hooks rules in eslint-config-next 16.2.10

Held back

  • TypeScript stays ^5 — TS 7 breaks typescript-eslint until 7.1
  • ESLint stays ^9

Verification

npm run lint clean · npm test 25/25 · npm run build passes · live fetch of a program IDL exercises kit 7 + program-metadata 0.8 + pako 3 inflate end-to-end.

Summary by CodeRabbit

  • Bug Fixes

    • Improved IDL viewer updates when switching between definitions, helping ensure displayed JSON and syntax highlighting stay synchronized.
    • Reduced stale or mismatched highlighting during content changes.
  • Maintenance

    • Updated core application, rendering, and syntax-highlighting components for improved compatibility and reliability.

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.
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@dev-jodee, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f1e1dc06-6e69-4e2f-9cae-8ac04e3cc72c

📥 Commits

Reviewing files that changed from the base of the PR and between dad308f and 95cdfe1.

📒 Files selected for processing (1)
  • components/IdlViewer.tsx
📝 Walkthrough

Walkthrough

The PR refactors IdlViewer state and highlighting synchronization, adds comments explaining post-mount URL hydration, and updates production and development dependency versions.

Changes

IDL viewer and project updates

Layer / File(s) Summary
IDL viewer state and highlighting
components/IdlViewer.tsx
IdlViewer derives JSON from collapsed, detects incoming IDL changes during render, and stores highlighted HTML together with its source JSON before rendering it.
Application hydration and dependency maintenance
app/page.tsx, package.json
Comments document delayed URL-state hydration and its lint exception; dependency versions are updated, with obsolete packages removed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main dependency refresh in the PR and is concise and specific enough.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/refresh-deps

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Prevent redundant syntax highlighting when uncollapsing.

When toggling the view from collapsed back to expanded, the component instantly renders the cached hl.html because hl.src === json. However, this useEffect still fires (because collapsed and json changed), redundantly re-executing the expensive Shiki codeToHtml process.

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

📥 Commits

Reviewing files that changed from the base of the PR and between f485fbf and dad308f.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • app/page.tsx
  • components/IdlViewer.tsx
  • package.json

Comment thread components/IdlViewer.tsx Outdated
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.
@dev-jodee

Copy link
Copy Markdown
Owner Author

Thanks @coderabbitai — went through both:

  • ① Memoize json — done in 95cdfe1 (useMemo keyed to [collapsed, idl]).
  • ② Bail redundant re-highlight on uncollapse — skipping. It only fires on manual collapse→expand and Shiki is already gated to ≤75KB, so the payoff is marginal. It'd also require adding hl to the effect deps (per exhaustive-deps), making the guard load-bearing to avoid a re-run — more moving parts than the win justifies.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@dev-jodee Thanks—useMemo addresses the memoization concern. Your rationale for leaving the uncollapse re-highlight path as-is is reasonable given the size gate and added dependency/guard complexity.

🐇✨


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@dev-jodee
dev-jodee merged commit 20eb508 into main Jul 17, 2026
2 checks passed
@dev-jodee
dev-jodee deleted the chore/refresh-deps branch July 17, 2026 15:37
dev-jodee added a commit that referenced this pull request Jul 23, 2026
Refresh dependencies to latest and add a Dart client renderer, loaded
lazily via its ESM build and bundled for Vercel. Squashes #6-#9.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant