News for hackers. Stuff that matters.
Re:What Is Server-Driven UI? by develatio on Wednesday September 01, 2021 @02:18PM (#28383648)
This is just plain HTML presented as some JSON-like format. How many times are web developers going to reinvent the wheel instead of using what's already there?
Re:What Is Server-Driven UI? by ruckstar on Wednesday September 01, 2021 @02:20PM (#28383676)
This is a solution for native iOS and Android apps. Rendering HTML within a native app has a ton of tradeoffs. SDUI is about bringing some of the benefits of HTML websites to native apps without compromising on platform features like accessibility, localization, dark mode etc.
Re:What Is Server-Driven UI? by lhorie on Wednesday September 01, 2021 @04:16PM (#28385041)
I believe the objection is that "SDUI" amounts to re-implementing a poor man's "browser" except that it calls JSON.parse instead of HTML.parse, and it doesn't bother implementing a layout constraint engine. i.e. there's not much difference between `{"label": {"text": "Rocky Mountain", "fontSize": 11}}` and `<label text="Rocky Mountain" fontSize="11" />`

The general problem that arises from "reinventing the wheel" is that people implementing these SDUI things don't necessarily have experience with layout engine design. Case in point, look at the example:

    ...
    {
        "padding": [7, 14, 7, 14],
        "image": ...
        "label": ...
    }
    ...
This doesn't strike me as a schema that someone poured a lot of thought into, with regards to encapsulation/composition principles. It pretty much looks like a case of shaping things on a as-needed basis, only to later realize that a change to the rendering code is needed if, say, you need to tweak the space between the label and the image, or flip them around or bold/superscript some text or whatever.
Re:What Is Server-Driven UI? by develatio on Wednesday September 01, 2021 @02:23PM (#28383722)
If I read the docs correctly, you're literally supposed to send a description of what the UI should look like (which is the same as HTML + CSS: declarative code). How is this any different from just sending HTML + CSS?
Re:What Is Server-Driven UI? by noahtallen on Wednesday September 01, 2021 @02:31PM (#28383820)
If the app transforms the server-provided “UI” into native UI elements, that would be significantly different from just rendering HTML in a webview.
Re:What Is Server-Driven UI? by mabbo on Wednesday September 01, 2021 @03:33PM (#28384566)
That sounds like a web browser with extra steps.
Re:What Is Server-Driven UI? by tomc1985 on Wednesday September 01, 2021 @03:02PM (#28384206)
The "webview" it renders to is native UI this time?

Kind of reminds me of Mozilla XUL (rest in peace...)

Re:What Is Server-Driven UI? by rzzzt on Wednesday September 01, 2021 @03:41PM (#28384651)
Re:What Is Server-Driven UI? by ruckstar on Wednesday September 01, 2021 @02:29PM (#28383799)
It's similar but in a format that is more conducive to rendering in the native frameworks on iOS and Android: SwiftUI and Jetpack Compose. HTML and CSS doesn't map very well to these native frameworks.