> rendered dynamically, just in time, at the edge, close to the user. HTML. You're serving HTML. Doesn't really matter that the server-side language is JS, PHP, or BASIC.
A whole website in a single JavaScript file
21–30 of 170 posts
Re: A whole website in a single JavaScript file
#22Earlier quoted context omitted.
I think you might have misunderstood the blog post. It is server-side rendering on the edge, shipping nothing more than plain HTML/CSS to the browser. There is no client side JS *at all* here.
I understand the blog post, and the capability itself is neat, but I'm having a hard time understanding the utility in what they are showcasing from the actual example site[0]. As other posters have pointed out, why not do it in HTML from the start? It's more simple and efficient than this -or any- framework. Just drop the ol HTML file on your server and away you go! I understand that the supposed "real" utility in t…
But this example does showcase a few things you don't typically get with a single vanilla HTML file:
- JSX + reusable/shared components
- Multiple URLs / pages
- Tailwind
Re: A whole website in a single JavaScript file
#23This starts to make sense when you consider the self-flagellation of a full server-side-rendering production setup that has existed over the past decade, to the point many SPA products completely give up on SSR - or nowadays throw themselves at the walled garden of Vercel/Next.js etc to solve it for them.
I am not a fan of Vercel's strategy, but exactly how is the open source and MIT licensed Next.js a walled garden?
Re: A whole website in a single JavaScript file
#24"time to interactive: 1.0s / first content paint 1.0s" My man, let me introduce you to ... HTML. It has "time to interactive" at 0.0 seconds and content paints instantly!
I think it's actually much worse than that - it's a little tricky to tell on mobile, but going from "stats" to "bagle" and back again - looks like this mucks up the client side cache? While one whole second is "90s slow" for a first render for a static site - it's truly ludicrous for navigating back to an already cached page? How are the cache control headers with this set-up - is there a varnish or similar cdn/cache…
Re: A whole website in a single JavaScript file
#25> rendered dynamically, just in time, at the edge, close to the user. HTML. You're serving HTML. Doesn't really matter that the server-side language is JS, PHP, or BASIC.
Aaron from Deno here. Of course it's producing HTML as an output, but the point is that you can use JSX and familiar technologies like tailwind to dynamically generate that HTML at edge vs client side. And unlike a pure static site, you can add API or form routes
Re: A whole website in a single JavaScript file
#26Earlier quoted context omitted.
I am not a fan of Vercel's strategy, but exactly how is the open source and MIT licensed Next.js a walled garden?
It's not. Next.js works on any platform supporting Node, and Vercel supports more than just Next.js. They support dozens of other frameworks.[0] They do promote Next.js on Vercel, but they don't stop you from using other systems. [0]: https://vercel.com/new/templates
On the other hand, https://docs.ycombinator.lol/ has been running for years without me ever having to worry once, so there's that. Maybe it's time to give them another try.
Re: A whole website in a single JavaScript file
#27Earlier quoted context omitted.
I understand the blog post, and the capability itself is neat, but I'm having a hard time understanding the utility in what they are showcasing from the actual example site[0]. As other posters have pointed out, why not do it in HTML from the start? It's more simple and efficient than this -or any- framework. Just drop the ol HTML file on your server and away you go! I understand that the supposed "real" utility in t…
I agree we could have elaborated on auth, API endpoints or parametric routes (maybe a follow up !). But this example does showcase a few things you don't typically get with a single vanilla HTML file: - JSX + reusable/shared components - Multiple URLs / pages - Tailwind
Clicking around with the Dev Console open and watching the pages in Sources was enjoyable.
Re: A whole website in a single JavaScript file
#28Earlier quoted context omitted.
Aaron from Deno here. Of course it's producing HTML as an output, but the point is that you can use JSX and familiar technologies like tailwind to dynamically generate that HTML at edge vs client side. And unlike a pure static site, you can add API or form routes
Oh. So you've reinvented PHP. Nice.
Re: A whole website in a single JavaScript file
#29Earlier quoted context omitted.
Aaron from Deno here. Of course it's producing HTML as an output, but the point is that you can use JSX and familiar technologies like tailwind to dynamically generate that HTML at edge vs client side. And unlike a pure static site, you can add API or form routes
Oh. So you've reinvented PHP. Nice.
Re: A whole website in a single JavaScript file
#30The fact that it is in Deno rather than PHP, Ruby or Python is the point of the article.