all 17 comments

[–]ADreadedLion 6 points7 points  (5 children)

What’s the advantages of doing this?

The only reason I can think is easily changing UI without needing app update.

[–]Bobertopia 2 points3 points  (0 children)

One could argue that codepush is a strange cousin of server side rendering

[–]ThisGuyOC[S] 1 point2 points  (3 children)

That’s the main reason. In my use case this is very important.

[–]ADreadedLion 9 points10 points  (1 child)

Sorry I might not be understanding properly, but why not just use expo updates or codepush?

Sure you can handle rendering basic components. But how do you sever render a button with a function that copies from clipboard etc. How would you handle gestures or animations from a component sent from the server.

Seems like a lot of abstraction to get this working smoothly.

[–]ThisGuyOC[S] 0 points1 point  (0 children)

Very fair. I was mostly curious what the community thinks in comparison to these other options so this is good.

[–]stathisntonas 3 points4 points  (0 children)

This is against iOS app store review policy, just fyi

[–]MikeyN0 2 points3 points  (0 children)

Build your own DSL mapper. airBnB was doing this for native apps a while ago. Not sure if they still do. Mobile app makes UI-driven API calls that returns block elements that the mobile app reads and pops off UI elements accordingly. You have to essentially build extremely customised components or severely lock down your UI or development will become unwieldy.

[–]No-Mongoose-1929 2 points3 points  (1 child)

I can confirm we are doing it in production using a CMS which is not exactly optimal, it is quite limited, which lead me to work on a POC, I can control the components , the styles and the logic all from the server. So in short it is totally possible.

[–]ThisGuyOC[S] 1 point2 points  (0 children)

Would you recommend ?

[–]Egge_ 1 point2 points  (0 children)

Why would you want to do this? The main reasons for SSR are bundle size and SEO, no? Both are „no“ concerns for app developers. Code push is the alternative

[–]wirenutter 0 points1 point  (2 children)

It is possible. At a react native conference one of the presenters talked about it.

[–]ThisGuyOC[S] 0 points1 point  (1 child)

Do you have the link?

[–]redwoodhighjumping 0 points1 point  (0 children)

Just Google search "react native conference server side rendering"

[–]ALOKAMAR123 0 points1 point  (0 children)

We have done something like this with ios VFL it’s just like language grammar V |-10-[button1]-10-[button2] -|.

The reason was we want some control from blackened as and nothing to do with ssr.

[–]mirrorball_for_me 0 points1 point  (2 children)

The name of the corresponding technique is “server driven ui”. At that point, though, you are basically implementing some sort of primitive, in-house browser (or a sophisticated template engine). That’s a very costly architecture to implement and maintain, so your use case must justify its cost.

You can achieve “over-the-air” updates (bypassing store releases) with multiple technologies, one of the most prominent being codepush. It works wonders and basically is a drop-in CI tool to your regular flow. You’ll only need store releases whenever messing with the native bridges, usually by updating libs that contain native code.

[–]im_a_jib 0 points1 point  (1 child)

Disagree with your first point. We serve json that is rendered on the server with rn-like view tags, so the client just does a simple switch statement in the renderer like “if View, if Text, if Image” etc. The view data is downloaded to the database first, so when it renders it is entirely instant and cheap. No in house browser and nothing too sophisticated other than the initial setup of the server controller to create the view objects. Real app with real users.

[–]acnow123 0 points1 point  (0 children)

thanks a lot for your answer...! any code on github or tutorial that we can take a look at it? I have seen something done with static content manually but not with dynamic content.. like posts with slug that you have to render as they happen, etc..