Skip to content
Merged

misc #302

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
10 changes: 10 additions & 0 deletions .changeset/hot-bugs-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"y-partyserver": minor
"partyserver": minor
"partysync": minor
"partywhen": minor
"partysub": minor
"partyfn": minor
---

change Env types to default to Cloudflare.Env
5 changes: 5 additions & 0 deletions .changeset/jolly-parents-win.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"y-partyserver": minor
---

remove chunking since cloudflare now supports much larger message sizes
2 changes: 1 addition & 1 deletion .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ jobs:

- uses: actions/setup-node@v4

- run: npm install
- run: npm ci
- run: npm run build
- run: npm run check
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
node-version: 24
cache: "npm"

- run: npm install
- run: npm ci
- run: npm run build

- id: changesets
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/configuration.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
about wrangler.toml, migrations, etc
about wrangler.jsonc, migrations, etc
79 changes: 0 additions & 79 deletions fixtures/chat/CHANGELOG.md

This file was deleted.

12 changes: 12 additions & 0 deletions fixtures/chat/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable */
// Generated by Wrangler by running `wrangler types env.d.ts --include-runtime false` (hash: 4be7c89dd974cd4ea4cbcfd4e801b52e)
declare namespace Cloudflare {
interface GlobalProps {
mainModule: typeof import("./src/server");
durableNamespaces: "Chat";
}
interface Env {
Chat: DurableObjectNamespace<import("./src/server").Chat>;
}
}
interface Env extends Cloudflare.Env {}
2 changes: 1 addition & 1 deletion fixtures/chat/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
</head>
<body class="prose" style="padding: 20px">
<div id="root" />
<script src="/src/client/index.tsx" type="module"></script>
<script src="/src/client.tsx" type="module"></script>
</body>
</html>
12 changes: 6 additions & 6 deletions fixtures/chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
"private": true,
"type": "module",
"scripts": {
"start": "vite dev"
"start": "vite dev",
"types": "wrangler types env.d.ts --include-runtime false"
},
"dependencies": {
"@tailwindcss/vite": "^4.1.18",
"nanoid": "^5.1.6",
"partyserver": "^0.0.78",
"partysocket": "^1.1.9",
"react": "^19.2.3",
"react-dom": "^19.2.3",
"tailwindcss": "^4.1.18",
"valibot": "^1.2.0"
"react-dom": "^19.2.3"
},
"devDependencies": {
"@tailwindcss/vite": "^4.1.18",
"@types/react": "^19.2.7",
"@types/react-dom": "^19.2.3"
"@types/react-dom": "^19.2.3",
"tailwindcss": "^4.1.18"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createRoot } from "react-dom/client";
import { nanoid } from "nanoid";
import { usePartySocket } from "partysocket/react";

import type { ChatMessage } from "../types";
import type { ChatMessage } from "./types";

import "./styles.css";

Expand Down
6 changes: 0 additions & 6 deletions fixtures/chat/src/client/tsconfig.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { routePartykitRequest, Server } from "partyserver";

import type { Connection, WSMessage } from "partyserver";

type Env = { Chat: DurableObjectNamespace<Chat> };
import { env } from "cloudflare:workers";

export class Chat extends Server {
static options = { hibernate: true };
Expand All @@ -14,7 +12,7 @@ export class Chat extends Server {
}

export default {
async fetch(request: Request, env: Env): Promise<Response> {
async fetch(request: Request): Promise<Response> {
return (
(await routePartykitRequest(request, env)) ||
new Response("Not Found", { status: 404 })
Expand Down
6 changes: 0 additions & 6 deletions fixtures/chat/src/server/tsconfig.json

This file was deleted.

File renamed without changes.
18 changes: 6 additions & 12 deletions fixtures/chat/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { literal, object, string } from "valibot";

import type { InferInput } from "valibot";

export const chatMessage = object({
type: literal("chat-message"),
id: string(),
content: string(),
sender: string()
});

export type ChatMessage = InferInput<typeof chatMessage>;
export type ChatMessage = {
type: "chat-message";
id: string;
content: string;
sender: string;
};
7 changes: 7 additions & 0 deletions fixtures/chat/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": ["@cloudflare/workers-types"],
"lib": ["DOM", "DOM.Iterable", "ESNext"]
}
}
3 changes: 2 additions & 1 deletion fixtures/chat/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { cloudflare } from "@cloudflare/vite-plugin";
import tailwindcss from "@tailwindcss/vite";
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import devtoolsJson from "vite-plugin-devtools-json";

export default defineConfig({
plugins: [cloudflare(), react(), tailwindcss()]
plugins: [cloudflare(), react(), tailwindcss(), devtoolsJson()]
});
8 changes: 0 additions & 8 deletions fixtures/chat/wrangler.json

This file was deleted.

20 changes: 20 additions & 0 deletions fixtures/chat/wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "partyserver-fixture-chat",
"main": "src/server.ts",
"compatibility_date": "2025-12-17",
"assets": { "directory": "./public" },
"durable_objects": {
"bindings": [
{
"name": "Chat",
"class_name": "Chat"
}
]
},
"migrations": [
{
"tag": "v1",
"new_sqlite_classes": ["Chat"]
}
]
}
79 changes: 0 additions & 79 deletions fixtures/globe/CHANGELOG.md

This file was deleted.

12 changes: 12 additions & 0 deletions fixtures/globe/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/* eslint-disable */
// Generated by Wrangler by running `wrangler types env.d.ts --include-runtime false` (hash: 8a9158374e5524d9d8082ee8c55b47aa)
declare namespace Cloudflare {
interface GlobalProps {
mainModule: typeof import("./src/server");
durableNamespaces: "Globe";
}
interface Env {
Globe: DurableObjectNamespace<import("./src/server").Globe>;
}
}
interface Env extends Cloudflare.Env {}
2 changes: 1 addition & 1 deletion fixtures/globe/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
</head>
<body>
<div id="root">Loading...</div>
<script type="module" src="/src/client/index.tsx"></script>
<script type="module" src="/src/client.tsx"></script>
</body>
</html>
3 changes: 2 additions & 1 deletion fixtures/globe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"version": "0.0.11",
"type": "module",
"scripts": {
"start": "vite dev"
"start": "vite dev",
"types": "wrangler types env.d.ts --include-runtime false"
},
"dependencies": {
"cobe": "^0.6.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import createGlobe from "cobe";
import usePartySocket from "partysocket/react";

// The type of messages we'll be receiving from the server
import type { OutgoingMessage } from "../types";
import type { OutgoingMessage } from "./types";
import type { LegacyRef } from "react";

function App() {
Expand Down
Loading