Skip to content

[codex] split Event owner types#282

Draft
jderochervlk wants to merge 5 commits into
mainfrom
codex/event-api-split
Draft

[codex] split Event owner types#282
jderochervlk wants to merge 5 commits into
mainfrom
codex/event-api-split

Conversation

@jderochervlk

@jderochervlk jderochervlk commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

This extracts the Event-focused portion of PR #270 into a smaller change set.

  • Move public Event APIs toward owner modules with Event.t, EventTarget.t, AbortSignal.t, and ExtendableEvent.t.
  • Split event name variants into the public EventType module and update call sites.
  • Update dependent Web API type records that spread or reference Event shapes to use the new public owner types.
  • Update ReScript to the v13 prerelease required by the source shape and adjust iterable return/test usage for ReScript 13.

Why

PR #270 is broad. This PR isolates the Event changes so the Event owner/type-shape updates can be reviewed independently.

Usage Examples

Event names

Before:

let click: EventTypes.eventType = EventTypes.Click
let custom: EventTypes.eventType = EventTypes.Custom("custom-event")

After:

let click: EventType.t = EventType.Click
let custom: EventType.t = EventType.Custom("custom-event")

Event values and listeners

Before:

let event: EventTypes.event = Event.make(~type_="click")
let target: EventTypes.eventTarget = EventTarget.make()

target->EventTarget.addEventListener(EventTypes.Click, (event: EventTypes.event) => {
  event->Event.preventDefault
})

After:

let event: Event.t = Event.make(~type_="click")
let target: EventTarget.t = EventTarget.make()

target->EventTarget.addEventListener(EventType.Click, (event: Event.t) => {
  event->Event.preventDefault
})

Types that include event behavior

Before:

type messagePort = private {
  ...EventTypes.eventTarget,
}

type storageEvent = private {
  ...EventTypes.event,
}

After:

type messagePort = private {
  ...EventTarget.t,
}

type storageEvent = private {
  ...Event.t,
}

Validation

  • npm run build
  • npm test

@jderochervlk jderochervlk changed the base branch from main to codex/event-api-split-without-rescript-13 June 26, 2026 17:33
@jderochervlk jderochervlk changed the base branch from codex/event-api-split-without-rescript-13 to main June 26, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant