Post

Replies

Boosts

Views

Activity

Reply to Its time for SwiftUI on the web! (WASM, WEBGL)
I totally agree that the simplicity of just creating a declaration of your UI and automagically have a beautiful UI is need. But as mentioned, there are so many technical complexities handled by javascript frameworks that will be hard to do with swift. Say Apple supported swift compiled to wasm and swiftui in the browser. That would be 100% client side and not suitable for webpages (mainly because of SEO). Then what if Apple added the possibility to render swiftui to plain html and serve that? Then all logic and event handling would need to be done serve side, with subpar performance because of all the network traffic. Modern frameworks like fx. Angular supports rendering both server side and client side. Therefore I’m building a new framework inspired by Swiftui but specifically for Angular. (I chose to base it on Angular because of its builtin directive support, making the syntax closer to Swiftui) Its syntax won’t be exactly like Swiftui, as it is still html. But it takes a declarative approach similar to swiftui with no need to fiddle with CSS. Example: <zl-list> @for(song in songs; track song) { <zl-hstack> <zl-image [src]="album.cover"/> <zl-vstack> <zl-text>{{song.title}}</zl-text> <zl-text foregroundStyle="secondary">{{song.artist.name}}</zl-text> </zl-vstack> </zl-hstack> } </zl-list>
2w