Skip to content

refactor: move CSS and stylesheets out of DOM - #288

Merged
jderochervlk merged 1 commit into
mainfrom
refactor-css
Aug 7, 2026
Merged

refactor: move CSS and stylesheets out of DOM#288
jderochervlk merged 1 commit into
mainfrom
refactor-css

Conversation

@jderochervlk

@jderochervlk jderochervlk commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Tracking issue: #342

Summary

  • move the concrete CSSStyleDeclaration.t record out of broad DOM and into its owning module
  • add StyleSheet as the owner of the stylesheet, CSS stylesheet, CSS rule, rule-list, initialization, and stylesheet operation types
  • replace the prior CSSStyleSheet feature member with StyleSheet
  • update dependent CSSOM, DOM, HTML, and SVG bindings to use the extracted types

Temporary state

  • no compatibility module introduced by the current 16-PR stack remains after this layer
  • CSS-related modules are still physically located under the broad DOM source folder, and the public feature configuration is still only the initial slice
  • the follow-up Option 5 stack will establish the CSSOM folder feature, reorganize the remaining source folders, and complete the 27 public feature definitions

Review focus

  • the intentional stylesheet module-ownership change
  • completeness of the CSS and stylesheet extraction from DOM
  • correctness of updated cross-interface references

Verification

  • npm run build
  • npm test
  • npm run format:check

@tsnobip

tsnobip commented Jul 9, 2026

Copy link
Copy Markdown
Member

@jderochervlk what's the motivation here? Make Base feature lighter and move it to DOM feature? IMO DOM feature (not DOM.res) is already quite big in itself plus you have to take into account its feature dependencies, it's likely around 90% of the whole project right now.

@jderochervlk

jderochervlk commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

@jderochervlk what's the motivation here? Make Base feature lighter and move it to DOM feature? IMO DOM feature (not DOM.res) is already quite big in itself plus you have to take into account its feature dependencies, it's likely around 90% of the whole project right now.

I'm trying to slim down DOM.res as much as possible, you can see a larger lift in that direction on this PR: #287

DOM.res should eventually become DOM the feature, which should be lightweight. Not every project will need style sheet and CSS, so by moving this out you make using it opt in.

@jderochervlk jderochervlk changed the title move CSS and stylesheets out of DOM refactor: move CSS and stylesheets out of DOM Aug 3, 2026
@jderochervlk
jderochervlk changed the base branch from refactor-document to codex/dom-types-cleanup August 3, 2026 18:39

Copy link
Copy Markdown
Collaborator Author

@codex

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 7f73a98ef7

ℹ️ 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".

@jderochervlk
jderochervlk force-pushed the refactor-css branch 3 times, most recently from f40f9c0 to 8778b35 Compare August 5, 2026 12:31
@jderochervlk
jderochervlk force-pushed the refactor-css branch 2 times, most recently from 9397ea5 to cb8276a Compare August 5, 2026 13:40
@jderochervlk
jderochervlk force-pushed the refactor-css branch 4 times, most recently from ff94c26 to f1e6e83 Compare August 5, 2026 14:50
Base automatically changed from codex/dom-types-cleanup to main August 7, 2026 14:03
jderochervlk added a commit that referenced this pull request Aug 7, 2026
Tracking issue: #342

## Summary

- replace the temporary `DOMTree` aliases from #301 with the concrete
recursive interface family
- move the remaining shared non-tree types into `DOM`
- update residual DOM, Canvas, observer, UI event, WebAudio, and test
consumers
- delete `DomTypes` and `MutationObserverTypes`

## Temporary state

- this PR removes the compatibility scaffolding accumulated by #301
through #308; no `DomTypes`, `MutationObserverTypes`, or alias-backed
`DOMTree` layer remains after it
- CSS and stylesheet types remain in broad `DOM` for one final layer;
#288 moves them to their owning modules
- physical source-folder ownership is still temporary until the
follow-up Option 5 folder/feature stack

## Review focus

- correctness of the concrete recursive DOM type graph
- residual consumer migrations and the absence of deleted compatibility
references
- whether the large change remains behavior-neutral despite needing to
land atomically

## Verification

- `npm run build`
- `npm test`
- `npm run format:check`
@jderochervlk
jderochervlk merged commit 6819faa into main Aug 7, 2026
jderochervlk added a commit that referenced this pull request Aug 7, 2026
Tracking issue: #342

## Stack context

Part 1 of the Option 5 folder-feature stack.

- Previous: #288
- Next: #312 (Event folder feature)

Review this PR as the incremental diff against #288. It begins the
structural stack after the flat interface/type extraction is complete.

## Summary

- rename `src/Base` to the target `src/core` folder
- move `EventType.res` into `core` beside the foundational event types
in `DOM.res`
- make the internal `DOM` feature include the complete `core` folder
- simplify `WebAPI.DOM` to imply only the `DOM` folder feature
- remove the one-file `EventType` feature slice and the exclusion
required by the Event folder

Public module paths remain `WebAPI.DOM` and `WebAPI.EventType`.

## Temporary state

- the legacy `BaseFile`, `BaseFileAndDirectoryEntries`,
`BaseCSSFontLoading`, and `BaseEncryptedMediaExtensions` helpers remain
in `core` for now; later File, CSSFontLoading, and Media layers will
move or replace them in their owning folders
- the existing broad `src/DOM` source entry is still tagged as
`WebAPI.DOM`; later DOM platform/node, HTML, Window, CSSOM, Geometry,
SVG, Animation, Navigator, and Canvas layers will split it into
unqualified folder features
- because of that legacy source entry, the qualified public `WebAPI.DOM`
selective build is not yet the final light bundle; the internal `DOM`
folder feature itself compiles independently in this layer

## Review focus

- whether `EventType` belongs in the foundational core needed by
`DOM.EventListener`
- removal of the module-slice exception without changing public module
names
- preservation of source behavior across the folder rename

## Verification

- `node_modules/.bin/rescript clean`
- `node_modules/.bin/rescript build --prod --features DOM`
- `npm run build`
- `npm test`
- `npm run format:check`
- `git diff --check`
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.

3 participants