frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

HTML over WebSockets: real-time SPAs with barely any JavaScript

https://en.andros.dev/blog/ef4968f5/html-over-websockets-real-time-spas-with-barely-any-javascript/
15•redbell•1h ago

Comments

thiagovsdiniz•42m ago
great one
ChiperSoft•38m ago
Is this satire? Rage bait? Why would you ever do this?

Just make a normal website!! You've invented an MPA with extra steps!

x0x0•28m ago
Responsive site built via server-side render, with a particular benefit for partial page updates. 90% of the benefit of an SPA but 10% of the code: no api, no moving of system of record for state back and forth between database and browser (it's always db), etc. And you can avoid react.

A common use case: eg in Rails, a user has a table open. you can stream new records to the top of that table as they are created in ~5 lines of ruby (a broadcast on the model, and put the table rows in a turbo_frame with a turbo_stream_from somewhere on the page).

There are real limits to this -- you have to hold the update dependency graph in your head -- but the benefits are huge for small to medium amounts of responsiveness.

My experience has been great with Rails/Turbo and htmx.

hackingonempty•33m ago
> The quick rule: if you need bidirectional, low-latency communication (chat, collaboration, games), WebSocket; if you only push from the server, SSE is simpler and cheaper to operate.

For most apps just use SSE and the built-in code for making HTTP requests (Fetch) instead of hacking up your own client side JS to make requests over a WebSocket. The latency is the same because modern browsers multiplex HTTP requests over a single TCP connection that is left open.

Maybe if you are making many client requests per second there is an advantage to not sending full headers/cookies/etc... on each request but not if you're sending requests in response to user clicks/touches.

Any sufficiently complicated SPA contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Fetch.

doublerabbit•32m ago
> Simple, elegant and fast.

Until someone bombs your websocket server and you then have nothing at all.

hyperhello•27m ago
What’s wrong with this idea, really? It’s redundant because you can serve HTML to requests with Apache or Ngnix or any other server on the happy path.

What’s right with the idea, really? It’s exactly what the tried and true preferences of developers have been shown to be: getting in the way of the happy path for no reason.

Now you can have build steps and put story points in Jira and do it all on the server where we don’t have to see it, and the success condition is that the text gets served. Both sides can be happy now.

doublerabbit•10m ago
> What’s wrong with this idea, really? It’s redundant because you can serve HTML to requests with Apache or Ngnix or any other server on the happy path.

Overhead, security, denial of service.

You now have two states to track. Is the web-server up to date with the version the web socket is hosting ?

Then you need to keep the web server inline with the web-socket. Is monitoring correct, is your web server going to be alive if the web socket server is offline?

If they both use the same source of truth why not just use the web-server which is more tried and true and much more reliable than JavaScript.

And you can actually serve a page without requiring JavaScript.

You still need something to serve the JavaScript fronted of the website so unless you create a WebSocket HTTP server which is then you're opening can of worms, you have a web-server sitting idle wasting resources.

I bombard your web socket server and now you're rendering nothing at all yet the web server is still trying to serve content.

nchmy•20m ago
A good response to this post

https://yagni.club/3mstlyuxe5s26

petcat•19m ago
You're going to run into all kinds of issues with head of line blocking, and the fact that browsers typically only allow a few persistent connections to the same origin at a time.

Just do regular HTTP(2) requests. Browsers are extremely optimized for that. You don't need to invent your own transport and then manually splat a bunch of dynamic HTML on the dom.

Openhare: AI-powered desktop SQL client. Cross-platform. Built with Flutter

https://github.com/sjjian/openhare
1•thunderbong•1m ago•0 comments

Spotify to Begin Labelling AI-Generated Artist Profiles

https://thequietus.com/news/spotify-to-begin-labelling-ai-generated-artist-profiles/
1•cdrnsf•2m ago•0 comments

To Improve Student Mental Health, University of Michigan Eases Grading

https://www.nytimes.com/2026/08/11/us/university-michigan-grades-freshmen-pass-fail.html
1•tejohnso•2m ago•1 comments

A Multi-Agent AI Framework Used to Compromise Government Entities in Asia

https://dreamgroup.com/blog/inside-a-multi-agent-ai-framework-used-to-compromise-government-entit...
1•mikeleeorg•4m ago•0 comments

Ten customers paying for early access to Donald Trump's social media posts

https://www.rte.ie/news/business/2026/0811/1587435-trump-social-media/
2•derriz•5m ago•0 comments

DeepSeek v4 pro 0813 released

1•alexwwang•6m ago•0 comments

When fewer commits don't mean less work

https://andreasthinks.me/posts/ai-tools-and-the-shape-of-commits/
1•speckx•8m ago•0 comments

Hungary to sink barges and build a sill on Danube to keep nuclear plant running

https://www.nbcnews.com/world/hungary/hungary-sink-barges-build-sill-danube-river-keep-nuclear-pl...
1•ceejayoz•9m ago•1 comments

Signal adds new security feature to thwart man-in-the-middle attacks

https://www.bleepingcomputer.com/news/security/signal-adds-new-security-feature-to-thwart-man-in-...
3•DemiGuru•10m ago•0 comments

USS Abraham Lincoln sailors tried to jump overboard amid extended deployment

https://www.theguardian.com/us-news/2026/aug/12/uss-abraham-lincoln-overboard-extended-deployment
4•hggh•10m ago•0 comments

How do you run a steam locomotive without fire?

https://www.youtube.com/watch?v=ruU793kSDuA
1•fanf2•11m ago•0 comments

Lazarus hackers exploited Windows zero-day to target defense firms

https://www.bleepingcomputer.com/news/security/lazarus-hackers-exploited-windows-zero-day-to-targ...
4•DemiGuru•11m ago•0 comments

Cryptic but Consistent

https://www.johndcook.com/blog/2026/08/12/cryptic-but-consistent/
1•ibobev•11m ago•0 comments

Peter – graph-based agent orchestration as a Claude Code skill

https://github.com/robertkeus/peter
1•robertkeus•12m ago•0 comments

Show HN: AutoCorrect PC – Autocorrect, predictive text, AI writing for Windows

https://www.autocorrectforpc.com
1•Enyaaba•13m ago•0 comments

Open Source Equivalence Checking Tool for FPGA Design

https://github.com/keplertech/kepler-formal/tree/main/examples/xilinx
1•nanocoh•15m ago•1 comments

Aaron Rodgers secretly funded his town's Flock-style cameras

https://www.foiaball.com/p/aaron-rodgers-secretly-bought-police-alpr-cameras
10•hn_acker•16m ago•0 comments

S. R. Ranganathan

https://en.wikipedia.org/wiki/S._R._Ranganathan
2•_doctor_love•16m ago•0 comments

Show HN: Programmdle, a daily Wordle game for guessing programming languages

https://programmdle.dev
1•RajMayekar•16m ago•0 comments

Hibbey – An anonymous encounter space with no profiles or tracking

https://hibbey.com/
1•bimbaxer•17m ago•0 comments

AI Tool Aims to Help Conserve Japan's Cherry Trees by Assessing Many Photos

https://japannews.yomiuri.co.jp/science-nature/technology/20250423-250572/
1•mushstory•17m ago•0 comments

I Measured Mario's Gravity and It Makes No Sense [video]

https://www.youtube.com/watch?v=ICS02VK42oU
1•TrueGeek•19m ago•0 comments

A gas-enshrouded and gas-reddened black hole at cosmic dawn

https://www.nature.com/articles/s41586-026-10846-4
1•i_no_can_eat•19m ago•0 comments

AI programming: are you angry yet? [video]

https://lemire.me/blog/2026/08/12/ai-programming-are-you-angry-yet/
1•ibobev•20m ago•0 comments

Sign of the Times: An Account of the First Tech Workers' Strike

https://longhaulmag.com/first-tech-workers-strike/
2•cdrnsf•20m ago•0 comments

Show HN: Reallyfrom.me – vouch that your message is from you

1•kiddz•20m ago•0 comments

Researchers Show How Meta's 'Pervert Glasses' Are Used to Harass Women

https://www.404media.co/meta-ray-ban-smart-glasses-pov-instagram-pickup-artists/
2•cdrnsf•20m ago•0 comments

Hadamard Matrix of Order 668

https://epoch.ai/frontiermath/open-problems/hadamard
1•vok•22m ago•0 comments

Privacy-First Smart Home Cameras and Doorbells: Local Processing vs. Cloud

https://capytoolkit.com/blog/buying-guides/privacy-smart-home-cameras-doorbells-local-cloud-check/
2•ChillyCapy•24m ago•0 comments

Ninth Circuit Rewrites Section 230 To Remove The Part That Actually Mattered

https://www.techdirt.com/2026/08/12/ninth-circuit-rewrites-section-230-to-remove-the-part-that-ac...
4•hn_acker•25m ago•0 comments