You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inspired by John Sundell working on a nice HTML static site renderer, but using his own DSL.
In the spirit of what StaticCMS does for generating static sites using WebObjects/GETobjects templates, we could do a SwiftStaticWebUI which does the same using SwiftUI "Views".
Idea dump:
This is quite different to what SwiftWebUI itself does (and would best be done as a separate project).
Essentially all the diffing and state handling goes away. This would essentially not need Bindings (or Combine) anymore, it would be a one-way flow "swift views" => HTML page.
Targets of "actions" would work very different, they would need to resolve to statically representable links.
Just like in StaticCMS I imagine that we would need an "OFS" (Object File System), essentially a way to load a file system hierarchy into Swift values, which then get rendered by SwiftUI Views.
Imagine a filesystem folder containing .md files, they would load into say "Markdown" objects. Then you'd have SwiftUI Views like:
which could turn them into HTML. The OFS in GETobjects also decouples the objects from the actual store, e.g. it could also be a database vending the markdown objects, but still being rendered using the exact same Views.
Then there would need to be entry points which trigger the html website rendering traversal, something like:
NavigationLink(destination:AboutPage()){
some anchor
}
This might need some back-mapping of the Views to the URLs. Since the Views can also be parameterised (e.g. as the body of a ForEach):
structCounterPage:View{letcounter:Int...}
... we need a away to serialise those into the URL (like /counters/1.html). One way to do this could be Codable. Which would automagically work for many basic types.
Not sure whether it's worth it, but it would at least allow me to replace my own sites driven by StaticCMS with something non-Java, more up to date :-)
The text was updated successfully, but these errors were encountered:
Yes, I had a look at Plot and Publish. Very nice, beautiful code, well done! It is a little different to what I have in mind though. (and doesn't have a ViewBuilder DSL, I actually toyed with adding one to Plot, but the whole setup is quite different)
I have some ideas on doing a SwiftUI-like View DSL for MicroExpress (or actually any hosting framework should work) which I may explore soon. That might become the Plot part in John-speak, and Publish would be the OFS+exporter stuff, which I may or may not do later.
Inspired by John Sundell working on a nice HTML static site renderer, but using his own DSL.
In the spirit of what StaticCMS does for generating static sites using WebObjects/GETobjects templates, we could do a
SwiftStaticWebUI
which does the same using SwiftUI "Views".Idea dump:
This is quite different to what SwiftWebUI itself does (and would best be done as a separate project).
Essentially all the diffing and state handling goes away. This would essentially not need Bindings (or Combine) anymore, it would be a one-way flow "swift views" => HTML page.
Targets of "actions" would work very different, they would need to resolve to statically representable links.
Just like in StaticCMS I imagine that we would need an "OFS" (Object File System), essentially a way to load a file system hierarchy into Swift values, which then get rendered by SwiftUI Views.
Imagine a filesystem folder containing .md files, they would load into say "Markdown" objects. Then you'd have SwiftUI Views like:
which could turn them into HTML. The OFS in GETobjects also decouples the objects from the actual store, e.g. it could also be a database vending the markdown objects, but still being rendered using the exact same Views.
Then there would need to be entry points which trigger the html website rendering traversal, something like:
Or maybe using some enum instead of strings.
NavigationLinks could also still work:
This might need some back-mapping of the Views to the URLs. Since the Views can also be parameterised (e.g. as the body of a ForEach):
... we need a away to serialise those into the URL (like /counters/1.html). One way to do this could be Codable. Which would automagically work for many basic types.
Not sure whether it's worth it, but it would at least allow me to replace my own sites driven by StaticCMS with something non-Java, more up to date :-)
The text was updated successfully, but these errors were encountered: