Skip to content

Commit

Permalink
merge: v0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
chase-moskal committed Oct 25, 2024
2 parents d0599eb + c409707 commit 73a4a0a
Show file tree
Hide file tree
Showing 24 changed files with 565 additions and 349 deletions.
32 changes: 32 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,38 @@

<br/>

## v0.3

### v0.3.0

- 🟥 WebSocketServer `acceptConnection` is now an async function
- 🟥 replaced `expose` function with similar new `endpoint` function
```ts
// OLD -- this is outdated
new HttpServer(expose(({headers}) => fns))

// NEW -- do it like this now
new HttpServer(({headers}) => endpoint(fns))
```
- this new design is cleaner, and non-http apis like postMessage don't need to pretend and pass fake headers like before
- we also removed the concept of an `Api` type and the `api` helper function
- if you were using `api`, you are now expected to roll-your-own, like this:
```ts
// OLD
const myApi = api(({headers}) => ({...myFunctions}))
new HttpServer(expose(myApi))

// NEW
import {ServerMetas} from "renraku"
const myApi = ({headers}: ServerMetas) => ({...myFunctions})
new HttpServer(meta => endpoint(myApi(meta)))
```
- 🟥 rename `maxPayloadBytes` to `maxRequestBytes`
- 🍏 new `PostMessenger` for bidirectional postmessage apis
- 🍏 add `timeout` for HttpServer and also WebSocketServer, defaults to 10 seconds.

<br/>

## v0.2

### v0.2.0
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
"homepage": "https://github.com/chase-moskal/renraku#readme",
"devDependencies": {
"@types/node": "^22.6.1",
"@types/node": "^22.7.9",
"@types/ws": "^8.5.12",
"cynic": "^0.2.1",
"es-module-shims": "^1.10.0",
Expand All @@ -61,7 +61,7 @@
"mkdirp": "^3.0.1",
"npm-run-all": "^4.1.5",
"rimraf": "^6.0.1",
"typescript": "^5.6.2"
"typescript": "^5.6.3"
},
"dependencies": {
"ws": "^8.18.0"
Expand Down
Loading

0 comments on commit 73a4a0a

Please sign in to comment.