Skip to content

Conversation

@jog1t
Copy link
Contributor

@jog1t jog1t commented Feb 5, 2026

Description

Updated all imports of zod to use the more specific zod/v4 path across the RivetKit TypeScript codebase. This change ensures consistent versioning of the Zod library throughout the project.

Also downgraded the CodeMirror commands package from version 6.9.0 to 6.8.1 and TypeScript from 5.9.3 to 5.9.2 in the dependencies.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

The existing test suite has been run to verify that the import path changes don't affect functionality.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@jog1t jog1t marked this pull request as ready for review February 5, 2026 00:22
Copy link
Contributor Author

jog1t commented Feb 5, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


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.

@jog1t jog1t mentioned this pull request Feb 5, 2026
11 tasks
@claude
Copy link

claude bot commented Feb 5, 2026

PR Review: Migrate to zod v4

Summary

This PR updates zod imports from zod to zod/v4 across the RivetKit TypeScript codebase. The change affects 26 files in the rivetkit and cloudflare-workers packages, along with pnpm lockfile updates that downgrade some transitive dependencies.

Code Quality ✅

Positive aspects:

  • Consistent pattern applied across all modified files
  • The migration is systematic and follows the new zod v4 subpath export pattern
  • Package.json correctly specifies zod ^4.1.0 as a dependency

Issues Found 🔴

1. Incomplete Migration - Critical

The following files still use from "zod" and were not updated in this PR:

  • rivetkit-typescript/packages/rivetkit/scripts/manager-openapi-gen.ts
  • rivetkit-typescript/packages/rivetkit/scripts/schema-utils.ts
  • rivetkit-typescript/packages/mcp-hub/src/index.ts

Impact: This creates inconsistency in the codebase and may cause issues depending on how zod v4 handles backward compatibility.

Recommendation: Update these files to use zod/v4 as well. The scripts directory files are particularly important since they're used for code generation and schema utilities.

2. Package Version Mismatch - Medium

The @rivetkit/mcp-hub package still depends on zod ^3.25.76 (line 34 of rivetkit-typescript/packages/mcp-hub/package.json), while the main rivetkit package uses zod ^4.1.0.

Impact: This creates a version conflict in the workspace, potentially leading to multiple zod versions being installed or resolution issues.

Recommendation: Update @rivetkit/mcp-hub/package.json to use zod ^4.1.0 and update its imports to zod/v4 as well.

3. Unexplained Dependency Downgrades

The PR description mentions downgrading:

  • CodeMirror commands: 6.9.0 → 6.8.1
  • TypeScript: 5.9.3 → 5.9.2

Issue: No explanation is provided for why these downgrades were necessary as part of the zod migration.

Recommendation: Either:

  • Explain in the PR description why these downgrades are related to the zod migration
  • Or revert these changes if they're unintentional side effects of lockfile regeneration

Performance Considerations ⚠️

  • The use of subpath exports (zod/v4) may have different tree-shaking characteristics than default imports
  • Recommendation: Verify that the bundle size hasn't increased significantly after this change

Security Concerns ✅

No security issues identified. The zod library upgrade is generally positive for security as newer versions include bug fixes.

Test Coverage ⚠️

The PR states "The existing test suite has been run to verify that the import path changes don't affect functionality."

Recommendation:

  • Please confirm all tests pass, including TypeScript compilation
  • Consider running: cd rivetkit-typescript/packages/rivetkit && pnpm check-types
  • Verify that the incomplete migration (scripts/ files) doesn't cause test failures

Additional Observations

  1. PR Title: "refactor(rivetkit): migrate granularly to zod v4" - The word "granularly" suggests a phased approach, but the PR appears to be a bulk update. Consider if this is intentional or if more phases are planned.

  2. Lock File Changes: The pnpm-lock.yaml shows removal of a duplicate @uiw/codemirror-extensions-basic-setup entry with @codemirror/commands@6.9.0, which might be cleanup from the CodeMirror downgrade.

Recommendations Summary

Must Fix:

  1. ✅ Update the 3 missed files to use zod/v4
  2. ✅ Resolve the zod version conflict in @rivetkit/mcp-hub
  3. ✅ Explain or revert the CodeMirror and TypeScript downgrades

Should Verify:
4. ✅ Run full test suite including TypeScript compilation
5. ✅ Check bundle size impact
6. ✅ Consider if other packages in the monorepo also need migration

Conclusion

The core change is solid, but the PR is incomplete. The missed files and package version mismatch need to be addressed before merging to ensure consistency across the codebase. Once these issues are resolved, this will be a clean migration to zod v4.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 5, 2026

More templates

@rivetkit/cloudflare-workers

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

@rivetkit/db

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

@rivetkit/framework-base

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

@rivetkit/next-js

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

@rivetkit/react

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

rivetkit

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

@rivetkit/sql-loader

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

@rivetkit/traces

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

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4121

@rivetkit/virtual-websocket

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

@rivetkit/engine-runner

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

@rivetkit/engine-runner-protocol

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

commit: 440850e

@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 5, 2026

Graphite Automations

"Test" took an action on this PR • (02/05/26)

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

@graphite-app graphite-app bot force-pushed the 02-05-fix_rivekit_stub_traces_in_browser branch from 55c8a8a to 73b4513 Compare February 5, 2026 00:41
@graphite-app graphite-app bot force-pushed the 02-05-refactor_rivetkit_migrate_granularly_to_zod_v4 branch from 1a82d71 to 440850e Compare February 5, 2026 00:42
@@ -1,5 +1,5 @@
import type { Client } from "rivetkit";
import { z } from "zod";
import { z } from "zod/v4";
Copy link
Contributor

Choose a reason for hiding this comment

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

This import change from 'zod' to 'zod/v4' is causing TypeScript module resolution errors. TypeScript cannot find the module 'zod/v4'. Instead of changing the import path, update the Zod dependency version in package.json and keep importing from 'zod' directly.

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 02-05-refactor_rivetkit_migrate_granularly_to_zod_v4 branch from 440850e to 96a52dc Compare February 5, 2026 20:34
@jog1t jog1t force-pushed the 02-05-fix_rivekit_stub_traces_in_browser branch from 73b4513 to 464d190 Compare February 5, 2026 20:34
@graphite-app
Copy link
Contributor

graphite-app bot commented Feb 5, 2026

Merge activity

  • Feb 5, 10:06 PM UTC: jog1t added this pull request to the Graphite merge queue.
  • Feb 5, 10:06 PM UTC: CI is running for this pull request on a draft pull request (#4129) due to your merge queue CI optimization settings.
  • Feb 5, 10:07 PM UTC: Merged by the Graphite merge queue via draft PR: #4129.

graphite-app bot pushed a commit that referenced this pull request Feb 5, 2026
# Description

Updated all imports of `zod` to use the more specific `zod/v4` path across the RivetKit TypeScript codebase. This change ensures consistent versioning of the Zod library throughout the project.

Also downgraded the CodeMirror commands package from version 6.9.0 to 6.8.1 and TypeScript from 5.9.3 to 5.9.2 in the dependencies.

## Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

## How Has This Been Tested?

The existing test suite has been run to verify that the import path changes don't affect functionality.

## Checklist:

- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] I have added tests that prove my fix is effective or that my feature works
- [x] New and existing unit tests pass locally with my changes
@graphite-app graphite-app bot closed this Feb 5, 2026
@graphite-app graphite-app bot deleted the 02-05-refactor_rivetkit_migrate_granularly_to_zod_v4 branch February 5, 2026 22:07
This was referenced Feb 6, 2026
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