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

API consideration #61

Open
Kyle-Ye opened this issue Jan 16, 2022 · 3 comments
Open

API consideration #61

Kyle-Ye opened this issue Jan 16, 2022 · 3 comments

Comments

@Kyle-Ye
Copy link
Contributor

Kyle-Ye commented Jan 16, 2022

Why we not using SwiftUI-like "some Content" to constraint body rather using "AnyContent"?

Is there some limitation keeping us away from using it?

@Kyle-Ye
Copy link
Contributor Author

Kyle-Ye commented Jan 16, 2022

Something like

public protocol Content {
    associatedtype Body : Content

    @ContentBuilder var body: Self.Body { get }
}

public protocol Page: GlobalElement {
    @ContentBuilder var body: some Content { get }
}

@mattesmohr
Copy link
Member

Thanks for bringing your thoughts into this. If I recall it right, I tried already this approach, but I didn't go well, cause of the pre-rendering. Give me some time to investigate on this and let me come back to you before I can give you a finally answer, okay?

@tonyarnold
Copy link
Contributor

What did you find out, @mattesmohr? I'm happy to help with the conversion if this looks like a workable idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants