165 Replies
Blazingly Fast can be said in terms of React now š barely any js if even any js is being sent to the user
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
so its a replacement for SSR
like gSSP
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
My thought now is what is react? Mpa or spa since itās now on the server
Or do you just use react router on a client component
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
so i were to use vanilla react connected to a separate backend can i use RSC there too?
do i have to use a meta framework
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
so now to host a frontend we need a server too?
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
so i have to use next to use RSC right?
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
this stuff is so confusing lol
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
interesting
RSCs have been talked about for a while, but Next has been the first meta-framework to well support them AFAIK. I'm pretty sure RSCs are just React's implementation of streaming-compatible rendering, compatible with Suspense and concurrency and stuff. How that tech is used is up to the meta-framework, with Next making whether something is generated per-request, ISRd or statically generated up to how you cache your data fetches. All the streaming is taken care of by React, Next takes care of the data + caching
thats makes a lot of sense
thanks
so before RSCs were a thing the client side components used to run on the server to generate the page right?
Correct
and now RSCs help in optimizing that?
and make it simpler to SSR
Previously if you wanted to fetch data on the server you did it in either 1. prerendering, or 2. dynamically. Now that's up to how u cache
In my head it makes a lot of sense but I can't put it into words well enough haha
yeah i get that
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
so if im not using next, i'd have to roll my own caching system?
Precisely, react would give you the rendered + streaming html and you'd have to decide yourself whether to cache or dynamically generate. Next takes care of that for you
so what does this mean on the hosting side of vanilla react
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
if i build a vite + react project do i get server code too which i would have to host on a server?
yeah its a big change
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
so only if i use RSCs, then it would be a requirement
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Only if you want to dynamically generate html. If you're just prerendering everything then u could render + save html to disk.
For the prerendering use case RSCs just provide a nicer way to datafetch, since it's inline in your components rather than in a separate getStaticProps function or whatever
ahh so i could use RSCs as a static site generator 0 javascript??
Well next already lets u do that, but it probs isn't 0 js
yeah thats def an improvement
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
its like 90kB js
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Ah no next prerenders first load but client renders after doesn't it
yeah
In terms of prerendering, RSCs are like Astro components in my head
thats another thing, RSCs don't have state, so its not interactive
U can fetch data asynchronously at the top and then output static html down below
yeah i guess thats a fair comparison
Oh it's actually just like Astro since Astro does SSR too
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
oscar has been typing for so long and says that
Lmao he been lurking
I'm guessing Astro doesn't support streaming or anything tho so L
yeah but they're not trying to solve that too
Oh for sure
As of now no
and personally, this is a hot take but i think streaming is a gimmick
I tried it yesterday was just normal but maybe later
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
oh yeah i think next uses a special version of react
Yup
yeah i'm not sold on it, client fetching really aint that bad
odd bc they tell u to install latest react
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
maybe i don't understand it well but i don't think there's any need for it
yees
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
I have a feeling that their implementation of server components is just that - their implementation. Not actual react server components. If they're using a special version of react then i'm probs wrong tho
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
buggiest major release in software history hehe
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
this is what i did https://nexxel.needs.rest/brave_Bpradg3ZKm.png
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
why bother with streaming when i can use solid and not load the entirety of react for hydration. surely it ain't that bad
truee, i think its time to say bye bye react
man i been saying that
solid is omega based
if only i could write rust backends <:D_Crying:910659293504745543>
have u tried prisma + rspc?
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
yo truuuuue
not yet but i plan to when i get time
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
š
when you're just doing db and apis it really doesn't feel like rust
the most friction you might feel is async or reference related stuff
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
rspc looks really complicated tho
lmao true
nah dude trust me its super simple
lmao half of the stream with mewtru was setting it up
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
yeeeeah we didn't have create-rspc-app
is it finished now?
should be usable soon i hope
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
also did you guys try deploying it serverlessly?
netlify
oscar tried it
netlify too op tbh
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
no prisma sadge
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
VerceL
Thereās always wasm-pack to turn it into wasm
vercel rust support sucks true
prisma can't be wasmed
Sadge
why not?
networking
ohh wasm doesn't support that?
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
not well enough
bruh
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Letās just remake wasm but better šš
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
is it an engine or pcr thing tho
interesting, but TCP is such a common thing wasm should support that ideally
It's planned for WASI but just hasn't been done yet
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
data proxy ideally
which library?
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
fair
well just deploy on lambda and we good
workers is edge so i don't really care about that atm
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
edge not even that good
tf is wasi
this message brought to u from perth, australia
damn i feel like such a noob š
basically wasm standard library type beat
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
ohh
there's a few wasi-compatible runtimes and a lot of them are written in rust lol
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
true haha
if pcr can be almost 700 then you're defs early on rspc
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
GitHub
GitHub - Brendonovich/prisma-client-rust: Type-safe database access...
Type-safe database access for Rust. Contribute to Brendonovich/prisma-client-rust development by creating an account on GitHub.
oh no it's great
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
nooo its amazing
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
yeah why build a file browser when u can build next-gen libraries
What does āstreamingā mean in the context of rendering a react component?
And I also donāt completely understand yet what the performance differences will be in a Next 12 vs 13 app if the 12 app was already optimised for SSR/SSG on a per route basis
Another thing I donāt fully understand is, what happens if server components have children that are client components? And what happens if client components have children that are server components?
I would love a video thatās just someone who is asking the right questions talking to Dan or someone else from the React team
I see it as initially displaying the fallback of a
<Suspense>
, and then streaming over the final content once the child is done suspendingOh, so like you send all the server components that are ready, and then when the ones that need data are ready you send those as well
First you send the loading state over, and then when you're ready send the actual content over
Instead of either making the ones that need data client components, or blocking until the data is done
Ok that seems like a huge improvement and maybe worth the increase in complexity
I think this just waterfalls
But the server components are still rendered on the server which is so strange to think
Found this line which is super interesting
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Oh wtf that's so wack
So client components can't pass props to server components?
I guess it makes sense that client components canāt pass props to server components
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Because those props would have to be sent over http?
To render again
omg it's literally the same thing
you're so right
I think this limitation is why they were trying the āserver and client components are the same thingā strategy before?
It feels like hydration would be a better solution here
Client components do hydrate
Start rendering it on the server, when props change just render on the client
I mean for client components passing props that might change to server components
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
I foresee us staying in /pages for a while tbh
And figuring it out when the dust settles
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Yeah this shit is pretty complex haha
Maybe the biggest question for me is
And even then the search bar pre-renders and hydrates
If a bunch of nerds who think about this stuff in their free time struggle to understand, wtf will a worker bee react dev do?
I think that while we're still in the mindset of
getStaticProps
, getServerSideProps
and the like we're all going to find it confusing
But this new streaming & suspense mindset is a whole new paradigm that's defs gonna take timelol š
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
Kinda like when hooks were introduced
Hmm true
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View
People still don't know how to use
useEffect
Hooks were clearly the right decision
But there was a lot of pushback at the start
I've been using suspense for years so I think I've got a decent grasp of things, I just haven't used Next 13 yet
Also lmao no server class components
Unknown Userā¢3y ago
Message Not Public
Sign In & Join Server To View