Releases: hathora/builder
Releases · hathora/builder
0.10.0
- Update events API and allow defining event types inside
hathora.yml
(#418)
# hathora.yml
types:
SomeType:
foo: string
events:
myEvent: SomeType
myOtherEvent: int
// server
ctx.sendEvent(HathoraEvents.myEvent, {foo: "bar"}, userId)
// client
export type HathoraEvent = {type: HathoraEvent.myEvent; val: SomeType} | {type: HathoraEvent.myEvent; val: SomeOtherType}
Breaking: If you were using ctx.sendEvent()
/ctx.broadcastEvent()
previously, you'll either need to define an events
block or migrate to using the new default ctx.broadcastEvent(HathoraEventTypes.default, "stringEventData")
Thanks @IanSSenne for the contribution!
0.9.0
- Allow customizing start + build commands for custom UIs (#305)
Migrating: make sure to add a start
and build
script to package.json
if using a custom UI. Example using Vite:
"scripts": {
"start": "vite",
"build": "vite build"
}
If using Vite, add a vite.config.ts
in package root (example)
0.8.0
- hathora cloud apis (
hathora cloud --help
)
- new
connect
signature (#297)
const connection = await client.connect(token, stateId);
connection.onUpdate(handleUpdate);
connection.onError(handleError);
0.7.0
- New
initialize
signature (removed userId
and added args
)
initialize(ctx: Context, request: IInitializeRequest): InternalState {
- New client method signatures (
connectNew
-> create
, connectExisting
-> connect
)
- Protocol updates and improvements