3 ms·
That’s great. What if I don’t want to write a whole new NodeJS backend just to support SSR, when the existing backend with all our APIs that we already wrote is
by moribvndvs 3y ago
That’s great. What if I don’t want to write a whole new NodeJS backend just to support SSR, when the existing backend with all our APIs that we already wrote is a Spring Boot service?
I’ve looked at Nashorn and then Graal to do this, but couldn’t find widely supported resources that work well and snap right in. Anyone in the same boat that has had success?
- falsandtru 3y agoThere is SPA on Pjax. You can use an independent HTML and/or JSON server in any language to create SPA. https://github.com/falsandtru/pjax-api https://github.com/falsandtru/pjax-api https://falsandtru.github.io/pjax-api/docs/modes/ https://falsandtru.github.io/pjax-api/docs/modes/
- AprilArcus 3y agoI also maintain a JVM which we run some backend JS libraries on via custom Nashorn builds. It's slow and drinks memory. Setting up a façade in front of a pool of ScriptEngine objects mitigates some of the startup cost, but I super don't like the idea of running React for server rendering. I would suggest standing up a NodeJS rendering microservice instead; we'd do it if arcane deployment reasons didn't preclude the possibility.
- wild_egg 3y agoPick up unpoly, HTMX, Hotwire, or some other hypermedia oriented library and have the Spring Boot server start rendering HTML instead of JSON HTML templating works great, it's battle tested, typically still blows away RSC performance, and you get to keep all your mature domain logic and data layers while being able to deliver great UX with minimal client code