Payload Playground - Database adapters in the browser via WASM #8219
GermanJablo
started this conversation in
Feature Requests & Ideas
Replies: 1 comment 3 replies
-
I absolutely love this idea. Not only for how great it would be for visibility and ease-of-sharing of Payload, but also for Github issues where pulling down a repo may be more tedious or slower - just open up a new playground and quickly throw together a reproduction. We could pull in the existing templates for quickly demoing basic features and working examples. Imagine sending a customer a link to gauge interest, now that would be convenience. I completely agree that it would also be great in docs. I would love to contribute to making this happen. Count me in. 10/10. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Overview
Deploying interactive demos or playgrounds provides significant advantages for both developers and users:
Many tools deploy a playground for these reasons, such as Lexical, Typescript or Tailwind.
While deploying a basic playground is usually straightforward and can often be automated through GitHub Actions, PayloadCMS faces an additional challenge: its reliance on a database backend. Deploying an open and publicly accessible database in a playground can lead to issues such as non-deterministic behavior and potential DB abuse.
Proposal
A potential solution to this problem is to leverage a database that runs locally in the user's browser, powered by WebAssembly (WASM). This approach would allow for fully isolated instances of the database, eliminating concerns about public DB exposure while still offering full CMS functionality in a demo environment.
The goal of this discussion is to gather input and collaborate on implementing a solution for Payload’s playground, starting with addressing this challenge.
Possible Solutions
There are currently 2 options for implementing a database in the browser via WASM:
Beta Was this translation helpful? Give feedback.
All reactions