Skip to content

Simplify package module/type structure #237

Closed

Description

@jderochervlk

Summary

Pre-alpha breaking cleanup to simplify the package structure and make the public surface more consistent.

This issue tracks the refactor to:

  • rename root *API type-holder modules to *Types
  • keep the existing folder structure for concrete modules
  • export the primary concrete type as t
  • selectively re-export additional public helper types from the concrete module that uses them
  • remove unrelated open usage
  • remove trivial primitive aliases like string, bool, unit, and low-value callback aliases where they do not add meaning
  • remove window and navigator from Global without deleting Global
  • shift access toward owner modules such as Window, Navigator, History, Storage, Performance, and similar modules
  • avoid introducing any new include directives as part of the simplification

Out Of Scope

  • contributor docs
  • code-generation conventions
  • deleting Global
  • flattening the folder structure

Execution Order

Linked Issues

Acceptance Criteria

  • No root src/*API.res type-holder files remain; they are replaced by src/*Types.res.
  • The existing folder structure remains in place.
  • Each concrete module exports its main type as t.
  • Concrete modules selectively re-export secondary public types only where justified.
  • Unrelated open usage is removed.
  • No new include directives are introduced by this refactor.
  • Trivial primitive aliases are removed instead of being renamed or moved.
  • Global.window and Global.navigator are removed.
  • Source and tests stop depending on Global.window and Global.navigator.
  • The package passes npm run build and npm test after integration.

Activity

  1. jderochervlk commented on Nov 8, 2026

    @jderochervlk
    CollaboratorAuthor

    Rechecked after the alpha PRs merged, at main 844c32af. All six linked child issues are closed as completed, so their checklist entries are now up to date.

    Keeping this parent open because its requirement that each concrete module export its main type as t is not yet met. For example, Path2D returns CanvasTypes.path2D without exposing Path2D.t, and FontFace similarly lacks FontFace.t. DOMMatrix, DOMMatrixReadOnly and VideoFrame have the same gap.

    The child issue states alone are not enough to close this parent. The remaining public-type aliases need to be completed, or the acceptance criterion needs an explicit maintainer revision. This remains outside the required alpha scope in #382.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions