refactor: establish DOMNodes folder feature - #326
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b79918593
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "dir": "src/dom-nodes", | ||
| "subdirs": true, | ||
| "feature": "DOMNodes", |
There was a problem hiding this comment.
Preserve DOMNodes in the WebAPI.DOM feature closure
When a consumer enables WebAPI.DOM—or another feature such as WebAPI.Event that depends on it—the feature closure still contains only DOM, while the selected src/DOM sources continue to import modules moved behind DOMNodes (for example, Document.res imports Node, DOMTree, HTMLCollection, Range, and Selection). Those selective builds can therefore no longer resolve the moved modules; the split needs to preserve these dependencies in the existing feature closure or wait until the remaining DOM consumers move as well.
Useful? React with 👍 / 👎.
| "public": [ | ||
| "AbstractRange", |
There was a problem hiding this comment.
Register the new source directory with the docs generator
Running npm run build:docs invokes prebuild:docs, whose docs/llm.js looks up every public source directory in scripts/unmonorepo/feature-spec.mjs and throws Unsupported source directory when no matching dirName exists. That table has DOM but no dom-nodes, so encountering any of these newly public files makes the documentation build fail; add metadata for this directory or make the generator derive it from rescript.json.
Useful? React with 👍 / 👎.
8b79918 to
5ba391f
Compare
Tracking issue: #342
Stack context
Part 16 of the Option 5 folder-feature stack.
Review this PR as the incremental diff against #325.
Summary
src/dom-nodesfolder on the unqualified internalDOMNodesfeatureHTML.resshadow-root/serialization options module with its direct Element and ShadowRoot consumersWebAPI.DOMNodesfeatureAbstractRange,Attr,CDATASection,ProcessingInstruction, andStaticRangeinterface modulesDependency direction
The compiler-derived closure is:
WebAPI.DOMNodes -> WebAPI.DOMPlatform + WebAPI.Animation + WebAPI.CSSOM + WebAPI.Geometry + DOMNodesAnimation and CSSOM are required by public Element, ShadowRoot, ProcessingInstruction, and recursive DOMTree signatures. Keeping those dependencies explicit avoids module slices and produces an acyclic graph.
Temporary state
WebAPI.DOMsource-feature collision remains until the legacy DOM folder is fully emptiedDOM.*compatibility types; final type ownership cleanup remains deferredHTML.resis intentionally owned by DOMNodes because its option types are required there; the later HTML feature receives it transitivelyReview focus
Verification
node_modules/.bin/rescript cleannode_modules/.bin/rescript build --prod --features DOM,Event,DOMPlatform,Animation,CSSOM,Geometry,DOMNodesnpm run buildnpm testnpm run format:checkgit diff --check