Web API Feature Grouping #292
jderochervlk
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Context
This repository needs a feature and module structure that balances:
The four options under discussion are:
WebAPI.Types.module gets its own feature. Grouping supporting types would reduce this.
The counts are approximate design counts. They depend on whether supporting
types are public and how aggressively interfaces are split into independent
features.
Option 1: Domain-Oriented Grouping
This is the domain-oriented structure that implementation has started to
explore. Feature boundaries follow folders such as:
WebAPI.DOM,WebAPI.HTML,WebAPI.Window,WebAPI.Fetch,WebAPI.WebAudio, and so on.Example
Feature Contents
WebAPI.DOMcontains foundational DOM types such asdocument,window,event, andeventTarget.WebAPI.WindowcontainsWindowplus closely related browser entry pointssuch as
Document,Location,History,Navigator, andMediaQueryList.WebAPI.FetchcontainsFetch,Request,Response,Headers, andFormData.WebAPI.EventcontainsEvent,EventTarget,AbortController, andrelated event types.
Pros
Cons
Window,Document, and DOM types are split across related features.DOM.rescan become a catch-all dependency.Option 2: MDN API Categories
Features follow MDN API landing pages. The HTML DOM category is one
WebAPI.DOMfeature with nested public modules:The remaining features follow categories such as
WebAPI.Fetch,WebAPI.WebSockets,WebAPI.IndexedDB,WebAPI.WebAudio, andWebAPI.ViewTransitions.If a dedicated base type file is created, shared types live in a separate
WebAPI.Typesfeature. Types in the existingDOM.resstay withWebAPI.DOMunless they are deliberately identified as cross-feature base types.
Feature Contents
WebAPI.DOMcontains the complete HTML DOM category. Its public modulesinclude
DOM.Window,DOM.Document,DOM.Location,DOM.History,DOM.Element, and theDOM.HTML*Elementmodules.WebAPI.Fetchcontains the Fetch API family:Fetch,Request,Response,Headers, andFormData.WebAPI.Eventscontains general event interfaces and related event types;specialized input events may remain in
WebAPI.UIEvents.WebAPI.Types, if created, contains only shared representations that must beconsumed by multiple features.
Pros
WebAPI.DOM.Windowmakes the category relationship explicit.Cons
WebAPI.Typesboundary still needs a deliberate type classification.Option 3: MDN Interface Families
Each MDN interface family becomes a feature. Members remain under their
interface:
For example,
Window,Document,Request,Response,CanvasRenderingContext2D, andAudioContexteach own their members andclosely related types.
Feature Contents
WebAPI.Windowcontains only theWindowinterface and its properties,methods, and events.
Location,History, andDocumentare separatefeatures.
WebAPI.ResponsecontainsResponseand response-specific supportingtypes;
Request,Headers, andFormDataare separate features.WebAPI.Eventcontains the baseEventinterface and its members.KeyboardEvent,MouseEvent,PointerEvent, and other specialized eventseach have their own features.
WebAPI.DOMorWebAPI.Typesis not required as a broad owner; shared typesneed an explicit interface owner or a dedicated base feature.
Pros
Cons
Option 4: Domain Features With Interface Modules
Feature boundaries follow the larger domains from Option 1, but each feature is
organized internally around MDN-style interface modules. The feature owns the
dependency boundary; the modules retain clear interface ownership.
Feature Contents
WebAPI.DOMcontains interface modules forWindow,Document,Node,Element, and HTML element interfaces.WindowownsLocation,History,and related browser entry-point interfaces where appropriate.
WebAPI.Fetchcontains separateRequest,Response,Headers, andFormDatamodules, but they are distributed as one feature dependency.WebAPI.EventcontainsEvent,EventTarget,KeyboardEvent,MouseEvent,PointerEvent, and related event modules.interface-oriented modules.
Pros
interface.
Cons
Responsewithout depending on all ofWebAPI.Fetch.granular than Option 3.
Questions For Discussion
WebAPI.DOM.Windowor shouldWindowremain a top-levelWebAPI.Windowmodule?DOM.resintoTypes.res?discoverability, or interface ownership?
features as in Option 4?
Beta Was this translation helpful? Give feedback.
All reactions