payloadcms / payload

The best way to build a modern backend + admin UI. No black magic, all TypeScript, and fully open-source, Payload is both an app framework and a headless CMS.
https://payloadcms.com
MIT License
21.1k stars 1.27k forks source link

Debounce for getFormState #6988

Open lazidoca opened 3 days ago

lazidoca commented 3 days ago

Link to reproduction

No response

Payload Version

3.0 beta 56

Node Version

20

Next.js Version

15

Describe the Bug

I am trying Payload 3.0 beta, and I noticed that during typing the content in the richtext lexical, every key stroke initializes a HTTP to /api/form-state. This could affect the server if many users editing the content.

image

This would be solved if the getFormState is debounced.

Reproduction Steps

Open Chrome Dev Tools while editing the content in Richtext Lexical

Adapters and Plugins

No response