Repository navigation
refactor(webapi): move shared element types into core DOM [Codex] - #415
Draft
jderochervlk wants to merge 1 commit into
Draft
jderochervlk wants to merge 1 commit into
jderochervlk wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Stacked on #413.
Type-only consumers currently need the DOMNodes operation feature just to name an element. Move the concrete DOM-tree, stylesheet, collection, and style-declaration representations into the existing
WebAPI.DOMmodule. Keep the existing API modules and methods in place through representation-preserving aliases.This preserves public type identities, fields, generic parameters, mutability, privacy, and completion owners. The existing DOM and DOMTree slot-assignment variants remain distinct, including the inference behavior of unannotated
DOM.Manual/DOM.Named. Emitted JavaScript for all 338 source modules is unchanged.React can now select
WebAPI.DOM,WebAPI.History, andWebAPI.Location: 6 WebAPI source modules instead of 59. In a fresh five-run comparison, its median clean build fell from 182.26 ms to 145.13 ms. The dependent React change and full raw results belong to jderochervlk/rescript-react#1.Performance tradeoff
Core now contains more type information. Small standalone DOM, Location, URL, and Fetch consumers had clean-build median increases of approximately 24–32 ms (27–32%) in the same experiment. Keeping React on its old 59-module feature selection also increased its median from 182.26 ms to 215.19 ms. Fewer modules is not an across-the-board compiler optimization; this draft makes the type-ownership/performance tradeoff explicit for review.
Style-input and synthetic-event ownership changes are not included. The live CSSStyleDeclaration representation remains distinct from React style props.