|
| 1 | +# Changelog |
| 2 | + |
| 3 | +## Unreleased |
| 4 | + |
| 5 | +- `rivetkit` no longer exposes `ctx.sql` on actor contexts. Migrate raw SQLite calls to `ctx.db` from `rivetkit/db`, and keep Drizzle setup on the `rivetkit/db/drizzle` subpath. |
| 6 | + |
| 7 | + Migration example: |
| 8 | + |
| 9 | + ```ts |
| 10 | + import { db } from "rivetkit/db"; |
| 11 | + |
| 12 | + const myActor = actor({ |
| 13 | + db: db(), |
| 14 | + actions: { |
| 15 | + listTodos: async (ctx) => { |
| 16 | + return await ctx.db.execute("SELECT * FROM todos ORDER BY created_at DESC"); |
| 17 | + }, |
| 18 | + }, |
| 19 | + }); |
| 20 | + ``` |
| 21 | + |
| 22 | +- `rivetkit` no longer exports the old concrete typed error classes from `rivetkit/actor/errors` such as `QueueFull`, `ActorNotFound`, and `ActionTimedOut`. The native runtime now standardizes on `RivetError` plus `group` and `code` so the same error shape survives HTTP, WebSocket, and bridge boundaries instead of depending on `instanceof` across runtimes. |
| 23 | + |
| 24 | + Migration example: |
| 25 | + |
| 26 | + ```ts |
| 27 | + try { |
| 28 | + await actor.someAction(); |
| 29 | + } catch (e) { |
| 30 | + if (e instanceof QueueFull) { |
| 31 | + // old path |
| 32 | + } |
| 33 | + |
| 34 | + if (isRivetErrorCode(e, "queue", "full")) { |
| 35 | + // new path |
| 36 | + } |
| 37 | + } |
| 38 | + ``` |
| 39 | + |
| 40 | + Common replacements: |
| 41 | + |
| 42 | + | Removed class | Use now | |
| 43 | + | --------------------------------- | ------------------------------------------------- | |
| 44 | + | `QueueFull` | `isRivetErrorCode(e, "queue", "full")` | |
| 45 | + | `QueueMessageTooLarge` | `isRivetErrorCode(e, "queue", "message_too_large")` | |
| 46 | + | `QueueMessageInvalid` | `isRivetErrorCode(e, "queue", "message_invalid")` | |
| 47 | + | `QueuePayloadInvalid` | `isRivetErrorCode(e, "queue", "invalid_payload")` | |
| 48 | + | `QueueCompletionPayloadInvalid` | `isRivetErrorCode(e, "queue", "invalid_completion_payload")` | |
| 49 | + | `QueueAlreadyCompleted` | `isRivetErrorCode(e, "queue", "already_completed")` | |
| 50 | + | `ActionTimedOut` | `isRivetErrorCode(e, "action", "timed_out")` | |
| 51 | + | `ActionNotFound` | `isRivetErrorCode(e, "action", "not_found")` | |
| 52 | + | `ActorNotFound` | `isRivetErrorCode(e, "actor", "not_found")` | |
| 53 | + | `ActorStopping` | `isRivetErrorCode(e, "actor", "stopping")` | |
| 54 | + | `ActorAborted` | `isRivetErrorCode(e, "actor", "aborted")` | |
| 55 | + | `IncomingMessageTooLong` | `isRivetErrorCode(e, "message", "incoming_too_long")` | |
| 56 | + | `OutgoingMessageTooLong` | `isRivetErrorCode(e, "message", "outgoing_too_long")` | |
| 57 | + | `InvalidEncoding` | `isRivetErrorCode(e, "encoding", "invalid")` | |
| 58 | + | `InvalidRequest` | `isRivetErrorCode(e, "request", "invalid")` | |
| 59 | + | `InvalidQueryJSON` | `isRivetErrorCode(e, "request", "invalid_query_json")` | |
| 60 | + | `RequestHandlerNotDefined` | `isRivetErrorCode(e, "handler", "request_not_defined")` | |
| 61 | + | `WebSocketHandlerNotDefined` | `isRivetErrorCode(e, "handler", "websocket_not_defined")` | |
| 62 | + | `FeatureNotImplemented` | `isRivetErrorCode(e, "feature", "not_implemented")` | |
| 63 | + | `Unsupported` | `isRivetErrorCode(e, "feature", "unsupported")` | |
| 64 | + |
| 65 | + Keep catching `UserError` when you intentionally throw user-facing application errors yourself. The removal only affects the built-in typed subclasses that used to wrap framework/runtime failures. |
| 66 | + |
| 67 | +- Restored `Registry.handler(request)` and `Registry.serve()` for the native serverless runner endpoint described in `.agent/specs/serverless-restoration.md`. The route surface is `/api/rivet`, `/api/rivet/health`, `/api/rivet/metadata`, and `/api/rivet/start`; user traffic still goes through the Rivet Engine gateway. |
| 68 | +- `Registry.start()` now starts the native envoy path only. Built-in `staticDir` serving is not wired through the native engine subprocess yet and remains a follow-up. |
| 69 | +- Restored the supported `rivetkit/test`, `rivetkit/inspector`, and `rivetkit/inspector/client` entrypoints. `rivetkit/test` now waits for the native envoy metadata endpoint instead of the removed TypeScript in-memory runtime. |
| 70 | +- Restored the zero-runtime `*ContextOf` helper types on the root `rivetkit` export so patterns like `ActionContextOf<typeof myActor>` work again. `PATH_CONNECT`, `PATH_WEBSOCKET_PREFIX`, `KV_KEYS`, `ActorKv`, `ActorInstance`, `ActorRouter`, `createActorRouter`, and `routeWebSocket` stay removed. |
| 71 | +- `rivetkit/driver-helpers` and `rivetkit/driver-helpers/websocket` stay removed. They only exposed internal runtime/router helpers; migrate to the public `rivetkit`, `rivetkit/client`, and engine-client APIs instead of importing package internals. |
| 72 | +- `rivetkit/topologies/*` stays removed. The topology helpers are deleted on this branch; keep custom coordinate/partition logic in app code if you still need it. |
| 73 | +- `rivetkit/dynamic` and `rivetkit/sandbox/*` stay permanently removed on this branch. There is no in-package replacement, so move those integrations out of `rivetkit` imports instead of waiting for a hidden subpath to come back. |
0 commit comments