Live data from Hacker News

Things I wish I knew before moving 50K lines of code to React Server Components

mux.com

451–460 of 540 posts

Re: Things I wish I knew before moving 50K lines of code to React Server Components

#451
post #379

Earlier quoted context omitted.

The argument is usually that you don't want a network round trip for interactivity. That's less true than it's usually presented, I think because most folks making that argument think the server is necessarily slow.

But... a round trip is usually faster than serving 2MB of JavaScript.

It feels worse for user experience though. I think people forgot why SPAs were so popular in the first place.

Re: Things I wish I knew before moving 50K lines of code to React Server Components

#452

Does anyone know if CSS-in-JS and Context support is planned for RSC, or is there a technical limitation which means they’ll never be possible?

For CSS-in-JS/TypeScript, PandaCSS and Vanilla Extract are both good options.

Re: Things I wish I knew before moving 50K lines of code to React Server Components

#453
post #120

Does anyone know if CSS-in-JS and Context support is planned for RSC, or is there a technical limitation which means they’ll never be possible?

For Context support, I think the reason it's not supported is because Server and Client components have different lifetime. In theory they could add something like Server Context, that's accessible only to Server components. For CSS-in-JS, those are all 3rd party libraries, so they need to adapt on their side. For example, `styled-components` uses Context heavily, so they need to re-think their approach. For `css-mod…

PandaCSS and Vanilla Extract are subsuming styled-components, precisely because that is runtime CSS while the former two are compile time based and so work for the server.

Re: Things I wish I knew before moving 50K lines of code to React Server Components

#454
post #131

Earlier quoted context omitted.

> For a simple web hello world you need a huge build and compile pipeline. These frameworks were not created to solve “Simple hello world” apps.

Well they don't look like they were created to manage complexity either, so exactly why are they used?

People needing to justify their job

Re: Things I wish I knew before moving 50K lines of code to React Server Components

#455

Earlier quoted context omitted.

- npx create-next-app@latest - npx: command not found - install node / npx - npx create-next-app@latest - realise your node is too old - install nvm / node - npx create-next-app@latest - answer a bunch of questions - npm start - get an error: Error: ENOENT: no such file or directory, open '/tmp/my-app/.next/BUILD_ID' - npm run dev - hello world in browser

If you don't have the toolchain set up, it's not like it's different for any other language.

- echo "hello world" > /tmp/index.html

- browse to file:///tmp/index.html

Re: Things I wish I knew before moving 50K lines of code to React Server Components

#456
post #407

Earlier quoted context omitted.

My brother just started learning web development this past year and his mind was blown when I told him you could send HTml over HTtp.

Reminds me of the joke about, "Omg, that's amazing, the new iPhone will support voicechat ... and you can use your phone number as your screenname!"

A joke made even funnier by being true (FaceTime Audio)

Re: Things I wish I knew before moving 50K lines of code to React Server Components

#457
post #292

Earlier quoted context omitted.

Just because it’s a one liner to install something doesn’t mean you aren’t installing a big, complex, over-engineered thing.

I find it curious that we always see these opinions expressed about front end frameworks, but no one seems to have much problem with all of the complexity in back end frameworks like node, Python, Java, .Net... I have a sneaking suspicion that people are just more used to having complexity hidden from them behind a framework install, whereas front end puts everything front and center since it's all delivered to your…

Seems you haven't heard about the existence of SBOM

Re: Things I wish I knew before moving 50K lines of code to React Server Components

#459

Earlier quoted context omitted.

If you don't have the toolchain set up, it's not like it's different for any other language.

- echo "hello world" > /tmp/index.html - browse to file:///tmp/index.html

echo - command not found (maybe you're on Windows)

browse - no browser installed

edit - no editor found

See, I can do the same thing. In any case you need a toolchain installed to actually program in the language you want to program, even if that toolchain is minimal. Complaining about a toolchain not being installed for the thing you want to do is not very useful.

Re: Things I wish I knew before moving 50K lines of code to React Server Components

#460

Earlier quoted context omitted.

- echo "hello world" > /tmp/index.html - browse to file:///tmp/index.html

echo - command not found (maybe you're on Windows) browse - no browser installed edit - no editor found See, I can do the same thing. In any case you need a toolchain installed to actually program in the language you want to program, even if that toolchain is minimal. Complaining about a toolchain not being installed for the thing you want to do is not very useful.

There is always a text editor and browser available on any OS, yes even on Windows.
Post reply on HN