Skip to content

lib/events.ts Event has drifted from the server type #71

Description

@duxi90

lib/events.ts declares a client-safe Event interface presented as the mirror of the one in lib/events-server.ts, but it has fallen behind. Missing fields:

  • speakers
  • status
  • startDateTime
  • endDateTime
  • createdAt

Nothing is broken today because every consumer of those fields is a server component reading getEventBySlug / getAllEventsServer directly. The hazard is silent: the first client component to type its props with the lib/events.ts Event gets a type that compiles and is wrong.

Fix

Derive the client type from the server one rather than restating it, e.g. a Pick/Omit over the server interface with Temporal fields mapped to strings, so drift becomes a compile error instead of a latent gap.

Noticed while wiring event.speakers into components/event-speakers.tsx — the component imports EventSpeaker from lib/speakers.ts rather than the client Event for exactly this reason.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions