storyblok / field-plugin

Create and deploy Storyblok Field Plugin
https://www.storyblok.com/docs/plugins/field-plugins/introduction
25 stars 3 forks source link

feat(common): new subscription model #260

Closed johannes-lindgren closed 12 months ago

johannes-lindgren commented 1 year ago

What?

This PR introduces callback queue

  1. Field Plugin attaches callbackId to messages to Container
  2. Container responds with a message including callbackId
  3. Field Plugin executes the callback only if the callbackId matches.

This enables us to

  1. have multiple instances of createFieldPlugin()
  2. remove state management out of the library and let Storyfront keep merging states and deliver the full state back to Field Plugin

Why?

JIRA: EXT-1957

How to test? (optional)

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plugin-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 6, 2023 2:28pm
johannes-lindgren commented 1 year ago

As you can see in the pull request, I intend to make each action return a promise, but I am not sure how to implement this in Storydfront yet; the code there is a bit messy.

eunjae-lee commented 1 year ago

@johannes-lindgren ping me here whenever you need another round of my review :)

eunjae-lee commented 1 year ago

I'd love to get your reviews @demetriusfeijoo @BibiSebi on this :)

eunjae-lee commented 1 year ago

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

BibiSebi commented 1 year ago

This is huge, thank you for your efforts @johannes-lindgren and @eunjae-lee 👏

eunjae-lee commented 1 year ago

Thanks @demetriusfeijoo ! My vim didn't show me this lint errors 😅 And we also need to fix the CI to check these.

eunjae-lee commented 12 months ago

Merge Activity