Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Conversation

treejamie
Copy link
Owner

@treejamie treejamie commented Apr 9, 2025

https://nextjs.org/learn/dashboard-app/streaming

Covers:

  • What streaming is and when you might use it.
  • How to implement streaming with loading.tsx (a new special file) and Suspense.
  • What loading skeletons are.
  • What Next.js Route Groups are, and when you might use them. dashboard / (overview) / page.tsx
  • Where to place React Suspense boundaries in your application.

Phoenix's LiveView vs Next.js Streaming

It is an obvious question that I had, but I wanted to have it answered and this seemed like the place to do it. I am beginning to think that Next.js may be a better use case for the personal blog and Elixir may be a better fit for dendromeda.

hmm. Anyhoo...

Just incase you were wondering - good old Professor GPT had this to say (everything below is LLM)

⚡ Phoenix LiveView vs 🔄 Next.js Streaming

Next.js streaming and Phoenix LiveView both tackle UI responsiveness and interactivity, but they come from different philosophies. Here's how they compare:


⚡ Phoenix LiveView

  • Server-rendered UI updates over WebSockets
  • State lives on the server
  • UI updates are streamed via diffs — no custom JS needed for most interactivity
  • Super efficient, real-time feel with minimal client logic
  • Elixir-powered, very lightweight on the frontend

🔧 Feels like: “Live backend controlling the DOM directly”


🔄 Next.js Streaming (React Server Components / Suspense)

  • Partial rendering streamed over HTTP
  • Uses React's Suspense and async server components
  • Improves Time to First Byte (TTFB) and perceived load time
  • State is mostly client-side or hydrated after load (or managed with tools like useState, useEffect, etc.)

🔧 Feels like: “Progressively streamed HTML until hydration kicks in”


🧠 Core differences

Feature Phoenix LiveView Next.js Streaming
Transport WebSocket HTTP
State Location Server Client (mostly)
UI Update Mechanism DOM patches via diffs HTML streaming & React hydrate
JS Required? Minimal to none React + client JS
Use Case Fit Real-time dashboards, forms Fast SSR, complex app pages

🧪 TL;DR

  • LiveView is real-time UI with live server state over WebSockets.
  • Next.js streaming is fast partial server-side rendering with progressive HTML and hydration.

They’re both brilliant — just with different tradeoffs and stack roots. If you're loving LiveView, you might find RSCs + server actions in Next.js kinda similar in spirit, but not as seamless for real-time interactivity (without adding your own sockets or SWR).

Copy link

vercel bot commented Apr 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nextjs-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2025 7:43am

@treejamie treejamie changed the title Updated the readme 9 - Streaming Apr 9, 2025
@treejamie treejamie self-assigned this Apr 9, 2025
@treejamie treejamie merged commit b618535 into main Apr 9, 2025
2 checks passed
@treejamie treejamie deleted the 9-streaming branch April 9, 2025 07:44
@github-project-automation github-project-automation bot moved this to WK DONE in Project Learn Apr 9, 2025
@treejamie treejamie moved this from WK DONE to APR 25 ARCHIVE in Project Learn Apr 14, 2025
@treejamie treejamie moved this from APR 25 ARCHIVE to In progress in Project Learn Apr 14, 2025
@treejamie treejamie removed the status in Project Learn Apr 14, 2025
@treejamie treejamie moved this to APR 25 ARCHIVE in Project Learn Apr 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

No open projects
Status: APR 25 ARCHIVE

Development

Successfully merging this pull request may close these issues.

1 participant