Top
Best
New

Posted by danabramov 4/15/2025

JSX over the Wire(overreacted.io)
267 points | 178 commentspage 6
lerp-io 4/16/2025|
isn’t this same thing as graphql?
wild_egg 4/15/2025||
Deja vu with this blog. Another overengineered abstraction recreating things that already exist.

Misunderstanding REST only to reinvent it in a more complex way. If your API speaks JSON, it's not REST unless/until you jump through all of these hoops to build a hypermedia client on top of it to translate the bespoke JSON into something meaningful.

Everyone ignores the "hypermedia constraint" part of REST and then has to work crazy magic to make up for it.

Instead, have your backend respond with HTML and you get everything else out of the box for free with a real REST interface.

danabramov 4/15/2025||
>Another overengineered abstraction recreating things that already exist.

This section is for you: https://overreacted.io/jsx-over-the-wire/#html-ssi-and-cgi

>Everyone ignores the "hypermedia constraint" part of REST and then has to work crazy magic to make up for it.

Right, that's why I've linked to https://htmx.org/essays/how-did-rest-come-to-mean-the-opposi... the moment we started talking about this. The post also clarifies multiple times that I'm talking about how REST is used in practice, not its "textbook" interpretation that nobody refers to except in these arguments.

wild_egg 4/15/2025||
> This section is for you: https://overreacted.io/jsx-over-the-wire/#html-ssi-and-cgi

Strawmanning the alternative as CGI with shell scripts really makes the entire post that much weaker.

> nobody refers to except in these arguments.

Be the change, maybe? People use REST like this because people write articles like this which uses REST this way.

danabramov 4/15/2025||
>Strawmanning the alternative as CGI with shell scripts really makes the entire post that much weaker.

I wasn't trying to strawman it--I was genuinely trying to show the historical progression. The snark was intended for the likely HN commenter who'd say this without reading, but the rest of the exploration is sincere. I tried to do it justice but lmk if I missed the mark.

>Be the change, maybe?

That's what I'm trying to do :-) This article is an argument for hypermedia as the API. See the shape of response here: https://overreacted.io/jsx-over-the-wire/#the-data-always-fl...

I think I've sufficiently motivated why that response isn't HTML originally; however, it can be turned into HTML which is also mentioned in the article.

timw4mail 4/15/2025|||
The hypermedia constraint is crazy magic itself. It's not like HATEOAS is fewer steps on the application and server side.
nsonha 4/17/2025||
I have yet to see these mythical HATEOAS compliant applications, they must be so amazing and simple, example anyone?

And if it turns out that there is no such thing, should I conclude that all these people talking about it really just base their opinion on some academic talking points and are actually full of shit?

nsonha 4/17/2025|||
> have your backend respond with HTML and you get everything else out of the box for free with a real REST interface.

speak like someone who's never made a real product. Please enlighten us on how you add interactivity to your client, which flavour of spaghetti js? How do you handle client states, conveniently everything's on the backend?

aylmao 4/15/2025||
We already have a way one way to render things on the browser, everyone. Wrap it up, there's definitely no more to explore here.

And while we're at it, I'd like to know, why are people still building new and different game engines, programming languages, web browsers, operating systems, shells, etc, etc. Don't they know those things already exist?

/s

Joking aside, what's wrong with finding a new way of doing something? This is how we learn and discover things.

williamcotton 4/16/2025||
We’re in the nineties, okay?

Whee!

  #!/usr/bin/perl
  
  $ENV{'REQUEST_METHOD'} =~ tr/a-z/A-Z/;
  if ($ENV{'REQUEST_METHOD'} eq "GET") {
      $buffer = $ENV{'QUERY_STRING'};
  }
  
  print "Content-type: text/html\n\n";
  
  $post_id = $buffer;
  $post_id =~ s/&.*//;  # Get first parameter (before any &)
  $post_id =~ s/[^a-zA-Z0-9\._-]//g;  # Sanitize input
  
  $truncate = ($buffer =~ /truncateContent=true/) ? 1 : 0;
  
  $title = `mysql -u admin -p'password' -D blog --skip-column-names -e "SELECT title FROM posts WHERE url='$post_id'"`;
  chomp($title);
  
  $content = `mysql -u admin -p'password' -D blog --skip-column-names -e "SELECT content FROM posts WHERE url='$post_id'"`;
  chomp($content);
  
  if ($truncate) {
      # Extract first paragraph (everything before the first blank line)
      $first_paragraph = $content;
      $first_paragraph =~ s/\n\n.*//s;
      
      print "<h3><a href=\"/$post_id.html\">$title</a></h3>\n";
      print "<p>$first_paragraph [...]</p>\n";
  } else {
      print "<h1>$title</h1>\n";
      print "<p>\n";
      print "$content\n";
      print "</p>\n";
  }
reactsux 4/16/2025||
[dead]
whalesalad 4/15/2025|
[flagged]
yawaramin 4/15/2025||
It's the standard dose of Abramov.
danabramov 4/15/2025||
This is what happens when I don't write for a few years
emmanueloga_ 4/15/2025||
Hey, thanks for sharing your thoughts! I appreciate you putting this out there.

One bit of hopefully constructive feedback: your previous post ran about 60 printed pages, this one's closer to 40 (just using that as a rough proxy for time-to-read). I’ve only skimmed both for now, but I found it hard to pin down the main purpose or takeaway. An abstract-style opening and a clear conclusion would go a long way, like in academic papers. I think that makes dense material way more digestible.

danabramov 4/15/2025||
There's a recap for each major section:

- https://overreacted.io/jsx-over-the-wire/#recap-json-as-comp...

- https://overreacted.io/jsx-over-the-wire/#recap-components-a...

- https://overreacted.io/jsx-over-the-wire/#recap-jsx-over-the...

I don't think I can compress it further. Generally speaking I'm counting on other people carrying useful things out of my posts and finding more concise formats for those.

emmanueloga_ 4/15/2025|||
From my perspective, the article seems primarily focused on promoting React Server Components, so you could mention that at the very top. If that’s not the case, then a clearer outline of the article’s objectives would help. In technical writing, it’s generally better to make your argument explicit rather than leave it open to reader interpretation or including a "twist" at the end.

An outline doesn't have to be a compressed version, I think more like a map of the content, which tells me what to expect as I make progress through the article. You might consider using a structure like SCQA [1] or similar.

--

1: https://analytic-storytelling.com/scqa-what-is-it-how-does-i...

danabramov 4/16/2025||
I appreciate the suggestions but that’s just not how I like to write. There’s plenty of people who do so you might find their writing more enjoyable. I’m hoping some of them will pick something useful in my writing too, which would help it reach a wider audience.
yawaramin 4/15/2025|||
Try the BLUF style: https://www.animalz.co/blog/bottom-line-up-front/