Skip to content

Conversation

@NathanFlurry
Copy link
Member

No description provided.

@railway-app
Copy link

railway-app bot commented Jan 7, 2026

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

Service Status Web Updated (UTC)
frontend-cloud-staging 🕒 Building (View Logs) Web Jan 9, 2026 at 9:24 pm
frontend-inspector 🕒 Building (View Logs) Web Jan 9, 2026 at 9:24 pm
frontend-cloud 🕒 Building (View Logs) Web Jan 9, 2026 at 9:23 pm
website 🕐 Queued (View Logs) Web Jan 9, 2026 at 9:22 pm

🚅 Environment rivet-pr-3785 in rivet-frontend-website-preview has no services deployed.

@NathanFlurry NathanFlurry changed the title Update examples to WinterTC format Update examples to serverless format Jan 7, 2026
@railway-app railway-app bot temporarily deployed to rivet-frontend-website-preview / rivet-pr-3785 January 7, 2026 23:03 Destroyed
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-3785 January 7, 2026 23:03 Destroyed
@vercel
Copy link

vercel bot commented Jan 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
rivet-chat-room Building Building Preview, Comment Jan 9, 2026 9:25pm
rivet-chat-room-1767827449418-oRFg Canceled Canceled Jan 9, 2026 9:25pm
rivet-chat-room-jh8c Canceled Canceled Jan 9, 2026 9:25pm
rivet-cloud Ready Ready Preview, Comment Jan 9, 2026 9:25pm
rivetkit-serverless Error Error Jan 9, 2026 9:25pm
2 Skipped Deployments
Project Deployment Review Updated (UTC)
rivet-inspector Ignored Ignored Preview Jan 9, 2026 9:25pm
rivet-site Ignored Ignored Preview Jan 9, 2026 9:25pm

@claude
Copy link

claude bot commented Jan 7, 2026

Pull Request Review: Update Examples to Serverless Format

Overview

This PR implements a comprehensive migration of all examples from a development-focused structure to a production-ready serverless deployment format. The changes affect 228 files with ~2,355 additions and ~1,072 deletions.

Summary of Changes

Architectural Changes

  1. Directory Restructuring: Frontend and backend code separated into distinct directories

    • src/frontend/frontend/
    • src/backend/src/
  2. Server API Changes: Migration from registry.start() to export default registry.serve()

    • Enables serverless deployment patterns
    • Better integration with platforms like Vercel, Cloudflare Workers, etc.
  3. Build System: Introduction of production build tooling

    • Added tsup for backend bundling
    • Separated build scripts: build:backend, build:frontend, build
    • Added srvx for unified server development and static file serving
  4. Dependency Management: Changed from workspace references to wildcard versions

    • "rivetkit": "workspace:*""rivetkit": "*"
    • "@rivetkit/react": "workspace:*""@rivetkit/react": "*"
  5. Client Configuration: Updated to use dynamic origin detection

    • Hardcoded URLs like http://localhost:6420${window.location.origin}/api/rivet
    • Enables deployment to any domain without code changes
  6. Vite Configuration: Enhanced with proxy and build output settings

    • Added proxy configuration for /api/rivet/http://localhost:3000
    • Configured build output to dist/ directory
    • Changed root from src/frontend to frontend

Positive Aspects

Consistent Pattern: All examples follow the same architectural pattern
Production Ready: Build system properly configured for deployment
Developer Experience: Maintained dev workflow with hot reload via srvx
Type Safety: Preserved TypeScript configuration and type checking
Deployment Flexibility: Dynamic origin detection enables multi-environment deployment

Issues and Concerns

🔴 Critical Issues

1. Vite Build Output Path Mismatch

Location: Multiple vite.config.ts files
Issue: The vite build outputs to dist/, but the start script references ../frontend/dist

// vite.config.ts
build: {
  outDir: "dist",  // Outputs to frontend/dist
}

// package.json
"start": "srvx --static=../frontend/dist dist/server.js"

The relative path ../frontend/dist is incorrect. When running from the example root, it should be frontend/dist.

Impact: Production deployments will fail to serve static assets

Recommendation: Update the start script:

"start": "srvx --static=frontend/dist dist/server.js"

This issue appears in most examples with frontend directories.

2. Inconsistent Static Path References

Location: Various package.json files
Issue: Some examples use --static=../frontend/dist while at least one uses --static=dist

Examples:

  • actor-actions: --static=../frontend/dist
  • ai-and-user-generated-actors-freestyle: --static=dist (no frontend directory) ✅

Recommendation: Standardize based on directory structure:

  • Examples with frontend/ directory: --static=frontend/dist
  • Examples without separate frontend: --static=dist

⚠️ Medium Priority Issues

3. Removed E2E Test Without Replacement

Location: examples/chat-room/test-e2e.ts
Issue: The file was deleted (45 lines removed) with no replacement test

Impact: Loss of end-to-end test coverage for chat room example

Recommendation:

  • Either restore the E2E test adapted to the new structure
  • Or document why it was removed if intentional

4. Dependency Version Change Strategy

Issue: Changed from workspace dependencies to wildcard versions (*)

// Before
"rivetkit": "workspace:*"

// After
"rivetkit": "*"

Concerns:

  • Examples may inadvertently pull different versions from npm
  • In a monorepo, examples should typically use workspace protocol
  • Wildcard * can lead to unpredictable behavior if examples are tested independently

Recommendation:

  • If examples are intended to be published separately, this is correct
  • If examples remain in-tree for development, use "workspace:*" to ensure they test against local changes
  • Consider documenting the strategy in CLAUDE.md

5. TypeScript Configuration Duplication

Location: New tsconfig.build.json files
Issue: Many examples now have both tsconfig.json and tsconfig.build.json

// tsconfig.build.json
{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "noEmit": false,
    "outDir": "dist",
    "rootDir": "src"
  },
  "include": ["src/**/*"]
}

Observation: This pattern is correct for separating development type-checking from build output, but:

  • Ensure tsup is using this config or doesn't conflict with it
  • Consider if this adds unnecessary complexity vs. configuring tsup directly

💡 Minor/Stylistic Issues

6. Script Ordering in package.json

Issue: Script order varies between examples

Some have:

"dev:backend": "...",
"dev:frontend": "...",
"dev": "..."

Others have:

"dev": "...",
"dev:backend": "...",
"dev:frontend": "..."

Recommendation: Standardize to a logical order (e.g., specific scripts before composite scripts)

7. Missing Build Steps in Some Examples

Location: Several examples
Issue: Some package.json files don't have all three build scripts

Recommendation: Ensure all examples with frontend have:

"build:frontend": "vite build",
"build:backend": "tsup",
"build": "npm run build:backend && npm run build:frontend"

Security Considerations

✅ No obvious security issues identified
✅ Dynamic origin detection is secure (uses window.location.origin)
✅ Proxy configuration properly scoped to /api/rivet/

Performance Considerations

tsup bundling will improve cold start times
✅ Static asset serving via srvx is appropriate
✅ No obvious performance regressions

Testing Recommendations

Before merging:

  1. Test Production Builds: For several examples, run:

    npm run build
    npm run start

    Verify static assets are served correctly

  2. Test Development Mode: Verify hot reload works:

    npm run dev
  3. Test Proxy Configuration: Ensure API calls route correctly in dev mode

  4. Check All Examples: With 228 changed files, spot-check diverse examples:

    • Simple examples (e.g., actor-actions)
    • Complex examples (e.g., ai-agent)
    • Different frameworks (e.g., hono-bun, express, cloudflare-workers)

Recommendations Summary

Required Before Merge:

  1. ✅ Fix the static path references in start scripts (../frontend/distfrontend/dist)
  2. ⚠️ Verify and test the build/serve flow for at least 3-5 representative examples

Consider Before Merge:

  1. 🤔 Restore or document removal of chat-room/test-e2e.ts
  2. 🤔 Document dependency version strategy for examples
  3. 🤔 Standardize script ordering in package.json files

Nice to Have:

  1. 📝 Update CLAUDE.md with the new example structure and build patterns
  2. 📝 Add a migration guide for users updating their own projects

Conclusion

This is a well-structured refactoring that modernizes the example architecture for production deployment. The main concern is the static path mismatch in the production serve command, which will cause deployment failures. Once that's corrected and tested, this should be ready to merge.

The change represents good engineering practice by separating concerns and providing proper build tooling, but needs careful testing due to the large scope of changes across all examples.


Reviewed by: Claude Code
Review Date: 2026-01-09

@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-3785 January 7, 2026 23:08 Destroyed
Copy link
Member Author

NathanFlurry commented Jan 7, 2026


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.

@graphite-app
Copy link
Contributor

graphite-app bot commented Jan 9, 2026

Merge activity

  • Jan 9, 9:23 PM UTC: NathanFlurry added this pull request to the Graphite merge queue.
  • Jan 9, 9:23 PM UTC: CI is running for this pull request on a draft pull request (#3804) due to your merge queue CI optimization settings.
  • Jan 9, 9:24 PM UTC: Merged by the Graphite merge queue via draft PR: #3804.

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.

3 participants