Skip to content

refactor: establish DOMNodes folder feature - #326

Open
jderochervlk wants to merge 1 commit into
codex/option5-cssom-folderfrom
codex/option5-dom-nodes-folder
Open

refactor: establish DOMNodes folder feature#326
jderochervlk wants to merge 1 commit into
codex/option5-cssom-folderfrom
codex/option5-dom-nodes-folder

Conversation

@jderochervlk

@jderochervlk jderochervlk commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Tracking issue: #342

Stack context

Part 16 of the Option 5 folder-feature stack.

Review this PR as the incremental diff against #325.

Summary

  • add the target src/dom-nodes folder on the unqualified internal DOMNodes feature
  • move the recursive node/tree, range, traversal, selection, element, and DOM implementation interfaces out of the legacy broad DOM folder
  • move the small HTML.res shadow-root/serialization options module with its direct Element and ShadowRoot consumers
  • add the supported WebAPI.DOMNodes feature
  • expose the previously internal AbstractRange, Attr, CDATASection, ProcessingInstruction, and StaticRange interface modules

Dependency direction

The compiler-derived closure is:

WebAPI.DOMNodes -> WebAPI.DOMPlatform + WebAPI.Animation + WebAPI.CSSOM + WebAPI.Geometry + DOMNodes

Animation 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

  • the qualified WebAPI.DOM source-feature collision remains until the legacy DOM folder is fully emptied
  • several node records still refer to foundational DOM.* compatibility types; final type ownership cleanup remains deferred
  • HTML.res is intentionally owned by DOMNodes because its option types are required there; the later HTML feature receives it transitively

Review focus

  • recursive DOMNodes folder membership and public interface completeness
  • the measured dependency closure
  • the placement of shared HTML serialization/shadow-root options

Verification

  • node_modules/.bin/rescript clean
  • node_modules/.bin/rescript build --prod --features DOM,Event,DOMPlatform,Animation,CSSOM,Geometry,DOMNodes
  • npm run build
  • npm test
  • npm run format:check
  • git diff --check

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread rescript.json
Comment on lines +49 to +51
"dir": "src/dom-nodes",
"subdirs": true,
"feature": "DOMNodes",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread rescript.json
Comment on lines +52 to +53
"public": [
"AbstractRange",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@jderochervlk
jderochervlk force-pushed the codex/option5-dom-nodes-folder branch from 8b79918 to 5ba391f Compare August 4, 2026 17:31
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