SSR Experiment using gRPC #2768
mark-dropbear
started this conversation in
Show and tell
Replies: 1 comment
-
I have something similar to your idea, but implemented over HTTP, but it's decoupled and should be adapted to any implementation that you guess, the only problem is it's insecure, you must protect this endpoint because anybody should inject code following this approach, but I cannot guess another possible approach because to render your web components you need load the javascript to register them, the only way to fix this issue should be building a library to each language that has a binding with Node/Bun, or decouple the SSR part into a low-level library that should be adapted into each language writing a wrapper to use it |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi All,
I was playing around with the experimental SSR package and managed to get a basic implementation up and running with Koa but then wanted to change things up a little because the idea of building an entire application backend in Node didn't exactly thrill me :)
My plan was to stand up a basic Node gRPC service that I could just pass requests to and just have that service be responsible for taking in some data and a template id and it would send back the rendered HTML but I could keep the rest of my application code in Dart which I am more comfortable with.
It seems to work pretty well so far (not that I have had a chance other than to do what basically amounts to a Hello World implementation yet) but I just thought I would share it here and throw it out there as a use case that maybe wasn't on your radar but one that I am actively very interested in and I suspect there maybe others who love Lit but aren't yet ready to buy into the entire Node ecosystem.
So the basic setup goes like this.
I have a regular
Dart
HTTP server which also has a gRPC client built into it for communicating with a Node process. TheHTTP
request handler looks like this:Then I have a Node gRPC server that takes in that
gRPC
request and just uses the SSR package to render the HTMLBeta Was this translation helpful? Give feedback.
All reactions