Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions examples/chat-room/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,13 @@ npm run dev
Open your browser to `http://localhost:3000` to use the web chat interface.

#### CLI Interface

Alternatively, use the CLI interface:

```sh
npm run dev:cli
```

Or connect programmatically:

```sh
tsx src/scripts/connect.ts
```

## Features

- Real-time messaging with automatic persistence
Expand All @@ -54,4 +49,4 @@ tsx src/scripts/connect.ts

## License

Apache 2.0
Apache 2.0
8 changes: 4 additions & 4 deletions examples/chat-room/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
"@vitejs/plugin-react": "^4.2.0",
"concurrently": "^8.2.2",
"prompts": "^2.4.2",
"rivetkit": "workspace:*",
"tsx": "^3.12.7",
"typescript": "^5.5.2",
"vite": "^5.0.0",
"vitest": "^3.1.1"
},
"dependencies": {
"vitest": "^3.1.1",
"@rivetkit/react": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"dependencies": {
"rivetkit": "workspace:*"
},
"stableVersion": "0.8.0"
}
1 change: 1 addition & 0 deletions examples/chat-room/src/backend/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ import { registry } from "./registry";
registry.start({
cors: {
origin: "http://localhost:5173",
credentials: true,
},
});
4 changes: 2 additions & 2 deletions examples/chat-room/src/frontend/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createClient, createRivetKit } from "@rivetkit/react";
import { useEffect, useState } from "react";
import type { Message, registry } from "../backend/registry";

const client = createClient<typeof registry>("http://localhost:8080");
const client = createClient<typeof registry>("http://localhost:6420");
const { useActor } = createRivetKit(client);

export function App() {
Expand Down Expand Up @@ -97,4 +97,4 @@ export function App() {
</div>
</div>
);
}
}
2 changes: 1 addition & 1 deletion examples/chat-room/src/frontend/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ createRoot(root).render(
<StrictMode>
<App />
</StrictMode>
);
);
2 changes: 1 addition & 1 deletion examples/chat-room/src/scripts/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ async function main() {
const { username, room } = await initPrompt();

// Create type-aware client
const client = createClient<typeof registry>("http://localhost:8080");
const client = createClient<typeof registry>("http://localhost:6420");

// connect to chat room
const chatRoom = client.chatRoom.getOrCreate([room]).connect();
Expand Down
30 changes: 0 additions & 30 deletions examples/chat-room/src/scripts/connect.ts

This file was deleted.

3 changes: 3 additions & 0 deletions examples/chat-room/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ import { defineConfig } from "vite";
export default defineConfig({
plugins: [react()],
root: "src/frontend",
server: {
port: 5173,
},
});
10 changes: 6 additions & 4 deletions packages/cloudflare-workers/src/actor-handler-do.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import type { ExecutionContext } from "hono";
import invariant from "invariant";
import type { ActorKey, ActorRouter, Registry, RunConfig } from "rivetkit";
import { createActorRouter, createClientWithDriver } from "rivetkit";
import type { ActorDriver, ManagerDriver } from "rivetkit/driver-helpers";
import { serializeEmptyPersistData } from "rivetkit/driver-helpers";
import type { ActorDriver } from "rivetkit/driver-helpers";
import {
type ManagerDriver,
serializeEmptyPersistData,
} from "rivetkit/driver-helpers";
import { promiseWithResolvers } from "rivetkit/utils";
import {
CloudflareDurableObjectGlobalState,
Expand Down Expand Up @@ -60,8 +63,7 @@ export function createActorDurableObject(
*/
return class ActorHandler
extends DurableObject<Bindings>
implements ActorHandlerInterface
{
implements ActorHandlerInterface {
#initialized?: InitializedData;
#initializedPromise?: ReturnType<typeof promiseWithResolvers<void>>;

Expand Down
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading