Skip to content

Conversation

@SykoDaedalus
Copy link

This PR is an attempt to improve the DSL (the custom HTML DSL) for Calico, aligning with #180’s vision for ergonomic, type-safe, and reactive UI composition, with partial support for web components (#37).

Changes Done

  • Type-Safe Elements: restrict Attribute[E, V] and Setter[E, A, V] to specific element types which is enforced at compile time.

  • Reactive Bindings: Attribute[E, V] supports :=, -->, <-- with Signal[IO, V] and Pipe[IO, Event, Nothing].

  • Web Components: enables custom web components by allowing Tag[customElem] to create with type-safe customValueAttr and onValueChangedAttr for props and events.

  • FP-Friendly: IO and Resource for DOM ops, with fs2 streams for events.

Limitations / Future Work

  • Incomplete Purity: Emits uses unsafeRunSync stub; needs proper cleanup.

  • Limited Attributes: Missing valueAttr, styleAttr for some tags.

  • No Calico Core Integration: DSL is standalone, not tied to Calico’s HtmlElement[IO].

  • Basic Web Components: cccustomTag lacks full props/events support

  • No Svg support as of now.

@SykoDaedalus
Copy link
Author

SykoDaedalus commented Apr 14, 2025

@armanbilge I have drafted the PR you. Do check it out. It is very "wonky" and still a very crude prototype. Like I have added a basic "Hello world" app in sandbox as demo. It compiles and fastLinks but does not render anything as Tags are incomplete.

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