Readit News logoReadit News
atonse · 3 years ago
Something really telling for me here is the fact that there are multiple people here (representing multiple companies) who have solved this problem and there doesn't seem to be an open source solution for it, let alone a dominant one.

It's clear that in general, we are all sick of writing a bunch of bespoke code and maintaining multiple platforms, and are seeking smart layers of abstractions over native widgets. It's a tale as old as time.

What's curious is why there isn't a standard/de-facto standard (like JSON based one maybe?) for UI layouts that has emerged, with a React Native adapter for it.

We are trying to solve this problem too with the same approach (the framework isn't the product, it's just because we don't want to spend too much time building custom Mobile components for our product).

It's not like people haven't tried. Just Microsoft has probably a half dozen of these. MAUI, WPF, etc.

Again, just curious that at least one format hasn't emerged for it.

api · 3 years ago
> What's curious is why there isn't a standard/de-facto standard (like JSON based one maybe?) for UI layouts that has emerged

It hasn't emerged because nobody has done it. Nobody has done it because it's unbelievably hard and involves a lot of painful code of the sort that is not fun and therefore that people must be paid to write. Nobody has been paid to write it because nobody pays for dev tools and it's not in the best interest of any platform vendor to commoditize platforms.

atonse · 3 years ago
You could say all those things about react native or other frameworks.

Like any reason why Airbnb can’t open source their solution? Seems battle tested.

The thing is that many people HAVE solved this.

alexhayes · 3 years ago
Your correct this is hard, but I have to disagree that it involves painful code. Declarative UI in all 3 clients is a major enabler for doing this in a nice way.

Some context - https://github.com/MobileNativeFoundation/discussions/discus...

(Edit to add context)

jdmoreira · 3 years ago
I'm one of those people and in my opinion it would be hard to make a solution that fits all. The reason why it works for us is because we control the design system and we know the needs of our app and users. It works because it's somewhat bespoke to our use-cases.

It simply is not possible to represent the realm of all possible native UIs within a common json schema. We can do it because don't need the realm of all possible UIs. We need a 20 different elements recombined and reused across all our screens.

Which is also a strength because now we can leverage our limitations into delivering a consistent experience across our app.

atonse · 3 years ago
But that’s an argument about style. No reason why an opinionated version couldn’t come out I guess.
woojoo666 · 3 years ago
If you have a React Native adapter on all platforms, why not just use React as your standard?
native_samples · 3 years ago
That was basically AWT and then SWT in the Java world.

It can work for simple stuff. For anything more complex the underlying widgets are too different, you have to go with the lowest common denominator and the results just aren't good enough.

alexcroox · 3 years ago
I was convinced Apple review guidelines state the core functionality of the app must be in the bundle that is reviewed and they would reject it if it's loaded mostly over http. Can see where they are coming from given they could review the app as a calculator app that then turns into a porn app post review.

Did the author just get lucky with the review process?

This is the guideline I'm referring to: https://developer.apple.com/news/?id=09062019b

s_dev · 3 years ago
I've wondered about this and products like expo 'over the air' updates for React Apps etc. In theory does seem to infringe on these guidelines but are somewhat common in the iOS and Android eco-systems at the same time. I suspect an element of 'Don't ask don't tell' is being played out.

I also recall another guy -- who I think was openly advertising it as way to get around app store guidelines got taken down. JSONRoller or something my memory escapes me.

jeroenhd · 3 years ago
You can pack the JSON into the renderer if you want. The real meat of the app is the renderer itself, though. For example, you could put the menus and controls in an embedded JSON and then have the app fetch the data view from a server. It's not like your average Twitter or Facebook can show a whole lot without Internet access, so I don't think Apple will reject any apps that don't work without internet access. Add some certificate pinning for good measure and Apple will have to test on rooted iPhone to get access to the data being exchanged, and I don't think the testers really care enough about that stuff anyway. They'll much rather complaintthat you link to your website in a way that angers the Apple gods and other such low hanging fruit.

There are plenty of apps out there that are basically this but with custom logic. Lots of other apps are not much more than a webview with a custom "can't contact the servers" screen.

tluyben2 · 3 years ago
Wouldn't be too hard to include package the JSON with the final product or generate code though.
OJFord · 3 years ago
I suppose it's technically user-generated content, so it's fine? i.e. the app developer couldn't possibly know at review-time what it would be, and that run-time stuff is only distributed (in theory) to the person(s) that generated it; it isn't 'the core functionality of the app'.
fcurzel · 3 years ago
They are eventually taking it down, for sure, just a matter of time… Every reviewer is different
cyral · 3 years ago
I wouldn't be so sure. Ionic has a commercial product, AppFlow, which is their "update over http" solution. It allows for running arbitrary code without app approval, and they claim it is compliant. AirBNB and I'm sure plenty of other companies use "server driven UI" which is similar to this. Almost every app will also use feature flags in some way. Or could even just check if the account is "appreview@apple.com" and show different content, theres not a good way to prevent it.
tomcam · 3 years ago
Creator Ethan vanished a couple years ago. Replaced with:

https://jasonelle.com/

jeroenhd · 3 years ago
Looking at this announcement: https://github.com/jasonelle/jasonelle/discussions/120 I don't think that's much of a replacement either. It's a cool concept, but it seems like a bad system to use for a new app.
kanonieer · 3 years ago
Interesting. This has some _why vibes.
jdmoreira · 3 years ago
This is really interesting to me. At my job I maintain a very similar iOS render. Our app is built on the exact same principles, we have 3 native renderers (iOS, web app and Android) that consume the same JSON and generate native UI at runtime.

The schema even looks similar and as far as I know no one was aware of this project when this was built.

There are major disadvantages to this approach of course but there are also many many advantages.

bob1029 · 3 years ago
This is precisely how our product works too.

We've been using the same UI data contract for the last 7 years, which has allowed us to survive several different platforms without adjusting a single line of business logic or UI code.

jdmoreira · 3 years ago
That's awesome. If you ever want to bounce ideas you can reach me at joao@$myusername.me
mleonhard · 3 years ago
What are the major disadvantages?
mcintyre1994 · 3 years ago
This looks really cool, nice! Neat that it’s already used in App Store apps too. And I like that it exposes native things like camera, will be interesting to see how that sort of thing works.

I noticed a couple of issues on the home page, in case the author is here:

- when I click documentation it says I’m viewing an old version, if I click OK to view the new version it’s a 404 (https://jasonelle.com/docs)

- Try Now links to an empty Heroku page, there’s a button to “build something amazing” but it just links to the Heroku home page

- the YouTube video near the top is private

j4mie · 3 years ago
alexcroox · 3 years ago
Interesting their last blog post was the month before Apple clamped down on this type of app, see https://news.ycombinator.com/item?id=31502241
miguelrochefort · 3 years ago
Microsoft's approach:

https://adaptivecards.io/

Deleted Comment

AntonioL · 3 years ago
Thanks for sharing
froh42 · 3 years ago
Oh yeah, if there was a way to send markup to the browser and have the browser render a UI for that. I wonder why nobody thought of that as of now ... oh. wait. ... ah we want "native" components. Yea. html only had "native components" for a long time, too ...

so - html as json without css and a richer component palette?

manmal · 3 years ago
I think that’s a very understandable reaction, and I had the same initially. But, there are upsides to using a proprietary format over HTML:

1. Encoding behavior in custom components without resorting to Turing complete languages (JS), such that custom components (eg DatePicker)

2. Dependencies between components, like rules, become possible: If textfield A is empty, disable button B.

3. Access to native APIs that are not (yet) implemented in browsers.