News for hackers. Stuff that matters.
Re:Payload 2.0: Postgres, Live Preview, Lexical RTE, and More by moltar on Monday October 09, 2023 @02:51PM (#37823841)
Has anyone tried running it in a Lambda? Bundled with esbuild or similar?
Re:Payload 2.0: Postgres, Live Preview, Lexical RTE, and More by coxmichael on Monday October 09, 2023 @06:30PM (#37826263)
I bundled it with esbuild for an astro/payload monorepo setup and it worked fine.
Re:Payload 2.0: Postgres, Live Preview, Lexical RTE, and More by p2hari on Tuesday October 10, 2023 @07:08AM (#37830632)
Nice, is it something you can share? If not could you briefly mention the steps. Even high level would be helpful
Re:Payload 2.0: Postgres, Live Preview, Lexical RTE, and More by coxmichael on Tuesday October 10, 2023 @10:45AM (#37832765)
Yep! There are probably issues with this setup, but I wrote a small plugin to allow them to work in the same repo, sharing the same express instance: https://github.com/coxmi/astro-payload-plugin

Because of various ES module/CJS issues I had to bundle payload with esbuild and change the extension to cjs. The config wasn't being properly found/parsed by their webpack/ts-node setup, and because payload loads its own config in dev mode, it's all a bit complicated. This was the easiest fix I could find.

My example repo can be found here: https://github.com/coxmi/astro-payload-example

Which was sort-of based on Payload's own custom server example here: https://github.com/payloadcms/payload/tree/main/examples/cus...

Re:Payload 2.0: Postgres, Live Preview, Lexical RTE, and More by sneek_ on Monday October 09, 2023 @08:08PM (#37827035)
We have a package that allows you to deploy Payload in a NextJS app serverlessly, and it works great. I actually tried bundling as one endpoint early on while exploring with the NextJS approach and it seemed to work perfectly. But honestly I can’t remember the pros and cons.

I’d say give it a shot, and if you need anything, let us know!