Hacker News new | ask | show | jobs
by ruckstar 1758 days ago
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.
2 comments

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.
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?
If the app transforms the server-provided “UI” into native UI elements, that would be significantly different from just rendering HTML in a webview.
That sounds like a web browser with extra steps.
The "webview" it renders to is native UI this time?

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

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.