Skip to content

Conversation

@jog1t
Copy link
Contributor

@jog1t jog1t commented Jan 20, 2026

TL;DR

Updated the Vercel deployment template link to use the correct repository path and improved template handling for Vercel deployments.

What changed?

  • Replaced the hardcoded Vercel template repository URL (https://github.com/rivet-dev/template-vercel) with a dynamic path that points to examples in the main Rivet repository (https://github.com/rivet-dev/rivet/tree/main/examples/${template || "chat-room"})
  • Imported the templates from @rivetkit/example-registry in the getting-started component
  • Enhanced the DeployToVercelCard component to use template-specific Vercel provider configuration when available, falling back to the template name or "chat-room" as default

How to test?

  1. Navigate to the getting started flow
  2. Select Vercel as the deployment provider
  3. Verify that the correct template repository URL is being used
  4. Test with different templates to ensure the proper Vercel configuration is applied

Why make this change?

This change ensures that users are directed to the correct template repositories when deploying to Vercel, providing a more consistent experience across different templates. It also improves the flexibility of the deployment system by using template-specific Vercel configurations when available.

Copy link
Contributor Author

jog1t commented Jan 20, 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.

@claude
Copy link

claude bot commented Jan 20, 2026

Pull Request Review

Overview

This PR updates the Vercel deployment template link to use template-specific Vercel configurations from the example registry, improving the deployment experience by directing users to the correct Vercel-flavored examples.

Code Quality: ✅ Good

Positive aspects:

  • Clean and straightforward implementation
  • Properly leverages the existing templates data structure from @rivetkit/example-registry
  • Good use of optional chaining and fallback values
  • The change aligns with the repository structure where Vercel-specific examples exist (e.g., chat-room-vercel, hello-world-vercel)

Issues & Concerns

1. Potential Bug: Null Safety (Medium Priority)

In getting-started.tsx:383:

<DeployToVercelCard template={templateDetails?.providers.vercel.name || template || "chat-room"} />

Issue: If templateDetails exists but doesn't have a vercel provider, this will throw a runtime error when accessing templateDetails.providers.vercel.name.

Recommendation:

<DeployToVercelCard template={templateDetails?.providers?.vercel?.name || template || "chat-room"} />

Add optional chaining to providers.vercel to safely handle templates that may not have Vercel deployment configurations.

2. Inconsistency: Different Usage Patterns (Low Priority)

The DeployToVercelCard component is used in two different ways:

  1. In connect-quick-vercel-frame.tsx:153 - called with the original template name
  2. In getting-started.tsx:383 - called with the Vercel-specific template name

This inconsistency could lead to confusion. Consider:

  • Should both usages follow the same pattern?
  • Does StepInitialInfo in connect-quick-vercel-frame.tsx also need the same Vercel-specific template resolution?

3. Type Safety Consideration (Low Priority)

The lookup pattern templates.find((t) => t.name === template) relies on runtime string matching. Consider adding TypeScript guards or validation to ensure the template exists, especially since this impacts the user-facing deployment flow.

Performance: ✅ Good

  • The templates.find() operation is O(n) but the templates array is small, so performance impact is negligible
  • The logic is within a React component, so it only runs during renders

Security: ✅ No concerns

  • No security issues identified
  • The template names are from a controlled source (@rivetkit/example-registry)
  • URL construction in useVercelTemplateLink properly encodes parameters

Test Coverage: ⚠️ Cannot Verify

  • No test files modified in this PR
  • Recommend manual testing with:
    • Templates that have Vercel providers (e.g., chat-room, hello-world)
    • Templates that may not have Vercel providers
    • Edge case: undefined/null template values

Best Practices

Positive:

  • ✅ Follows the repository's pattern of using fallback values
  • ✅ Imports are properly organized at the top of the file
  • ✅ Uses template literals appropriately for URL construction

Suggestions:

  • Consider adding JSDoc comments explaining the fallback chain logic for future maintainers
  • The commented-out code at frontend/src/app/dialogs/connect-quick-vercel-frame.tsx:126 has been properly replaced

Recommendations

  1. Must Fix: Add optional chaining for templateDetails?.providers?.vercel?.name to prevent runtime errors
  2. Should Consider: Align the usage pattern of DeployToVercelCard across both files for consistency
  3. Nice to Have: Add validation/error handling for cases where a template is selected that doesn't have a Vercel provider

Testing Checklist

Before merging, please verify:

  • Deploy flow works for templates with Vercel providers (chat-room, hello-world, ai-agent)
  • Graceful fallback when template doesn't have a Vercel provider
  • Correct URLs are generated in the Vercel deployment link
  • Both connect-quick-vercel-frame.tsx and getting-started.tsx work correctly

Overall Assessment: Good change that improves the user experience. Main concern is the potential runtime error with missing optional chaining. Once that's addressed, this should be good to merge.

@jog1t jog1t requested a review from NathanFlurry January 20, 2026 20:33
@jog1t jog1t self-assigned this Jan 20, 2026
@jog1t jog1t marked this pull request as ready for review January 20, 2026 20:33
@jog1t jog1t force-pushed the 01-20-feat_dashboard_use_vercel-flavored_examples_when_deploying_with_vercel branch from 9533db4 to 0bf7359 Compare January 20, 2026 20:34
@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 20, 2026

More templates

@rivetkit/virtual-websocket

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

@rivetkit/cloudflare-workers

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

@rivetkit/db

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

@rivetkit/framework-base

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

@rivetkit/next-js

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

@rivetkit/react

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

rivetkit

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

@rivetkit/sql-loader

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

@rivetkit/engine-runner

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

@rivetkit/engine-runner-protocol

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

commit: 0bf7359

@@ -1,5 +1,5 @@
import { faChevronLeft, faChevronRight, Icon } from "@rivet-gg/icons";
import { deployOptions } from "@rivetkit/example-registry";
import { deployOptions, templates } from "@rivetkit/example-registry";
Copy link
Contributor

Choose a reason for hiding this comment

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

The import statement was modified to include 'templates', but this might have caused import sorting issues. Ensure all imports are properly sorted according to Biome's rules. Run Biome's linter to automatically fix the sorting.

Spotted by Graphite Agent (based on CI logs)

Fix in Graphite


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

Comment on lines 128 to +129
return useMemo(() => {
// const repositoryUrl = `https://github.com/rivet-dev/rivet/tree/main/examples/${template || "chat-room"}`;
const repositoryUrl = "https://github.com/rivet-dev/template-vercel";
const repositoryUrl = `https://github.com/rivet-dev/rivet/tree/main/examples/${template || "chat-room"}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

The useMemo hook is likely missing the 'template' variable in its dependency array. Add template to the dependency array to ensure the memoized value is recalculated when template changes. The correct implementation would be: 'return useMemo(() => { const repositoryUrl = https://github.com/rivet-dev/rivet/tree/main/examples/${template || "chat-room"}; ... }, [template, endpoint]);'

Spotted by Graphite Agent (based on CI logs)

Fix in Graphite


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

Comment on lines +377 to +383
const templateDetails = templates.find((t) => t.name === template);
const options = deployOptions.find((p) => p.name === provider);
return (
<div className="flex flex-col gap-6">
{match({ template, provider })
.with({ provider: "vercel", template: P.string }, () => (
<DeployToVercelCard template={template} />
<DeployToVercelCard template={templateDetails?.providers.vercel.name || template || "chat-room"} />
Copy link
Contributor

Choose a reason for hiding this comment

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

The code is trying to access 'providers.vercel.name' on templateDetails, but this property doesn't exist in the Template type definition. Since we don't have access to modify the Template type, we should remove line 377 that introduces templateDetails and modify line 383 to use the template parameter directly: <DeployToVercelCard template={template || 'chat-room'} />

Spotted by Graphite Agent (based on CI logs)

Fix in Graphite


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

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.

2 participants