Media
Sandro Wegmann
November 21, 2024
Media

Newsletter 4 | 20.11.2024

Payload V3 stable is out!

It’s finally time to celebrate, let’s take a moment and be grateful for not having to migrate beta versions 3 times a week anymore :) Here’s what’s new with V3:

Tasks, Workflows, Jobs, Queues

We left this out in the last newsletter to keep it readable. This is a completely new functionality that Payload now provides, similar to hooks, access control etc. Here's a TLDR:
You can now define specific functions called tasks (or workflows = multiple tasks in a row).
You define a task called “sendEmail” which takes in a text and recipient email address
A "job" is an execution instance of a task or workflow with specific inputs
You create a specific job that sends a “Hello World” text to test@test.com
This job lands in a queue. You can now query this queue and execute the first 1-xxx tasks that are returned, most of the times happens through a cronjob
You set up a cronjob that checks the “email” queue every 60 seconds and sends out all pending emails
This is a simple example and might not seem like a huge benefit, but trust me it is. You can now offload heavy tasks in the background, and also schedule them for a specific time!
Send a “Happy Monday” email to test@test.com on Monday, the 25.11. You just create another “sendEmail” job, but set the property “waitUntil” to the 25. Voila, done.

Video Version of this Newsletter

Every upcoming Newsletter will be released alongside a youtube video. The videos will be a bit longer and contain more context and chitchat about all newsletter content.
Todays video covers ALL important new features in V3, watch it here:

Custom block look

If you use blocks within the Lexical Rich Text editor, you can now completely customise how that block looks
Example: Gallery block with an array of image uploads. Instead of showing the normal array fields you can now insert your own custom component that matches the look of the gallery. That gives you a lot more “WYSIWYG feeling”. Find more info here

baseListFilter

Payload now enables you to set a base filter for all documents that are shown in the Payload Admin Panel. This opens a load of possibilities.
For example: SOFT DELETES
It’s as simple as setting a hook on delete that prevents actually deleting the doc and set’s a
{
  deleted: true
}
value instead. Then, use the baseListFilter to automatically hide all documents that have been soft deleted. Video tutorial incoming!
By the way, those are not all new features that Payload V3 comes with. You can find more in our last newsletter

Fresh upcoming features

The focus will now be on stability and documentation for the next week.
However, this doesn’t mean there won’t be any fresh features!
The much requested folder view for upload collections will make the start (”Almost ready” → will be launched in around 1 month).
Apart from that, a real time image resizing engine, a real time api, and import/export features are already under active development. Exciting times ahead!
And that’s it for now! We’re grateful for any constructive feedback, so please fill out this feedback form or reach out to info@10xmedia.de