Serverless (+ single route builds) #626
Replies: 6 comments 1 reply
-
Modifying a component/style/template would also need to trigger builds on any/all routes where that component is present. Cool idea. |
Beta Was this translation helpful? Give feedback.
-
Started making some progress here but having issues running the Lit shim on Netlify functions. (not entirely unexpected I suppose) Not sure if it will help, but there are some discussions around runtime agnostic WCs, which may provide more developer ergonomics in the context of running serverless or maybe in #639 where NodeJS environments and globals may be more constrained. |
Beta Was this translation helpful? Give feedback.
-
Though I think I had some luck already using Lambda with ESM recently, this appears to confirm support for it officially. Which I assume by proxy means that Netlify would also get this support as well! 👀 |
Beta Was this translation helpful? Give feedback.
-
Made some good progress here, with a couple takeaways
In otherwords, to go serverless, we'll really want to lean more into an "in-memory" architecture and avoid disk writing as much as possible, or somehow auto-detect this is a serverless context and just don't write out, like graph.json? Additionally, for SSR, this means we can re-use built assets by tracking their build status in memory and avoid bundling entirely! |
Beta Was this translation helpful? Give feedback.
-
Additionally, we should incorporate support for streaming HTML with this technique, which may require a refactoring of our Koa server. I think it will make sense to hold all this Serverless work for a 2.0 release? |
Beta Was this translation helpful? Give feedback.
-
We are landing Serverless support in an upcoming release (v0.29.0)! You can check out the releases tab to try out the alpha releases and these associated issues to see what we've been up to: |
Beta Was this translation helpful? Give feedback.
-
Overview
As an off shot from the discussion in #576 on the topic of SSR / SST, it would also be valuable to explore how to run Greenwood "serverlessly" in a Lambda or Netlify function. This is super cool because it can help bridge the gap between the ends of the spectrum of SSG <> SSR. Effectively, using something like Netlify's DPR, you can build only parts of your site statically per build, and let more dynamic sites be built on demand and ached just as if it was all done at build time.
But of course you can fine tune this, but this is more up to the hosting provider.
Thoughts
I think it comes down to a couple things from Greenwood side of it:
Beta Was this translation helpful? Give feedback.
All reactions