Skip to content

refactor Location#286

Open
jderochervlk wants to merge 2 commits into
codex/event-api-splitfrom
refactor-location
Open

refactor Location#286
jderochervlk wants to merge 2 commits into
codex/event-api-splitfrom
refactor-location

Conversation

@jderochervlk

@jderochervlk jderochervlk commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Refactor Location to align with simplifying DOM and reducing module dependencies. Location is a good example of something that can be isolated and not included in DOM as a base type. Window and Document remain large, but libraries probably won't need them.

  • Remove location from DOM and DomTypes
  • Add location to Document
  • Add Location.t

@tsnobip

tsnobip commented Jul 9, 2026

Copy link
Copy Markdown
Member

@jderochervlk same comment as in #288, what's the motivation here? I think the main goal of our work now should be to have the most common types inside the Base feature so dependent packages like @rescript/react-dom remain light and it looks like you're going in the opposite direction. I'd do the other way around and see what's needed to have @rescript/react-dom depend only on Base feature. Secondary goals could be to set up features' dependencies and to make the DOM feature less bloated (but I'm not sure this is something we could do while sticking to the same structure as on MDN).

@jderochervlk

jderochervlk commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator Author

@jderochervlk same comment as in #288, what's the motivation here? I think the main goal of our work now should be to have the most common types inside the Base feature so dependent packages like @rescript/react-dom remain light and it looks like you're going in the opposite direction. I'd do the other way around and see what's needed to have @rescript/react-dom depend only on Base feature. Secondary goals could be to set up features' dependencies and to make the DOM feature less bloated (but I'm not sure this is something we could do while sticking to the same structure as on MDN).

rescript-react does not depend on Location, so by moving this out it removes that from DOM.

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

I don't think we'll need to keep the Base feature and can just have DOM serve as the base feature once the file is small enough.

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.

2 participants