Eiji
i wonder how rendering templates in Hologram app affects SEO … Does anyone have any experience with it?
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
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
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
Lucassifoni
If you view source on the documentation site (which uses Hologram), all the content is present in the generated HTML on first load. I guess you could also render opengraph metadata, all standard meta tags and JSON-LD excerpts with the framework ?
bartblast
Hologram handles SEO excellently from a technical perspective. The key thing to understand is that Hologram renders pages on the server-side, so when a browser (or search engine crawler) requests a page, it receives the complete HTML content right away - not an empty page that gets populated by JavaScript later.
This means search engines can see and index all your content immediately, which gives you a significant SEO advantage over client-side rendered frameworks. As Lucas mentioned, you can see this in action by viewing the source of any Hologram-powered site - all the content is there in the initial HTML.
From there, SEO performance really depends on how well you optimize your pages using standard techniques:
Hologram gives you all the tools to implement these optimizations - it’s just a matter of using them effectively in your templates and components.
So in short: Hologram provides excellent server-side rendering that search engines love, and the rest is up to you to implement good SEO practices!
Hope this helps!
Eiji
Oh, right … it’s
SSR… makes sense. What I’m looking for my specific project is rather amixedapproach. The initial render should be done on server, but all the rest should be done on the client side. Therefore the initial render would generate a placeholder-like content with SEO & no-JS compatibility allowing client to focus only on the application itself.Think about an editor like on this forum … do we really have to render things on server every time we are clicking on B button? Also I’m looking for saving as much server resources as possible to make server focus on the tasks that could be done only on it …
I think that no framework gives me such a flexibility and I should rather choose
PhoenixWebSocket +Svelte SPAsetup … This would be a bit manual, but it should be the best option for my use case … For sure I understand that at least on start bothLiveViewandHologramwould just work for me, but for the best scalability if after some time I would anyway need to change then it’s better to start from this setup to avoid an app rewrite in the future.bartblast
There’s an important clarification about Hologram’s architecture - it’s misleading to classify it as SSR because “SSR” can mean different things: rendering pages (e.g. initial HTML) vs rendering each interaction (like LiveView/Hotwire).
Your Bold Button Concern - Already Solved!
You thought clicking Bold would go through the server, but it’s the opposite - it runs entirely client-side because Hologram transpiles your Elixir
action/3function to JavaScript.No server round-trip for UI interactions.
Proof: SVG Drawing Demo - each mouse move runs client-side, not server round-trips.
Hologram’s Real Value Proposition
The key insight is transpiling Elixir to JavaScript - don’t focus on current features, but what this enables:
Right now: Nothing prevents you from running your whole Hologram app as one big page, only touching the server for data commands.
Technically possible: Hologram could bundle multiple pages for full SPA experience, handle multiple routes from one page, or change browser path via history.pushState without actual navigation.
How Navigation Actually Works
History navigation: Completely client-side. State is serialized and saved when navigating away, deserializes when returning. No refetching if page code is already registered.
Link navigation: Fetches pages (usually what you want)
Data Loading Strategies
You can render placeholders for expensive calculations and fetch data later with commands. True SPA-like behavior without any server data fetching would need Local-First features (like ElectricSQL) - that’s on Hologram’s roadmap but separate from your Bold button use case.
Architecture Comparison
I don’t see any benefits in “Phoenix WebSocket + Svelte SPA” vs Hologram. You’d get more complexity, dual codebases, and manual state coordination for the same result Hologram already gives you.
Bottom line: Your UI interactions already run client-side. Hologram’s transpilation makes it fundamentally different from server-dependent frameworks.
jam
I’m wondering how you might approach data loading for something like a chat app (or realtime forum) with Hologram. It seems like maybe you could get a small speed boost by rendering the most recent N messages server side when navigating to a room. Then new messages could be streamed and historical messages could be fetched. But I’m not sure what other complexities that might introduce in Hologram or if it would “just work”. There’s a nice simplicity with traditional SPAs but it’s not without tradeoffs. Is there a way to get the best of both worlds without making things too complicated?
This is interesting and makes sense for more static content. What are your thoughts on the more dynamic use case? It’d be nice to keep the state in sync for some period (maybe using pubsub subscription) so that if the user navigates back the state is still in sync and doesn’t require more server round trips.
Eiji
Interesting … I wanted to visualise how it works and found in the docs:
and:
If I understand correctly
Hologramrenderstemplatedepending on the context like:SEOrelated functionality should be done in thePage.init/3orComponent.init/3put_session/3calls? Look that we can call a command from theinitas well as from the action and some people would find it confusing.Componentwithinit/2or we pass empty (nilforifor empty list foreach) server state and set the right data in the client stateIs that correct?
Do you support or plan to support a condition to check if we are rendering template on the client?
In theory we can simply put a state on the server and change it on the client, but since
hologramalready knows context it feels like a waste. Think that to do it properly in a complex template we would have to check if few props areniland some people would rely only on only one which may be error prone if by accident it would be changed in the server state.Therefore we could have some dev-only optimisation checks. Look that if
hologramwould not detect a server state usage in the template then it could show a warning about unused state (similar to unused variable inElixir). This with a clear separation of client-side rendered template would really improve the developer experience by avoiding a very simple bugs in the code that sometimes may be hard to notice.What
hologramwould do if inside aComponentwe would define bothinit/2andinit/3? I guess that it would either raise on compilation time or useinit/3first and maybe even ignoreinit/2?I think that a new developers would find confusing that there is no
init/3example in your Pages documentation. I know there is one in theQuick Startsection, but I believe that you should show even the simplest examples in mentioned page too.Could you please clarify in the documentation when the rendering happens and provide some examples? Since on the server we can change the client state for some people it may be a bit confusing.
SEOis a very important and many people would like to create a placeholders for the client state and simulate in DevTools a very slow connection, so maybe a separate small guide with a list of cases and simple example would be a good idea here?bartblast
That’s exactly the way to go for now IMO: Render the most recent N messages server-side for that initial speed boost and SEO benefits, then progressively load historical data and stream new messages via real-time updates.
Hologram’s init/3 function runs on the server during page rendering, so you can fetch recent messages there and they’ll be baked right into the initial HTML. Then use commands for lazy-loading older messages when users scroll up.
For new message streaming, while Hologram has WebSocket infrastructure, pushing messages from server to client via pub/sub isn’t implemented yet, but it’s on the immediate roadmap. You’d need to implement polling or use commands triggered by user actions for now. The foundation is there though - the WebSocket connection exists and real-time server-to-client messaging and broadcasting is coming soon.
Eventually, a Local-First sync engine that handles all of this syncing automatically would be the holy grail - imagine having offline-capable, conflict-resolving data synchronization built right into the framework. That would eliminate most of the manual state management complexity entirely.
It would make sense for Hologram to notify the component when it’s being restored from browser history (back/forward buttons) so the component can decide whether to trigger a resync. Currently the state just gets restored silently, but having a lifecycle hook like “on history restore” would let you implement smart catch-up logic.
bartblast
Thanks for the feedback!
I can see there are some misconceptions about how Hologram’s initialization works, so let me clarify the key points.
The most important thing to understand: Each stateful component instance is initialized exactly once during its lifetime. This is a crucial detail that I think will clear up most of your confusion.
I’ve just added a section to the Components page that explains this:
Now to address your specific questions:
The initial render of any page always happens on the server when you navigate to that page. After that, all rerenders happen on the client as state changes.
Commands are essentially Hologram’s implementation of the command pattern for remote procedure calls. Actions and
init/*functions don’t call commands directly - they return commands as instructions to be executed on the server.Both can coexist in the same module because they serve different purposes. Hologram will call the appropriate one based on where the component instance’s lifecycle starts - there’s no conflict.
I included a basic
init/3in example on the Pages page.Remember that each component instance only initializes once, so you typically wouldn’t need this pattern. If you need different behavior for server vs client initialization, that’s what
init/3vsinit/2is for.The SEO placeholder pattern you described would typically be handled by having the server-side initialization (
init/3) set up the SEO-friendly state, and then client-side updates modify that state as needed.Aynki4
i’d check whether your pages can render on the server first, since that usually helps with indexing. If not i’ve had good results using pre-rendered static pages for key routes
bartblast
Hologram has you covered here: pages are always server-rendered on the initial load, and the client takes over afterwards. So SSR-for-indexing works out of the box, no extra setup needed.