Skip to content

feat(webapi): isolate narrow touch and form data features [Codex] - #416

Merged
jderochervlk merged 4 commits into
feat/core-dom-element-typesfrom
feat/narrow-data-features
Nov 17, 2026
Merged

jderochervlk merged 4 commits into
feat/core-dom-element-typesfrom
feat/narrow-data-features

Conversation

@jderochervlk

Copy link
Copy Markdown
Collaborator

React bindings need clipboard data, touch lists, and FormData types without enabling the complete UIEvents and Fetch groups. Add four independently selectable features while retaining the existing broad features as compatibility umbrellas.

  • WebAPI.Touch owns Touch and TouchList and depends only on DOM.
  • WebAPI.FormData owns FormData and its unboxed entry-value union and depends only on DOM.
  • WebAPI.FileEntries moves the five existing legacy file-entry modules intact, preserving the API needed by webkitGetAsEntry without pulling in streams or modern filesystem handles.
  • WebAPI.DataTransfer owns the transfer/item/list modules and includes DOMTree and FileEntries, preserving setDragImage and webkitGetAsEntry at their existing public paths.

Small representations now belong to the existing public API modules. UiEventsTypes and FetchTypes retain representation/constructor re-exports; file/blob signatures use their equal DOM types. Basic DOM is unchanged. This adds no backing-holder modules and keeps existing public operation names, privacy, nullability, and unboxed representations.

Narrow dependency selection

With DOMTree + History + Location, adding Touch + DataTransfer + FormData compiles 27 WebAPI source modules, versus 102 with broad UIEvents + Fetch. Standalone Touch and FormData each compile five sources including DOM. These are compiler-inventory counts, not build-speed claims. FileList operations remain an explicit broader File opt-in; the optional separate FileList feature is not included.

The change includes narrow and packed-consumer fixtures, excluded-module checks, source-inventory assertions, legacy type/constructor interoperability, and native form-data/transfer/touch coverage. It does not replace React's boxed form-value variant with WebAPI's unboxed union.

Prerequisite

Stacked on #415. The new branch was created from current origin/main at 20d11da1 (including merged #413), then merged #415's prerequisite changes. This PR targets #415's branch to keep its review diff limited to the data-feature split; retarget to main after #415 merges.

Follow-on consumers are jderochervlk/rescript-react#1 and jderochervlk/rescript-react#2. Existing profiling results are not measurements of this new integration.

React's DOM bindings need element, history, and location types, but
History and Location currently belong to the Window feature. Selecting
those types therefore also compiles the broader Window dependency graph.

Add independent `WebAPI.History` and `WebAPI.Location` features and move
their source files into their own directories. History depends only on
the standard library; Location depends on core DOM. Window includes both
features, preserving existing module names and type identities.

Consumers can select `WebAPI.DOMNodes`, `WebAPI.History`, and
`WebAPI.Location` without enabling Window. The feature-ownership checks
register both new source groups and guard missing features and duplicate
public-module ownership. The API guide documents the narrower selection.

The compiler upgrade has already landed in #414. This branch now
incorporates that main-branch update and retains its compiler checks,
documentation renderer, and typed-array fixture. The remaining diff is
limited to the History/Location feature split, its documentation, and
feature validation.

The further selective DOMTree/CSS layout is separate in #415; the React
profiling and dependent JSX work remain in
jderochervlk/rescript-react#1 and
jderochervlk/rescript-react#2.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T12:21:00.634780Z 691bc3f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jderochervlk

Copy link
Copy Markdown
Collaborator Author

Subagent review completed against final head 691bc3f20dc5d621d22f5bf9931b4ec086542d5f: no blocking findings. The review independently checked type/constructor identities, record privacy and representations, unchanged FileEntries moves, preservation of every existing feature’s public-module set, and narrow source inventories. This was a read-only static review, not an independently rerun test suite.

Local validation passed: all 36 feature builds and narrow inventories, packed consumers and negative fixtures, runtime tests, all four Chromium tests, documentation build/link checks, and formatting. The review also covered the corrected fixtures: alpha.7 already accepts an empty record for the declared private FormData type, and programmatically created DataTransfer objects ignore drag-effect changes outside a native drag session. Both limitations are documented rather than treated as new binding defects.

@jderochervlk
jderochervlk merged commit 87695f1 into feat/core-dom-element-types Nov 17, 2026
4 checks passed
@jderochervlk
jderochervlk deleted the feat/narrow-data-features branch November 17, 2026 12:26
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