RileySeaburg / rust-react-ssr

A low-level implementation using #rust to render #React #SSR.
2 stars 0 forks source link

Known limitations? #1

Open Schachte opened 2 months ago

Schachte commented 2 months ago

Aside from being a toy project, any known limitations with this current approach for doing SSR with React in Rust?

Been having server side hydration issues with various node APIs in my approach when using deno_core, so might just roll with V8. Thanks for making this public!

RileySeaburg commented 2 months ago

@Schachte I ended up running into a lot of the same issues that deno had at the time, because deno was using rust-ssr under the hood.

Implementing V8 itself was very resource intensive because it need to compile the whole c++ linker and that was brought into the code.

As far as the the ssr implementation, I just pushed some code I found in my working directory.

Overall it has an issue with webpack and static exporting not registering properly.

I'm sure it's a skill issue, because I did have it working at one point, but I ran into hydration issues.

I ended up rolling my own version of react and doing more of an island architecture with each page loading it's own react bundle.

RileySeaburg commented 2 months ago

It's time to revisit this because deno has come out with a 2.0

Schachte commented 1 month ago

@RileySeaburg Just got back from holiday, will take another peek. Cheers!

Schachte commented 1 month ago

@RileySeaburg Rolled an alternative using the v8 bindings from Deno. Basically just a POC right now, but SSR and clientside hydration is working.

https://github.com/Schachte/kaffe-rs

Lots of fiddling with bundle oriented things.. I'll just have to think about making it more generic and reusable

RileySeaburg commented 1 month ago

@Schachte

This looks great!

Looks like deno_core started building their v8 export right around the time I stopped working on this, which is great because compiling v8 was crazy rough.

I'm gonna test your project out and let you know what I get!

Schachte commented 1 month ago

@Schachte

This looks great!

Looks like deno_core started building their v8 export right around the time I stopped working on this, which is great because compiling v8 was crazy rough.

I'm gonna test your project out and let you know what I get!

Sweet! I've been changing things quite a bit, so curious on your thoughts.

I basically want a simple SSG where the focus is Markdown and not code or configuration, but with the support of embedding interactive React components if needed.