Skip to content

Conversation

@erikbdev
Copy link

Hello!

This pull request introduces a new protocol, AsyncHTML. This protocol provides compiler-time erros when you try to render asynchronous content in a synchronous HTML.

@erikbdev erikbdev marked this pull request as ready for review December 11, 2025 08:29
@sliemeobn
Copy link
Collaborator

sliemeobn commented Dec 12, 2025

hi @erikbdev, thanks for getting in touch! this is definitely an interesting idea.

I have also thought about how to get this reflected in the type system better. However, I am not sure this is the shape it should be.

The main focus needs to be easy of use, ie. defining your pages and component must be super clean and simple. Also, I need to keep an eye on the client-side elementry-ui framework, which derives it's view type from HTML at the moment.

I have been toying with the idea that there should be a View protocol that "only" defines the var body: some View mechanism. And on top provide protocol for HTMLRenderable and AsyncHTMLRenderable or similar (and DOMMountable for the client-side).

However, this somehow needs to auto-apply to customer-defined views/html types. Maybe a macro could be the solution that adds conditional conformances for every View type.

wdyt?

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