Skip to content

refactor(dashboard): fix ts issues#3981

Closed
jog1t wants to merge 1 commit into
mainfrom
01-17-refactor_dashboard_fix_ts_issues
Closed

refactor(dashboard): fix ts issues#3981
jog1t wants to merge 1 commit into
mainfrom
01-17-refactor_dashboard_fix_ts_issues

Conversation

@jog1t

@jog1t jog1t commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@railway-app

railway-app Bot commented Jan 19, 2026

Copy link
Copy Markdown

🚅 Deployed to the rivet-pr-3981 environment in rivet-frontend

Service Status Web Updated (UTC)
frontend-inspector 😴 Sleeping (View Logs) Web Jan 20, 2026 at 6:29 pm
frontend-cloud 😴 Sleeping (View Logs) Web Jan 20, 2026 at 6:29 pm
website 😴 Sleeping (View Logs) Web Jan 20, 2026 at 6:28 pm

@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-3981 January 19, 2026 22:51 Destroyed

jog1t commented Jan 19, 2026

Copy link
Copy Markdown
Contributor Author

How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude

claude Bot commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

PR Review: refactor(dashboard): fix ts issues

Overview

This PR addresses TypeScript issues across the dashboard, examples, and RivetKit TypeScript packages. The changes include 91 files with 476 additions and 1007 deletions, representing a significant TypeScript strictness improvement effort.


✅ Strengths

1. Improved CI/CD Pipeline

The new frontend.yml workflow is well-structured:

  • Separate quality checks for dashboard, RivetKit, and website
  • Independent type checking jobs with proper caching
  • Good use of Turbo caching with actions/cache@v4

2. TypeScript Strictness

  • Proper type-only imports using import type { ... }
  • Better type safety in data providers with proper return types
  • Elimination of implicit any types in many places

3. Code Cleanup

  • Removed obsolete namespaces-page.tsx (188 lines)
  • Streamlined actor-database.tsx (reduced by 156 lines)
  • Consolidated database-table.tsx (reduced by 333 lines)
  • This cleanup suggests dead code removal or refactoring to simpler implementations

4. Workspace Consistency

  • All example turbo.json files now extend root config ("extends": ["//"])
  • Consistent dependency management across examples
  • Updated RivetKit to v2.0.38 across all examples

⚠️ Concerns & Recommendations

1. Missing Website Type Checking (Priority: Medium)

Location: .github/workflows/frontend.yml:75-92

The website type checking is commented out. This creates inconsistency in CI enforcement.

Recommendation:

  • Either enable the website checks or add a TODO comment explaining when they'll be enabled
  • Track completion in a follow-up issue if needed

2. Type Safety in Data Provider (Priority: Low)

Location: frontend/src/components/actors/data-provider.tsx

The code uses biome-ignore for useHookAtTopLevel violations:

// biome-ignore lint/correctness/useHookAtTopLevel: runs only once
return useRouteContext({
  from: "/_context/_cloud/orgs/$organization/projects/$project/ns/$namespace",
  select: (ctx) => ctx.dataProvider,
});

While this is technically correct (the match statement ensures each hook runs only once), it's a code smell.

Recommendation:

  • Consider extracting these into separate hook functions to avoid the linter warning
  • Example:
const useCloudDataProviderInternal = () => {
  return useRouteContext({
    from: "/_context/_cloud/orgs/$organization/projects/$project/ns/$namespace",
    select: (ctx) => ctx.dataProvider,
  });
};

export const useDataProvider = () => {
  return match(__APP_TYPE__)
    .with("cloud", useCloudDataProviderInternal)
    .with("engine", useEngineDataProviderInternal)
    .with("inspector", useInspectorDataProviderInternal)
    .exhaustive();
};

3. Type Casting in useEngineCompatDataProvider (Priority: Low)

Location: frontend/src/components/actors/data-provider.tsx:133

return useRouteContext({
  from: routePath,
}).dataProvider as
  | EngineDataProvider
  | CloudDataProvider
  | InspectorDataProvider;

The as cast suggests the type system isn't fully capturing the relationship between route path and provider type.

Recommendation:

  • This is acceptable for now, but consider using discriminated unions if type safety becomes an issue

4. Large Deletions Without Context (Priority: Low)

The PR removes significant code:

  • namespaces-page.tsx: 188 lines deleted
  • actor-database.tsx: 156 lines reduced
  • database-table.tsx: 333 lines reduced

Recommendation:

  • Confirm these were dead code removals or moved elsewhere
  • If refactored, ensure the functionality is preserved and tested

🔍 Code Quality Assessment

Best Practices Followed ✅

  • Proper use of import type for type-only imports
  • Consistent use of workspace dependencies
  • Type-safe route handling with TanStack Router
  • Good use of ts-pattern for exhaustive matching

Adherence to CLAUDE.md ✅

  • Uses pnpm for package management (as specified)
  • Hard tabs would be for Rust (this is TypeScript, so N/A)
  • Follows existing patterns in data providers
  • No unauthorized changes to docker/dev configs

🧪 Testing Considerations

Current Coverage

The new CI workflow includes:

  • Biome quality checks for frontend and RivetKit
  • TypeScript type checking for both packages
  • Build verification with proper dependency order

Recommendations

  • ✅ Type checking is now enforced in CI
  • ✅ Quality checks are automated
  • ⚠️ Consider adding integration tests for the refactored data provider logic
  • ⚠️ Verify that deleted code wasn't providing critical functionality

🔒 Security Considerations

No security concerns identified. The changes are primarily:

  • Type system improvements
  • CI/CD enhancements
  • Code cleanup and refactoring

📊 Summary

Category Status
Code Quality ✅ Good
Type Safety ✅ Significantly Improved
CI/CD ✅ Enhanced
Documentation ⚠️ Website checks disabled
Test Coverage ✅ Type checking enforced
Security ✅ No concerns

Final Verdict

✅ Approved with minor suggestions

This is a solid TypeScript improvement PR that enhances type safety and CI enforcement. The suggestions above are minor improvements that can be addressed in follow-up PRs if needed.

Action Items (Optional Follow-ups)

  1. Enable or document website type checking status
  2. Consider refactoring biome-ignore violations in data-provider.tsx
  3. Verify functionality of deleted/reduced code sections

Great work on improving the TypeScript strictness across the codebase! 🎉

@pkg-pr-new

pkg-pr-new Bot commented Jan 19, 2026

Copy link
Copy Markdown
More templates

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@3981

@rivetkit/db

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/db@3981

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@3981

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@3981

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@3981

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@3981

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@3981

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@3981

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@3981

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@3981

commit: 5580b30

@jog1t jog1t force-pushed the 01-17-refactor_dashboard_fix_ts_issues branch from 900dc84 to af907e8 Compare January 19, 2026 23:05
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-3981 January 19, 2026 23:06 Destroyed
@jog1t jog1t force-pushed the 01-17-refactor_dashboard_fix_ts_issues branch from af907e8 to f83b043 Compare January 19, 2026 23:13
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-3981 January 19, 2026 23:13 Destroyed
@jog1t jog1t marked this pull request as ready for review January 19, 2026 23:19
@graphite-app

graphite-app Bot commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

Graphite Automations

"Test" took an action on this PR • (01/19/26)

1 assignee was added to this PR based on Kacper Wojciechowski's automation.

Comment thread .github/workflows/frontend.yml
@jog1t jog1t force-pushed the 01-17-refactor_dashboard_fix_ts_issues branch from f83b043 to 3e2fc8e Compare January 19, 2026 23:54
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-3981 January 19, 2026 23:54 Destroyed
@jog1t jog1t force-pushed the 01-17-refactor_dashboard_fix_ts_issues branch from 3e2fc8e to b17b916 Compare January 20, 2026 18:00
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-3981 January 20, 2026 18:00 Destroyed
Comment thread .github/workflows/frontend.yml Outdated
Comment on lines +30 to +38
website-quality-check:
name: Website / Quality Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: biomejs/setup-biome@v2
with:
version: latest
- run: biome check ./website --reporter=github

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This job is causing CI to fail because it's trying to run Biome checks on the ./website directory, but either the directory doesn't exist, is empty, or is excluded from Biome's configuration. Consider removing this job or updating the path to a directory that Biome can process.

Spotted by Graphite Agent (based on CI logs)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Comment on lines +27 to +31
"@rivetkit/react": "^2.0.38",
"hono": "^4.11.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rivetkit": "*",
"rivetkit": "^2.0.38",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The validation script in @rivetkit/example-registry expects RivetKit dependencies to use wildcard version (''). Changing to specific versions ('^2.0.38') causes validation to fail. Revert these changes to use '' for RivetKit dependencies.

Spotted by Graphite Agent (based on CI logs)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@jog1t jog1t force-pushed the 01-17-refactor_dashboard_fix_ts_issues branch from b17b916 to b959eb2 Compare January 20, 2026 18:19
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-3981 January 20, 2026 18:19 Destroyed
@jog1t jog1t force-pushed the 01-17-refactor_dashboard_fix_ts_issues branch from b959eb2 to e33aa29 Compare January 20, 2026 18:30
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-3981 January 20, 2026 18:30 Destroyed
@jog1t jog1t force-pushed the 01-17-refactor_dashboard_fix_ts_issues branch from e33aa29 to 5580b30 Compare January 20, 2026 18:47
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-3981 January 20, 2026 18:47 Destroyed
@graphite-app

graphite-app Bot commented Jan 20, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jan 20, 6:51 PM UTC: jog1t added this pull request to the Graphite merge queue.
  • Jan 20, 6:52 PM UTC: CI is running for this pull request on a draft pull request (#3983) due to your merge queue CI optimization settings.
  • Jan 20, 6:52 PM UTC: Merged by the Graphite merge queue via draft PR: #3983.

graphite-app Bot pushed a commit that referenced this pull request Jan 20, 2026
@graphite-app graphite-app Bot closed this Jan 20, 2026
@graphite-app graphite-app Bot deleted the 01-17-refactor_dashboard_fix_ts_issues branch January 20, 2026 18:52
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