7 ms·
The modern web loads the whole website on your first visit, aka SPA. Plus React 150kb, Bootstrap 150kb and all their plugins make it multi megabyte. I was thi
by habibur 5y ago
The modern web loads the whole website on your first visit, aka SPA.
Plus React 150kb, Bootstrap 150kb and all their plugins make it multi megabyte.
I was thinking about converting my old server rendered web site into modern web. Still wondering if it's worth it.
- bgroat 5y agoIt isn't
- capableweb 5y agoThat's last years modern web. This years modern web splits up the JS bundle based on the pages so you only load what's required for each page. So we're basically back to square one. > I was thinking about converting my old server rendered web site into modern web. Still wondering if it's worth it. As usual guideline I tend to use: Are you building a website or a web application? If you're building a website, you're best off with just static pages or static pages generated dynamically. If you need lots of interactivity and similar, better to build a web application, and React fits well for that purpose.
- systemvoltage 5y agoI really like the idea of server side rendering. Flask/Django style backend and use Jinja2 templates, sprinkle some vanilla JS for interaction if needed. I wonder if it is safe to say vast majority of websites are simple enough to use the aforementioned pattern? There are so many "Doctors appointment" type dynamic websites that I don't think need anything like React or Angular. I think React is great if you're building the next Notion or a web-based application such as Google Sheets. Edit: Yeah, I am new to webdev and I find server side rendering "refreshing" :-)
- the__alchemist 5y agoI do this. It's remarkable this is considered to be a novel pattern! (Note that some of the advances in modern CSS and JS made this more feasible than it used to be)
- vbsteven 5y agoIt’s not just an idea. It’s tech that has been around for decades now. Rails, Django, Spring, Laravel, Sinatra, Flask and hundreds of others. They work fine for a large chunk of modern websites. And server side templating is not the only concept from that era that is much simpler than what is popular now. Those frameworks were primarily synchronous instead of asynchronous. And they worked in pretty much every browser. Without breaking the back button. With shareable links. And no scrolljacking. For me personally the sweet spot for many applications/websites is still just that: A synchronous MVC framework with serverside rendering. With a sprinkle of vanilla JS or Vue on select pages for dynamic stuff.
- pjmlp 5y agoSame here, such approaches work and do the job just fine.
- yurishimo 5y agoSince you say you're new, it might be worth looking at Laravel if you learned with the componentized JS approach. The Blade templating language they've been perfecting for years now has started to embrace composable components very similar to a JS framework, but all server-side. https://laravel.com/docs/8.x/blade#anonymous-components https://laravel.com/docs/8.x/blade#anonymous-components https://laracasts.com/series/blade-component-cookbook/episodes/1 https://laracasts.com/series/blade-component-cookbook/episod...
- osrec 5y agoThat's only when done poorly, which unfortunately has become the norm. Properly done modern websites load things incrementally, as and when they're needed, while cleanly separating the front end logic from the back end.
- bdcravens 5y agoThe No True Scotsman argument could also be applied to the technologies that "modern websites" were supposed to replace.
- sneak 5y agoThe downside of this "modern" approach is that you break the website for anyone with javascript off, or using a text browser.
- hypertele-Xii 5y agoDoesn't it also break basic caching? That is, I can't download a "modern" website to view it offline because it's actually just a rendering shim that needs to phone home for the content?
- goodpoint 5y ago...also everybody without modern and/or expensive hardware AKA 2 billion people in the world.
- grishka 5y agoMost often though, your first visit is your only visit.