SwiftWebUI - is there an opportunity for Leaf to support SwiftUI for the Web

I have been reviewing the following initiative

[GitHub - SwiftWebUI/SwiftWebUI: A demo implementation of SwiftUI for the Web] as its an initial implementation of SwiftWebUI and is self declared as a "Toy Project"

I was wondering if SwiftUI or SwiftWebUI had been requested for a future release of Leaf or even a new module that Vapor would support ??

It would be good to here other peoples thoughts

There have been a number of projects spun up to allow you to build HTML with some kind of DSL, including several community projects (the biggest being I think GitHub - vapor-community/HTMLKit: Create and render HTML templates with HTMLKit

Vapor's ViewRenderer protocol makes it easy to integrate other libraries like Plot and probably SwiftWebUI so you're more than welcome (and encouraged!) to use them. It would be great to see more packages that provide integration for Vapor.

In terms of adding support to Leaf - this would not be possible, since they are fundamentally different. And in terms of adding a new module, this is pretty unlikely. I'm a big believer in using HTML-like templating languages for building server-rendered front-ends. You get to tap into the existing HTML resources out there (and there are a ton), it's pretty easy to onboard and get designers and front-end developers up to speed when working on big projects and you don't have to try and coach them through spurious error messages from the compiler. Since I'm the one writing it, I'm going to maintain the tools I use day-to-day :sweat_smile:

We (the Vapor Core Team and other maintainers) don't have a huge amount to time to add support to another module, especially with the work going on for Vapor 5, so the above is unlikely to change. That being said, if you want to use another library, we've made Vapor extensible for that exact reason. And if another library gains enough traction and becomes the de facto way for building HTML in Vapor, we'd of course consider supporting it.

1 Like