Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/y-partyserver-cjs-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"y-partyserver": patch
---

Add CJS build output alongside ESM. The package now ships both `.js` (ESM) and `.cjs` (CJS) files with corresponding `.d.ts` and `.d.cts` type declarations.
10 changes: 5 additions & 5 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/partyfn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"dependencies": {
"nanoid": "^5.1.6",
"partysocket": "^1.1.15"
"partysocket": "^1.1.16"
},
"scripts": {
"build": "tsx scripts/build.ts"
Expand Down
2 changes: 0 additions & 2 deletions packages/partyserver/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,12 @@
### Patch Changes

- [`528adea`](https://github.com/threepointone/partyserver/commit/528adeaced6dce6e888d2f54cc75c3569bf2c277) Thanks [@threepointone](https://github.com/threepointone)! - some fixes and tweaks

- getServerByName was throwing on all requests
- `Env` is now an optional arg when defining `Server`
- `y-partyserver/provider` can now take an optional `prefix` arg to use a custom url to connect
- `routePartyKitRequest`/`getServerByName` now accepts `jurisdiction`

bonus:

- added a bunch of fixtures
- added stubs for docs

Expand Down
2 changes: 0 additions & 2 deletions packages/partysocket/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@
### Patch Changes

- [#251](https://github.com/partykit/partykit/pull/251) [`049bcac`](https://github.com/partykit/partykit/commit/049bcac42aa49e4bddec975c63b7d7984112e450) Thanks [@threepointone](https://github.com/threepointone)! - small tweaks to `init`

- replace `process.env.PARTYKIT_HOST` with just `PARTYKIT_HOST`
- add a `tsconfig.json`
- add partykit to devDependencies in `init`
Expand All @@ -340,7 +339,6 @@
- [#211](https://github.com/partykit/partykit/pull/211) [`fffe721`](https://github.com/partykit/partykit/commit/fffe72148e5cc425e80c90b6bf180192df410080) Thanks [@threepointone](https://github.com/threepointone)! - update dependencies

- [#191](https://github.com/partykit/partykit/pull/191) [`39cf5ce`](https://github.com/partykit/partykit/commit/39cf5cebf5e699bc50ace8b6d25cd82c807e863a) Thanks [@jevakallio](https://github.com/jevakallio)! - Improve PartySocket types and React hooks API:

- Add websocket lifecycle event handlers to usePartyKit options to reduce need for effects in userland
- Allow usePartySocket to provide startClosed option to initialize without opening connection
- Fix types for PartySocket#removeEventListener
Expand Down
2 changes: 1 addition & 1 deletion packages/partysub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20260303.0",
"partyserver": ">=0.3.1",
"partyserver": "^0.3.1",
"partysocket": "^1.1.16"
}
}
2 changes: 1 addition & 1 deletion packages/partysync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"devDependencies": {
"@cloudflare/workers-types": "^4.20260303.0",
"partyfn": "^0.1.0",
"partyserver": ">=0.3.1",
"partyserver": "^0.3.1",
"partysocket": "^1.1.16"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/partywhen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"description": "A library for scheduling and running tasks in Cloudflare Workers",
"dependencies": {
"cron-parser": "^5.5.0",
"partyserver": ">=0.3.1"
"partyserver": "^0.3.1"
}
}
4 changes: 0 additions & 4 deletions packages/y-partyserver/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
- [#341](https://github.com/cloudflare/partykit/pull/341) [`e7f4b51`](https://github.com/cloudflare/partykit/commit/e7f4b51198904273befb1d39478840c628f6e2b1) Thanks [@threepointone](https://github.com/threepointone)! - Fix Yjs hibernation support and awareness propagation

**Server:**

- Replace in-memory `WSSharedDoc.conns` Map with `connection.setState()` and `getConnections()` so connection tracking survives Durable Object hibernation
- Move event handler registration from `WSSharedDoc` constructor into `onStart()` to use `getConnections()` for broadcasting
- Disable awareness protocol's built-in `_checkInterval` in `WSSharedDoc` constructor to prevent timers from defeating hibernation
Expand All @@ -17,7 +16,6 @@
- Widen `onLoad()` return type to `Promise<YDoc | void>` to allow seeding the document from a returned YDoc

**Provider:**

- Switch awareness event listener from `"update"` to `"change"` so clock-only heartbeat renewals do not produce network traffic (allows DO hibernation during idle sessions)
- Disable awareness protocol's built-in `_checkInterval` on the client to stop 15-second clock renewals and 30-second peer timeout removal
- Remove provider's own `_checkInterval` liveness timer (was coupled to the awareness heartbeat)
Expand Down Expand Up @@ -352,14 +350,12 @@
### Patch Changes

- [`528adea`](https://github.com/threepointone/partyserver/commit/528adeaced6dce6e888d2f54cc75c3569bf2c277) Thanks [@threepointone](https://github.com/threepointone)! - some fixes and tweaks

- getServerByName was throwing on all requests
- `Env` is now an optional arg when defining `Server`
- `y-partyserver/provider` can now take an optional `prefix` arg to use a custom url to connect
- `routePartyKitRequest`/`getServerByName` now accepts `jurisdiction`

bonus:

- added a bunch of fixtures
- added stubs for docs

Expand Down
32 changes: 22 additions & 10 deletions packages/y-partyserver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,31 @@
"type": "module",
"exports": {
".": {
"types": "./dist/server/index.d.ts",
"require": "./dist/server/index.js",
"import": "./dist/server/index.js"
"types": {
"import": "./dist/server/index.d.ts",
"require": "./dist/server/index.d.cts",
"default": "./dist/server/index.d.ts"
},
"import": "./dist/server/index.js",
"require": "./dist/server/index.cjs"
},
"./provider": {
"types": "./dist/provider/index.d.ts",
"require": "./dist/provider/index.js",
"import": "./dist/provider/index.js"
"types": {
"import": "./dist/provider/index.d.ts",
"require": "./dist/provider/index.d.cts",
"default": "./dist/provider/index.d.ts"
},
"import": "./dist/provider/index.js",
"require": "./dist/provider/index.cjs"
},
"./react": {
"types": "./dist/provider/react.d.ts",
"require": "./dist/provider/react.js",
"import": "./dist/provider/react.js"
"types": {
"import": "./dist/provider/react.d.ts",
"require": "./dist/provider/react.d.cts",
"default": "./dist/provider/react.d.ts"
},
"import": "./dist/provider/react.js",
"require": "./dist/provider/react.cjs"
}
},
"scripts": {
Expand All @@ -52,7 +64,7 @@
"devDependencies": {
"@cloudflare/workers-types": "^4.20260303.0",
"@types/lodash.debounce": "^4.0.9",
"partyserver": ">=0.3.1",
"partyserver": "^0.3.1",
"ws": "^8.19.0",
"yjs": "^13.6.29"
},
Expand Down
7 changes: 5 additions & 2 deletions packages/y-partyserver/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ await build({
external: ["cloudflare:workers"],
sourcemap: true,
clean: true,
format: "esm",
format: ["esm", "cjs"],
dts: true,
skipNodeModulesBundle: true,
fixedExtension: false
});

// then run oxfmt on the generated .d.ts files
// then run oxfmt on the generated files
execSync("oxfmt ./dist/**/*.d.cts");
execSync("oxfmt ./dist/**/*.d.ts");
execSync("oxfmt ./dist/**/*.cjs");
execSync("oxfmt ./dist/**/*.js");

process.exit(0);
Loading