My Authors
Read all threads
The longer I spend on an SPA, the more it feels like reimplementing the entire browser myself. Example: you set titles per-page. But then those titles persist when navigating to a different page. So you have to always set the page title on navigation, reimplementing the browser.
Likewise for the meta description tag: you have to actually find and modify the <meta name="description"> DOM node every time the user navigates to a new page. (And implementing the entire concept of "page" is your problem!)
As a result, we now have this component. Which I imagine is duplicated in tens or hundreds of thousands of other SPAs in the world, all reimplementing browser functionality. gist.github.com/garybernhardt/…
I think it's pretty clear where this goes in the long term, but I'm afraid to even write it out because I simultaneously (1) do not want to see it happen and (2) kind of want to be the one that does it.
if violence is guaranteed to be visited upon the world then at least I can hope that it will be visited by my own keyboard
"You have to do that on the server too!"

Please give me the benefit of the doubt: I have programmed computers.

If one server-side template renders a <title>, it does not affect every other server-side template that renders after it. That's what happens in an SPA.
Also got a bit of <massive tool that duct tapes dozens of projects together, each of which is a leaky abstraction, forming a larger and even more leaky meta-abstraction> solves this problem! I have gone down that road many, many times and it leads to:
These are pretty good summaries of how things go wrong in software!

1. Misunderstand the problem and claim that it doesn't exist or is trivial; or
2. Accept that the problem exists and blindly assume that installing a massive, opaque, frequently changing dependency "solves" it.
Things are *complicated*.
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Gary Bernhardt

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!