Skip to content

Releases: hathora/builder

0.10.0

18 Oct 18:13
Compare
Choose a tag to compare
  • 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

12 Jun 21:49
Compare
Choose a tag to compare
  • 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

04 Jun 03:08
Compare
Choose a tag to compare
  • 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

05 Apr 13:12
Compare
Choose a tag to compare
  • 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