Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Now that the Web Platform as a whole has gained so many amazing features and quality-of-developer-life improvements, I think the pendulum was always going to swing back. <div id="root" /> was the "one true way" in the early-mid 2010s for a reason.

But now we're all thinking in terms of components already, so whole-pages-only is not needed -- serve up partials only, and have your thin JS layer combine them all.

Use the platforms features for as much interactivity as it can get you, for UX/UI reasons, and then use small amounts of JS for those things where you can't.

It's quite nice! Though I still make my bread and butter with the <div id="root" /> as it currently stands. We'll see if that changes.

Hilariously, in 2016 I tried to push a "front-end web server that consumes the API and gives up HTML/HTML partials" idea that was this exact pattern, but could not get enough buy-in at the place I was at. The tools weren't quite there, so we'd have to build a lot of them ourselves.

Now, the tools are built (or being built)!



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: