-
Notifications
You must be signed in to change notification settings - Fork 2.4k
feat: added live preview svelte package #12250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: added live preview svelte package #12250
Conversation
Thanks for this @PeteJStewart! I made a few changes here, namely:
Another change that is needed here is that docs need to go into the Beyond that I'm hoping we can have a few Svelte developers test out a canary before it is released, but unfortunately I cannot publish a pre-release from your fork. I'll look into this, but we may have to open a PR from a direct branch instead, or mark as beta. |
Thanks @jacobsfletch, I'll add the docs tomorrow and remove the README. 👍 |
@jacobsfletch I believe this PR is ready now. I've added the Svelte documentation to |
@jacobsfletch Do you need anything else from me to get this merged in? |
@@ -31,10 +31,11 @@ | |||
} | |||
], | |||
"paths": { | |||
"@payload-config": ["./test/query-presets/config.ts"], | |||
"@payload-config": ["./test/_community/config.ts"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a conflict here, but I didn't make this change, so I assume this came from @jacobsfletch?
Live Preview Package | Svelte
This is the live preview package for Svelte. Similar to the Vue & React Live Preview packages.
There are details about implementing the package within the README file. In general I have tried to keep it as close to the Vue implementation as possible.
The simplest example of how it can be used is:
I've tried to keep the DX as clean as possible and to replicate all feature found in the Vue package.
useLivePreview also returns
loading
as a readable rune, but in most cases it's not needed.There is further information about that in the README.
There have been some discussions about this on Discord: https://discord.com/channels/967097582721572934/967097582721572937/1366094097890279515
What?
New Svelte Live Preview package
Why?
Because there wasn't one, and many people use Svelte and want this package.
How?
The package uses the
@payloadcms/live-preview
package and Svelte writable/readable store to extract the logic to a library package.