Is this a bad idea to send a partial template using channels?
The other option is to send a JSON and have a duplicate template on javascript and eex.
I’m asking this because I don’t know the channels internals and it may have a message size limit or some other drawbacks.
Here is how I would send it on controller after saving the post:
case Repo.insert(post) do
{:ok, post} ->
Endpoint.broadcast!("users:global", "new_post",
%{partial: Phoenix.View.render_to_string(YourApp.SharedView, "post.html", post: post)})
end