What is the preferred frontend for a Lagom App

I’m new to Lagom and I was wondering what is the easiest way to create a frontend for a Lagom based backend? I’d like to keep my services separate from the frontend. How hard is the integration with something like Reactjs. Or is there a better way like creating separate Lagom services that produce the UI HTML and cache and send it when requested?
What is easiest as far as learning curve, implementation, user experience and maintenance ? I’m afraid of using ReactJs or another Js framework because of loading speed for mobile devices and my app already uses a good bit of JS in the front. Does ScalaJs make any of this easier? I found ScalaTags and ScalaCSS which is why I asked about separate services to produce the UI.
Any experiences anyone can share are appreciated.

1 Like

Lagom is a backend microservice framework. So, you can use whatever front-end technologies you want to interface with it via REST over HTTP or websocket. There is no Lagom specific integration with React.js. It’s just another REST service.

I know this. I was just trying to get a feel for what other people in the community prefer. Sort of like what have people found to be easiest. I am also thinking of letting play handle this. I’m just interested in other peoples experiences before I settle on the front end technology. Thanks for any opinions.

Hi there,

In short, Lagom has no opinion on the subject of frontend technologies, as already mentioned. You’ll find that it always depends on the context, and if anyone tells you otherwise be very skeptical of their opinion. But I doubt this is news to you, so I will throw in my 2 cents.

What is easiest as far as learning curve, implementation, user experience and maintenance ?

Look, I hate to repeat myself, but what are you trying to build here? If you just want to send a few requests to a Lagom backend use bare-bones XHR/fetch or, pardon the heresy, jQuery. It hardly gets easier than that. If you’re working in team ask for their opinion, pick what you all like, you are the ones who’ll have to look after it.

If you are just playing or hopefully you are building the next unicorn - just use whatever you fancy. You can always change it, should you find your initial choice was not that great after all.

I’m afraid of using ReactJs or another Js framework because of loading speed for mobile devices and my app already uses a good bit of JS in the front.

If you are worried about the performance, weight-in your options the usual way - measure. Don’t trust hearsay - measure, measure, measure! And if you are happy with what you’re using already, keep using it until you no longer happy with it.

In conclusion, remember that there are plenty of successful and failure stories with each technology. Learn all of the technologies, then you can make the most informed choice, that’s my advise :slight_smile:

Thanks. The reason I ask is because I am creating an app with Lagom to help others learn and use Lagom in a fun way. Since Play is part of the Lightbend platform, I think I’ll just use it. This has the bonus of keeping things in the Scala world. Unicorns are horses with glittery dildos glued on their heads, I hope I am not creating one of those. LOL

In case it helps you, we use React and Typescript. These have proven to be a great combo. We also use Server Sent Events but would probably go with Websockets given connection error management; or possibly even RSocket.

1 Like

Hi,
ScalaJS and binding are a good fit IMHO.
HIH

2 Likes