sejori / peko

Featherweight apps on the edge 🐣⚡ Node, Deno, Bun & Cloudflare Workers.

Home Page:https://peko.deno.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deno Deploy support

talentlessguy opened this issue · comments

commented

Is there a plan to support https://deno.com/deploy?

@talentlessguy thanks for raising this issue. This is something I have been thinking about but don't think will be possible in Deno Deploy's current offering for a couple of reasons.

  1. Deno Deploy's beta tier supports a maximum CPU compute time of 50ms per request. Since Peko renders your page to HTML on each request 50ms is cutting it a little fine considering my 2015 MacBook Pro takes ~30ms to do it and that's with 16GB RAM.
  2. There is no cache functionality currently available in Deno Deploy and this is as big part of what makes Peko efficient in production as it doesn't need to render every request. In the current Docker-compose orchestration a Redis service is created for this purpose. I can't think of a way this would be possible in Deno Deploy yet.
  3. The request handling in Deno Deploy isn't the same as the Deno http library so we would have to write a compatibility layer into Peko. That or abstract the Peko logic into smaller chunks that can be consumed separately.

This is something I will definitely keep in mind for the future as it makes total sense. But the above issues lead me to believe it's not worth it yet. If anyone wants to borrow from Peko's code for a Deno Deploy distribution please be my guest (just give credit to Peko with a link if you don't mind). The /lib/routes/pages.js & /lib/middleware/ssr.js files would be where to start. For now I will close this issue :)

Actually, I will reopen this issue because it would be good to gauge people's thoughts on it. If there's desire for this now, with the above limitations considered, it may be worth building in support sooner rather than later.

With the on-going updates to Deno Deploy this should be very straightforward!

This: denoland/deploy_feedback#1

May have to remove dynamic imports which I don't think TypeScript will like...

#28 Deno Deploy now working! 🎉