News for hackers. Stuff that matters.
Re:Htmx and URL State Management by PaulHoule on Tuesday July 29, 2025 @08:26PM (#44729796)
This is a classic pattern of web applications from the 1990s. Works amazingly well even w/o HTMX
Re:Htmx and URL State Management by nosefurhairdo on Tuesday July 29, 2025 @08:36PM (#44729855)
One of the legitimate grievances of SPAs is that they made this pattern less obvious.
Re:Htmx and URL State Management by PaulHoule on Tuesday July 29, 2025 @09:26PM (#44730147)
I find the whole thing where you configure your web server to serve the same thing from

  http://example.com/application
and

  http://example.com/application/with/path?and=parameters
to be absolutely nerve-wracking. Not hard to do but it's just batshit crazy and breaks the whole idea of how web crawlers are supposed to work. On the other hand, we had trouble with people (who we know want to crawl us specifically) crawling a site where you visit

   http://example.com/item/448828
and it loads an SPA which in turn fetches a well-structured JSON documents like

   http://api.example.com/item/448827
   http://api.example.com/item/448828
   http://api.example.com/item/448829
with no cache so it downloads megabytes of HTML, Javascript, Images and who knows what -- and if they want to deal with the content in a structured way and it put it in a database it's already in the exact format they want. But I guess it's easier to stand up a Rube Goldberg machine and write parsers when you could look at our site in the developers tools and figure out how it works in five minutes... and just load those JSON documents into a document database and be querying right out of the gate.
Re:Htmx and URL State Management by eadmund on Tuesday July 29, 2025 @10:06PM (#44730326)
What I would want is to GET http://example.com/item/448828 with an Accept header of ‘application/s-expression,application/json;q=0.1’ instead of retrieving the HTML representation of the resource. HTTP is the API.

I also want http://example.com/application/with/path?and=parameters and http://example.com/application to return Link headers with rel=canonical appropriately.

I’d also like world peace.

Re:Htmx and URL State Management by lyu07282 on Wednesday July 30, 2025 @06:37AM (#44732630)
it felt like this was an opportunity for AI craze to adopt on top of the existing standards, instead they all invented their own stuff with llm.txt and MCP *sigh*
Re:Htmx and URL State Management by pjmlp on Wednesday July 30, 2025 @07:52AM (#44733031)
More like we have a whole generation educated in bootcamps that think they need SPAs for doing anything.
Re:Htmx and URL State Management by fny on Wednesday July 30, 2025 @04:18AM (#44731952)
Coming up next: moving JS outside of markup with selectors.