refactor: restructure Event and related files#282
Open
jderochervlk wants to merge 23 commits into
Open
Conversation
jderochervlk
commented
Jul 6, 2026
jderochervlk
commented
Jul 6, 2026
jderochervlk
commented
Jul 6, 2026
| */ | ||
| @editor.completeFrom(BaseCSSFontLoading.FontFaceSet) | ||
| type rec fontFaceSet = private { | ||
| ...BaseEvent.eventTarget, |
Collaborator
Author
There was a problem hiding this comment.
This was just spreading an empty object and creating a circular dependency.
jderochervlk
commented
Jul 6, 2026
Comment on lines
+30
to
+32
| @editor.completeFrom(Window) | ||
| type window = private {} | ||
| external window: window = "window" |
Collaborator
Author
There was a problem hiding this comment.
Adding this here allows accessing the window using DOM.window instead of Window.current.
jderochervlk
commented
Jul 6, 2026
…ntal-rescript-webapi into codex/event-api-split
This was referenced Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This started out as having AI try and re-approach the changes to my earlier PR, but it quickly failed to really grasp what I was trying to do. I took what it started to do and did a refactor without AI and I think it's finally moving into the right direction.
This removes the
BaseTypes.resfile to simplify and make what is shown in the IDE more consistent, for example you will always seeDOM.eventinstead ofBaseEvent.torEvent.t = private BaseEvent.t. I also removed thetalias in the event files. At first this seemed like a good idea so we could haveEvent.tinstead ofDOM.event, but it leads to more dependencies back toEventwhich we want to avoid. Now everywhere just referencesDOM.event.After this PR I think that these are the next steps:
DOM.reswill continue to evolve to be the file that just about everything depends on.DomGlobal.reswill go away. It's not useful to just have everything globally available with slighly different bindings when we can just useDOM.window->Window.scrollbarsinstead ofDomGlobal.scrollbars. This means we can share bindings and also add inSelf.scrollbarsetc...DomTypeswill go away and be combined withDOMand spread out across modules betterDOMcan be reduced in size by moving more out of it, such aslocationandnavigator. These are modules that can be accessed by getting them from the module directly or fromWindowif needed.DOMshould just be the essentials and mostly types.