Live data from Hacker News

A whole website in a single JavaScript file

deno.com

161–170 of 170 posts

Re: A whole website in a single JavaScript file

#161
I keep seeing comments about static html vs generated html. So I have a question (please respond):

Why can’t we just run the example Deno program to generate snapshots of html?

It seems like some of us think pure static html is a good goal for some things, so why not use this Deno program to create the same html responses in generated files?

It’s probably the same amount of code because instead of writing a http response you write a file.

Of course you lose some functionality this way, but your app you rules imo

Re: A whole website in a single JavaScript file

#162
Warning: Mocking-JS plug

Meanwhile, I just created a JavaScript-free website.

Never have to worry about broken NPM, cookies, trackings, API, or JS-based malware.

And I use my iPhone/Android to edit/create web pages in Markdown, then my CI will build it and post it for me.

Look at the snazzy 3-D CSS, also JS-free.

Did I mention that I have a no-nonsense Privacy Policy?

3-D web page. https://egbert.net/blog/index.html

Re: A whole website in a single JavaScript file

#163
post #136
post #105

Earlier quoted context omitted.

But just like all other frameworks, the cost isn't just getting it started, it's learning the framework, learning the ecosystem, and slowly building up your knowledge of the edge cases when you start moving past it's limits. Next.js puts you squarely back in monolith server-side territory in that regard, it's just a different flavor. Of course it has it's upsides if you're doing a purely React application. But you've…

I wonder if this is why a keep reverting to PHP , most stuff I can build without frameworks or just the odd library because I know how. Everytime I give myself some free project experiments (have a local PI for tinkering) I always feel it’s unnecessarily complicated or feeling that hill I have to climb, at which point I can dream the solution in PHP frontend JS/HTML.

PHP (or, in my case these days, Deno serving templates, typically nunjucks) that have https://htmx.org/ in them for interactivity gets you productive, quickly, for a lot of the tasks I need to do.

That said, React makes building even more interactive, complicated things simple, and is easy to hire for, so thats what we use at work.

I do think the world is still ripe for a PHP-like language. The template-style webserver-aware way of doing things, with modern features. Maybe one day.

Re: A whole website in a single JavaScript file

#164
post #136
post #105

Earlier quoted context omitted.

But just like all other frameworks, the cost isn't just getting it started, it's learning the framework, learning the ecosystem, and slowly building up your knowledge of the edge cases when you start moving past it's limits. Next.js puts you squarely back in monolith server-side territory in that regard, it's just a different flavor. Of course it has it's upsides if you're doing a purely React application. But you've…

I wonder if this is why a keep reverting to PHP , most stuff I can build without frameworks or just the odd library because I know how. Everytime I give myself some free project experiments (have a local PI for tinkering) I always feel it’s unnecessarily complicated or feeling that hill I have to climb, at which point I can dream the solution in PHP frontend JS/HTML.

I've passed over that learning hump, put some projects into production with React, NextJS, and Vue, and I still think PHP + native JS/HTML is the more pragmatic tooling choice. It's more simple, robust and easy to debug. I've been experiencing some other backend frameworks too, specifically Node and Ruby stacks, and the PHP ecosystem and language is ahead by a country mile.

I think if you want to pick a pragmatic toolkit to work with long term and kick the churn to the curb, PHP is a great choice for web applications and will continue to be for a long time thanks to it's diaspora.

Re: A whole website in a single JavaScript file

#165

Warning: Mocking-JS plug Meanwhile, I just created a JavaScript-free website. Never have to worry about broken NPM, cookies, trackings, API, or JS-based malware. And I use my iPhone/Android to edit/create web pages in Markdown, then my CI will build it and post it for me. Look at the snazzy 3-D CSS, also JS-free. Did I mention that I have a no-nonsense Privacy Policy? 3-D web page. https://egbert.net/blog/index.html

Your link is giving a ERR_SSL_VERSION_OR_CIPHER_MISMATCH.

Re: A whole website in a single JavaScript file

#166

Warning: Mocking-JS plug Meanwhile, I just created a JavaScript-free website. Never have to worry about broken NPM, cookies, trackings, API, or JS-based malware. And I use my iPhone/Android to edit/create web pages in Markdown, then my CI will build it and post it for me. Look at the snazzy 3-D CSS, also JS-free. Did I mention that I have a no-nonsense Privacy Policy? 3-D web page. https://egbert.net/blog/index.html

Your link is giving a ERR_SSL_VERSION_OR_CIPHER_MISMATCH.

Drop your Chrome-based browser.

Website is only for those who do most-secured approaches.

Re: A whole website in a single JavaScript file

#167
post #38

Earlier quoted context omitted.

That never stopped working. Neither on the edge side (as your live site indicates, which has been edge cached for 109 days in San Francisco), or on the deployment site, as the example below shows: Try it out: https://hi-there.vercel.app ▲ /tmp/ mkdir hi-there ▲ /tmp/ cd hi-there ▲ hi-there/ echo ' hi sillysaurusx ' > index.html ▲ hi-there/ vc […] Inspect: https://vercel.com/rauchg/hi-there [690ms] Production: https:/…

Sorry Guillermo but you’re not being truthful here. “$ now” worked on any node server, not just static content, it would just run “npm start”. Now v2+ instead requires a handler-based approach.

[deleted]

Re: A whole website in a single JavaScript file

#168
post #38

Earlier quoted context omitted.

That never stopped working. Neither on the edge side (as your live site indicates, which has been edge cached for 109 days in San Francisco), or on the deployment site, as the example below shows: Try it out: https://hi-there.vercel.app ▲ /tmp/ mkdir hi-there ▲ /tmp/ cd hi-there ▲ hi-there/ echo ' hi sillysaurusx ' > index.html ▲ hi-there/ vc […] Inspect: https://vercel.com/rauchg/hi-there [690ms] Production: https:/…

Sorry Guillermo but you’re not being truthful here. “$ now” worked on any node server, not just static content, it would just run “npm start”. Now v2+ instead requires a handler-based approach.

I think I misunderstood his comment. I focused on the `index.html` example, but I think he was talking about servers (thanks for pointing that out). That said, the transition was good for servers too depending on what you were using. For example, `package.json` with Next.js was completely seamless!

Re: A whole website in a single JavaScript file

#169
post #104

Earlier quoted context omitted.

Have you actually had a look at Rails 7 with Turbo? It's nothing like what you're describing with NextJS etc. in that it aims to keep Javascript to an absolute minimum.

Yes, they’re sending HTML chunks over the wire. It’s the same end result though, except you’re still not exempted from learning JS.

It puts rendering back on the server where it belongs. The JS is minimal.

Re: A whole website in a single JavaScript file

#170
post #169

Earlier quoted context omitted.

Yes, they’re sending HTML chunks over the wire. It’s the same end result though, except you’re still not exempted from learning JS.

It puts rendering back on the server where it belongs. The JS is minimal.

I’ve seen garbage and exemplary sites produced with both methods. Rendering HTML with data hydrated server side and assembling it with a library client side vs rendering JSON and generating the HTML client side is a weird religious stance to take.
Post reply on HN