Can Hologram sit alongside the existing routes of a Phoenix app?
This is actually a really nice migration path - you don't have to rewrite your entire app. You can gradually move specific features to Hologram where offline support or instant responsiveness matters most, while keeping LiveView for parts where server-side rendering is enough.
For your offline/low bandwidth requirements specifically, Hologram is perfect because once the JavaScript is loaded, all the UI logic runs locally. No more waiting for server roundtrips on every interaction, and the app continues working even when connectivity is spotty.
One thing that's unclear to me in how I might manage this "side-by-side coexistence": how you manage potential route conflicts, e.g., You have a Hologram "page" that defines `route "/hello-world"`, and the Phoenix application router.ex also defines a route, `live "/hello-world', MyApp.HellowWorld, :index`.
I could imagine the lack of a central router may be offset through conventions of how you organize pages (perhaps a directory-based-routing convention). I saw in the Installation section that it's common to organize under `app/`, and `app/pages`. Maybe an expansion on best practices for larger project organization, and how you keep Hologram routes straight, would be interesting to other people as well.
Regardless, I've just started dipping my toes in the elixir and phoenix ecosystem about 3 months ago, and it's been a real joy. I'm throwing every hobby project I can think of at it to learn more. I'll give hologram a spin -- thanks again for such clear documentation.
The key difference with Hologram is that it transpiles Elixir code to JavaScript that runs directly in the browser, eliminating server round-trips entirely. So while LiveView uses websockets to update the DOM from the server, Hologram gives you true client-side execution with zero latency for interactions.
> Hologram is a full-stack isomorphic Elixir web framework that runs on top of Phoenix. It lets developers create dynamic, interactive web applications entirely in Elixir. Through intelligent code analysis and transformation, Hologram converts the necessary parts of your Elixir code into JavaScript, delivering modern frontend functionality without requiring any JavaScript frameworks or direct JavaScript coding.
Key highlights:
- Complete bitstring rewrite with ~50x rendering speed improvements!
- Comprehensive session and cookie management
- Live reload functionality for enhanced DX
- Incremental compilation (2x-10x faster builds)
- New pointer and mouse move events
- HTTP-based transport layer
- CRDT support for future distributed features
Full release notes: https://hologram.page/blog/hologram-v0-5-0-released
Check out the SVG Drawing Demo that showcases smooth, responsive drawing using the new pointer move events - it really demonstrates the performance leap! https://hologram.page/demos/svg-drawing
With over 950 commits since v0.4.0, this release delivers significant architectural enhancements while maintaining the unique developer experience that makes Hologram special.
Special thanks to my current GitHub sponsors: @D4no0, @Lucassifoni, and @sodapopcan!
Support Hologram’s development: If you’d like to help accelerate Hologram’s growth and make releases like this possible, consider becoming a GitHub sponsor. Every contribution helps dedicate more time to new features and community support! https://github.com/sponsors/bartblast
Stay in the loop: Don’t miss future updates! Subscribe to the Hologram Newsletter for monthly development milestones, ecosystem news, and community insights delivered straight to your inbox. https://hologram.page/newsletter
And this is just the beginning - I'm working on component-level selective rendering that should make things an order of magnitude faster still. Instead of re-rendering the entire page, only the specific components that actually changed will be updated.
It's exciting to see the performance gains become so noticeable in real usage. The hamburger menu responsiveness is exactly the kind of instant interaction that Hologram is designed to enable! :)
The initial page load isn't impressive, though: Google's PageSpeed Insights indicates a 100+kb runtime with lots of unused JavaScript initially, resulting in a LCP of 1.5s (results will vary, of course). I wonder how much of the JavaScript is simply code that stores the website pages, haven't had the time to look at this in detail yet.
For a docs website, that's excessive and bloated; it'd be much better to just deliver no JS and provide HTML with prefetching rules and cache headers (which would also provide instant navigation and offline support).
I'm happy they made the docs website with it, though, to dogfeed and showcase it.
The 1.5s LCP you're seeing is quite different from what I'm observing. Performance can vary significantly based on location, network conditions, and device capabilities, so perhaps that's contributing to the difference in our results?
It's also possible that different pages have different performance characteristics depending on their content complexity and the navigation structure. Could you share which specific page you tested? That would help me understand the discrepancy better.
Regarding the runtime size - it hasn't been optimized at all yet, so I expect it will be much smaller in the future. I wouldn't be surprised if we can reduce it by a few times through proper optimization.
You're absolutely right that for a pure documentation site, a no-JS approach with prefetching would be lighter. The Hologram docs site is indeed dogfooding - I wanted to showcase the framework's capabilities and stress-test it with real-world usage, even if it means some overhead for this particular use case.
The goal was to demonstrate the instant navigation experience you mentioned, plus features like client-side search and interactive examples in the future that benefit from the stateful client-side architecture.
Thanks for taking the time to test the site and provide this feedback!
The page I tested is the one linked here in HN (the announcement)! I guess I should've referenced the PageSpeed Insights URL [0]. I hope you can get your bundle sizes smaller in the next versions, because honestly, from my first look (not very in-depth, of course), it's the only thing that's not very attractive about it. Likewise, I keep in mind, though, that most web frameworks nowadays ship very large bundles to achieve hydration and client-side routing.
I'm excited to see future updates to this project!
[0]: https://pagespeed.web.dev/analysis/https-hologram-page-blog-...
I see that you've been focusing on the performance aspect but I see a big benefit with the offline first use-case.
It would be nice to have built-in support for syncing any changes when the client comes back online as it would remove the biggest issue with LiveView based websites (that they stop functioning if you lose connection).
For example, a simple todo list where you can check off items offline and when you go online they're sent to the server?
I needed to get the performance to a usable level in v0.5.0 because the previous iteration was quite slow, and I was concerned about getting bad press early on (there was actually a previous HN discussion about Hologram's performance issues). The slowness also prevented implementing latency-sensitive features like the real-time pointer/mouse events you see in the SVG drawing demo - which are really Hologram's main use case. It's already blazing fast now, though I haven't squeezed max performance yet - there's still room for improvement.
There are still some high-priority features that need to be implemented first before tackling the local-first capabilities. The CRDT implementation in this release is part of the foundation for those distributed/sync features, but there's more foundational work needed.
I'll definitely keep following the project and I need to play around with it when I find the time to.
I still don’t know where this fits with Phoenix/liveview/bandit. Does it replace them? Why and to what end? Am I to use it as a companion? For which parts?
In other words, which problems do I need to have to appreciate how cool this is?
LiveView: Renders UI updates on the server and sends them to the client.
Hologram: Transpiles your Elixir UI code to JavaScript that runs entirely in the browser.
You'll appreciate Hologram when you want to avoid LiveView's latency. For example:
- Instantaneous UI interactions without client-server roundtrips
- Real-time interactions like smooth drawing, drag-and-drop, or complex animations
- Offline-capable applications that work without constant server communication
- Reduced server load since UI logic runs client-side
If you need truly responsive client-side interactions or want to reduce server roundtrips, that's where Hologram shines. It's the same Elixir developer experience, but with client-side performance characteristics. Think of it as "LiveView for when you need the UI to feel like a native app.
Note: Currently Hologram requires Phoenix, but in the future you'll be able to run it as a standalone framework.