csaintc
Hey friends!
My company runs a single page app, and it is a hard requirement that we do isomorphic rendering for our front end.
Our back-end is implemented in Elixir. I was thinking it might be nice to cut out the middle man and use Elixir to isomorphically render our reactjs application on our elixir back-end.
Are there any libraries, conference talks, etc. you can point me to that could be helpful?
Thanks a bunch!
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
I’ve followed the Phoenix LiveView file upload code here Uploads — Phoenix LiveView v1.0.0-rc.7 and so far everything works just fine wit...
New
I’m using an Umbrella project for a Phoenix application, and I want to have one Ecto Repo and one PostgreSQL database shared by all apps....
New
Hello,
I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter).
The diffic...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Latest Phoenix Threads
Latest on Elixir Forum
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #ai
- #iex
- #graphql
- #elixirconf-us
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
OvermindDL1
Unsure about libraries but it would be pretty easy to do, just setup a Port to a nodejs app that talks over it’s stdin/stdout to your main server, and anytime you need to render out a page then send a JSON of data over stdin and get the page data back (I’d recommend tagging with an ID so you could interlace commands for faster speed if you get nodejs running multicore). It’s the standard BEAM way to talk to external apps like that.
Now if you want to toss out React and use something else that is better suited, there are tons of options, though it sounds like you might already be tied to react and if you want to ‘isomorphicaly’ use react then a Port is the way to do it, essentially just using react-in-node ‘as’ your template system (no where near as fast as elixir templates, but if you want it ‘isomorphic’ then that’s how to do it).
tme_317
There is a library that does basically what @OvermindDL1 suggests for server-side React rendering in a pool of nodejs workers orchestrated by Elixir! Check out GitHub - revelrylabs/elixir_react_render: React SSR Framework for Elixir · GitHub
namelos
Another way to achieve this is to use Node.js server in front of Elixir back-end.
When browser request for index page just returns a fully rendered string, the fetching data just from Elixir back-end. Use isomorphic fetch to make sure the components are also executing well in the Node server. All the API will be called from the browser directly goes to Elixir back-end through Nginx or Ingress etc.
If you are using GraphQL there’s a term named schema stitching, which let you merge back-end schema to the current server.
OvermindDL1
Oh that’s cool!
kokolegorille
Just for information, there is a post abour react_render from the author here…
bryanjos
Just chiming in to say that lib does pretty much what @OvermindDL1 said. Having elixir apps supervise node processes makes things so much more pleasant in development and production.
We also have another related lib that is for node interaction in general
GitHub - revelrylabs/elixir-nodejs: An Elixir API for calling Node.js functions · GitHub
Eventually we will have the react render lib implemented using that one hopefully