Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds discriminated union for VTree (VComp | VNode | VText) #851

Merged
merged 2 commits into from
Apr 3, 2025

Conversation

dmjio
Copy link
Owner

@dmjio dmjio commented Apr 3, 2025

  • RefinesVTree to VComp | VNode | VText
  • Adjust hydrate.ts / dom.ts to reflect types (as cast)
  • Adds smart constructor for VComp (vcomp)
  • Removes unsafe domRef: any in favor of union type DOMRef = HTML | SVG | MathML
  • Refines vcomp tag to 'div' (always) and domRef: HTMLElement (always)
  • Refines domRef to Text for VText
  • Adjusts tests to use vcomp smart constructor
  • Adds "ns" field for VText, Haskell side.
  • Refines mount callback to VComp in dom.ts
  • Factors out preamble function for pre-walk activities in hydration.ts
  • Intros and exports NS type 'html' | 'svg' | 'mathml'

dmjio added 2 commits April 2, 2025 20:18
- Refines VTree to VComp | VNode | VText
- Adjust hydrate.ts / dom.ts to reflect types (as cast)
- Adds smart constructor for VComp (vcomp)
- Removes unsafe 'domRef: any' in favor of union DOMRef (HTML | SVG | MATHML)
- Refines vcomp tag to 'div' (always) and domRef: HTMLElement (always)
- Refines domRef to Text for VText
- Adjusts tests to use vcomp smart constructor
- Adds "ns" field for VText, Haskell side.
- Refines mount callback to VComp in dom.ts
- Factors out "preamble" function for hydration
- Intros and exports NS type ('html' | 'svg' | 'mathml')
@dmjio dmjio merged commit fadfa9d into master Apr 3, 2025
3 checks passed
@dmjio dmjio deleted the discriminated-union branch April 3, 2025 02:10
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