News for hackers. Stuff that matters.
Re:TodoMVC App Written in Vanilla JavaScript by kgbcia on Saturday May 07, 2022 @09:24AM (#31294257)
i agree it's up to the browsers chromium , Safari , and Firefox to do the diff. But we might need a new meta tag or change to the Fetch API to tell them this html page should only update the elements that are different.

Remember <meta http-equiv="refresh" content="5"> .

It was discouraged because the back button broke. If you're developing a single page react app, I don't think you care about the back button.

Re:TodoMVC App Written in Vanilla JavaScript by creakingstairs on Saturday May 07, 2022 @09:41AM (#31294347)
> If you're developing a single page react app, I don't think you care about the back button.

You should though. One easy way is to use react-router. e.g. going to /profile renders the Profile component. Then navigating to /dashboard renders the Dashboard component. Pressing the back button will take you to /profile.

Another pet peeve of mine is people using internal react state when they should just use path or query params to make it transparent and easily sharable.

Re:TodoMVC App Written in Vanilla JavaScript by nkrisc on Saturday May 07, 2022 @09:57AM (#31294481)
> If you're developing a single page react app, I don't think you care about the back button.

Your users likely do, so you should too.

Re:TodoMVC App Written in Vanilla JavaScript by alserio on Saturday May 07, 2022 @09:53AM (#31294447)
The primitives of fine grained reactive programming seem to me more amenable to be implemented by the browser than react-style whole world diffing