Skip to content

feat: registry.start()#4477

Merged
NathanFlurry merged 2 commits intomainfrom
feat/registry-start
Mar 22, 2026
Merged

feat: registry.start()#4477
NathanFlurry merged 2 commits intomainfrom
feat/registry-start

Conversation

@NathanFlurry
Copy link
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

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?

Please describe the tests that you ran to verify your changes.

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

NathanFlurry and others added 2 commits March 22, 2026 01:57
Replace the srvx + Hono + vite-plugin-srvx setup with a simpler
registry.start() that starts the manager server, serves static files
from public/ if it exists, and runs the actor driver. This is now the
recommended way to run RivetKit.

Key changes:
- Add registry.start() method to Registry class
- Add publicDir config option for static file serving
- Move @hono/node-server and @hono/node-ws to regular deps
- Update client default endpoint to http://localhost:6420
- Add deprecation warning when no endpoint is passed to client
- Migrate all 30 examples to the new pattern
- Update quickstart docs and client docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace separate actors.ts/server.ts with single index.ts + registry.start()
- Update all code examples to import from "./index" instead of "./actors"
- Standardize createClient endpoint to localhost:6420 (not 8080)
- Remove srvx references, replace with npx tsx --watch
- Add registry.start() to runtime-modes comparison and registry-configuration
- Update skill-base-rivetkit.md to reference registry.start() as primary
- Update StepRunServer default file to index.ts
- Update react quickstart to remove StepSetupServer/StepRunServer

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4477 March 22, 2026 09:10 Destroyed
@NathanFlurry NathanFlurry merged commit a0984ee into main Mar 22, 2026
4 of 11 checks passed
@railway-app
Copy link

railway-app bot commented Mar 22, 2026

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

Service Status Web Updated (UTC)
frontend-inspector 🕐 Initializing (View Logs) Web Mar 22, 2026 at 9:10 am
frontend-cloud 🕐 Initializing (View Logs) Web Mar 22, 2026 at 9:10 am
mcp-hub 🕐 Initializing (View Logs) Web Mar 22, 2026 at 9:10 am
website 🕐 Initializing (View Logs) Web Mar 22, 2026 at 9:10 am
kitchen-sink 🕐 Initializing (View Logs) Web Mar 22, 2026 at 9:10 am
ladle 🕐 Initializing (View Logs) Web Mar 22, 2026 at 9:10 am

@NathanFlurry NathanFlurry deleted the feat/registry-start branch March 22, 2026 09:10
@claude
Copy link

claude bot commented Mar 22, 2026

PR Review: registry.start()

This PR significantly simplifies the RivetKit developer experience. The consolidation of examples to a single src/index.ts entry point and the new registry.start() method is a clear DX improvement. Below are my observations.


Potential Issues

1. Hardcoded localhost:6420 may break production deployments

Every frontend example now uses a hardcoded localhost:6420 endpoint. In production, registry.start() serves the built frontend as static files (via publicDir), but the built JS bundle still references localhost:6420, which will fail for any cloud deployment. The old pattern using location.origin was production-safe because it was relative to the serving origin. Consider using a Vite env variable or document clearly that the hardcoded endpoint is local-dev-only.

2. start() mutates the stored config object in place

In registry/index.ts, start() directly sets publicDir and serveManager on the stored config object. Mutating config after construction is unexpected. Calling start() twice would permanently alter the stored config. Consider applying these defaults locally within the method rather than touching the stored config.

3. Module-level hasWarnedMissingEndpoint persists across test runs

The warning flag in src/client/config.ts fires at most once per process lifetime. In a test suite creating multiple clients without an endpoint, the warning only appears once, which may make the deprecation harder to notice during development.

4. Relative path for static file serving is cwd-dependent

In runtime/index.ts the static serving uses a relative publicDir path. If the server is started from outside the project root, static files will not be found even though existsSync passed. Consider resolving to an absolute path at startup.


Minor Observations

5. Suspicious cross-example rename in diff

The diff shows examples/trpc/src/actors.ts renamed to examples/hono/src/index.ts. This looks like a git rename detection artifact spanning two unrelated example directories. Worth verifying both trpc and hono examples are in their expected state.

6. Error messages reference setup() for size config keys

The updated error messages say to configure via setup() with maxIncomingMessageSize. Confirm this key is accessible via setup() and not only via the now-removed start() config.

7. hono example keeps two files alongside the new convention

The hono example still has src/server.ts alongside src/index.ts (intentional for the custom routing use case). A brief README note would help given CLAUDE.md now says single entry point.

8. No tests for registry.start() behavior

The driver test suite does not cover the new start() method - specifically the serveManager defaulting, publicDir defaulting, and remote endpoint detection branching. A test for the endpoint detection logic would add confidence.


Positive Highlights

  • Moving @hono/node-server and @hono/node-ws from peerDependencies to direct dependencies eliminates common setup friction for new users.
  • The deprecation warning with an explicit future version (2.2.0) gives users a clear migration timeline.
  • Removing vite-plugin-srvx and tsup from examples simplifies the toolchain considerably.
  • The Vite proxy config for /actors, /metadata, /health is applied consistently across all frontend examples.
  • Deleting config/legacy-runner.ts and LegacyStartServerOutput is a clean removal of accumulated technical debt.

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