Live data from Hacker News

Look ma, no React: I recoded my portfolio site with vanilla everything

clairefro.dev

151–160 of 192 posts

Re: Look ma, no React: I recoded my portfolio site with vanilla everything

#151

Earlier quoted context omitted.

I think a culture has been created where anything resembling server-side rendering (other than Node spitting out JSON) is legacy to be avoided ..... until of course the Javascript creates its own convoluted version of server-side rendering, which is revolutionary and the new hotness.

The main benefit to JS being used as a server side rendered and client side rendered language is that you have a lot more control over which parts you want on the server vs the client, and you can introduce hydration where needed. You technically could do that in PHP and other non JS languages but that's annoying because you'll be mixing multiple languages together and it would be more clunky. So yes, there is some "…

My least favorite JavaScript argument is “Instead of using one good language for the backend and one lousy one for the front end, we’ll rewrite ALL the code in the lousy language to keep it easy!”

I fail to understand why anybody would use JavaScript - a language so bad everybody uses a series of wrappers around it - for anything they didn’t absolutely have to (e.g. client code).

The entire point of the MVC architecture is to allow you to pick the best tools for the job.

EDIT: I’m not saying PHP is good, though it’s better than JS. And TypeScript is still JavaScript with extra steps.

Re: Look ma, no React: I recoded my portfolio site with vanilla everything

#152
post #151

Earlier quoted context omitted.

The main benefit to JS being used as a server side rendered and client side rendered language is that you have a lot more control over which parts you want on the server vs the client, and you can introduce hydration where needed. You technically could do that in PHP and other non JS languages but that's annoying because you'll be mixing multiple languages together and it would be more clunky. So yes, there is some "…

My least favorite JavaScript argument is “Instead of using one good language for the backend and one lousy one for the front end, we’ll rewrite ALL the code in the lousy language to keep it easy!” I fail to understand why anybody would use JavaScript - a language so bad everybody uses a series of wrappers around it - for anything they didn’t absolutely have to (e.g. client code). The entire point of the MVC architect…

PHP is a good language? Lol

TypeScript is an excellent language and I agree, no one should be using Javascript anymore.

Re: Look ma, no React: I recoded my portfolio site with vanilla everything

#153

Yes you don’t need React for a static site. Is this news at this point? Also I find the colour scheme hard to read but maybe it’s just me.

I use React for static sites and really enjoy it. * as it’s simplest, it’s a really easy to use templating tool. * there are a tools that compile to mostly static HTML, so not performance hits * theres almost always something that pushes you to want some JS. React is handy to have. It also opens the door to all of the the community packages. No sense to re-invent the wheel.

Curious what you mean by “almost always something” that makes you use JS?

What besides shitty/illegal tracking code and cookies do you need to include? Honest question.

Re: Look ma, no React: I recoded my portfolio site with vanilla everything

#154
post #20
post #3

Can I write a React app and recompile it as a vanilla? For example to take all involved parts of the library and not take the rest.

That doesn't really parse. React as a thing is some pretty thin DOM manipulation and some helper stuff. Are you thinking of something like Next or some all-in React+Redux stack?

As misfortune would have it, I spent a significant fraction of the day reading the implementation of hooks for fibers. There's nothing light weight about virtual Dom, reconciliation, and micro task queues.

Re: Look ma, no React: I recoded my portfolio site with vanilla everything

#155
post #151

Earlier quoted context omitted.

My least favorite JavaScript argument is “Instead of using one good language for the backend and one lousy one for the front end, we’ll rewrite ALL the code in the lousy language to keep it easy!” I fail to understand why anybody would use JavaScript - a language so bad everybody uses a series of wrappers around it - for anything they didn’t absolutely have to (e.g. client code). The entire point of the MVC architect…

PHP is a good language? Lol TypeScript is an excellent language and I agree, no one should be using Javascript anymore.

PHP is a good language nowadays. Much better than JS. Also, Jimmy Hendrix is dead.

Re: Look ma, no React: I recoded my portfolio site with vanilla everything

#156
post #15

Earlier quoted context omitted.

"A convoluted SPA" is fully orthogonal to React. If you're making a blog into a SPA, that's a you problem. It's been possible (and recommended for many things!) to just bake a static website with React and use JSX as a templating language for a long time.

Why would you need JSX for a static website? If you need JS then it's not "static".

Because they only know JS and it’s ecosystem.

Re: Look ma, no React: I recoded my portfolio site with vanilla everything

#157
post #153

Earlier quoted context omitted.

I use React for static sites and really enjoy it. * as it’s simplest, it’s a really easy to use templating tool. * there are a tools that compile to mostly static HTML, so not performance hits * theres almost always something that pushes you to want some JS. React is handy to have. It also opens the door to all of the the community packages. No sense to re-invent the wheel.

Curious what you mean by “almost always something” that makes you use JS? What besides shitty/illegal tracking code and cookies do you need to include? Honest question.

In my case, we wanted to gather feedback on a product we were launching. Because we wanted to move fast, we’re in a regulated industry, and our initial tests were simple, we decided to built a simple “chatbot” style feedback tool.

More generally, forms. Forms always seems to morph into more than just simple inputs.

Re: Look ma, no React: I recoded my portfolio site with vanilla everything

#158
About that Paperfuge analogy ... maybe I am stupid or overly skeptic but I haven't seen that paper wheel carry any samples in the video. If there was some solution to mount samples (symmetrically I'd guess) it would become quite dangerous to rotate them 120.000 rpm without any enclosure, right?

Re: Look ma, no React: I recoded my portfolio site with vanilla everything

#159

Earlier quoted context omitted.

PHP pages absolutely have to be built/rendered.

I think the distinction is that PHP is interpreted in real time most often. So there is rarely a separate build step.

It’s a build step that happens every time the page is loaded instead of once when it’s deployed.

Re: Look ma, no React: I recoded my portfolio site with vanilla everything

#160
post #134

Earlier quoted context omitted.

I think you all missed GPs point, JS is barely required, let alone an SPA framework, let alone static generation in an SPA framework, etc.

And you're missing the other GPs point. Even when building a static website, you might want to reuse components. Or use shared components. Or do some logic. Or easily compose things. Note they said "JSX as a templating language". Why worsen the experience using Python + Jinja when you're just building a static site.

Mm, herein lies the problem, I was not thinking about Python at all, and I suspect we are all thinking about various different tools.

A static site is necessarily not dynamic though, as soon as you need dynamic features you need to reach for one tool or another. "Static site generators" are just dynamic sites with a pre-compile step instead of JIT.

When I think of a static site, I am thinking HTML, CSS, some server side includes for header and footer. A bit of vanilla JS if you absolutely need it. Apache and nginx both have native template includes so you don't even need an extra language like py or php.

Post reply on HN