storyblok / field-plugin

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

fix(helper): update vue 2 template and helper #270

Closed eunjae-lee closed 12 months ago

eunjae-lee commented 1 year ago

What?

This PR updates the vue 2 template. Vue 2 helper + template used to have provider / inject pattern, and now that we've removed it, there is no such thing as useFieldPlugin in the vue 2 helper and the template. So what if we just remove vue 2 helper at all? We just need a little bit of snippet in the vue 2 template, and we're not actively supporting vue 2 anyway.

Why?

JIRA: EXT-1958

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 ❌ Failed (Inspect) Sep 14, 2023 3:04pm
eunjae-lee commented 1 year ago

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

demetriusfeijoo commented 1 year ago

@eunjae-lee, I think removing all the vue2 helper would not be bad, IMO.

However, how should we handle the FieldPlugin file?

I think we could remove this file since it seems not to be used anyway. what do you think?

eunjae-lee commented 1 year ago

@demetriusfeijoo if we get rid of vue 2 helper, then we should actually delete this folder, but I didn't yet because we haven't decided yet.

And actually that empty FieldPlugin.vue file is a placeholder for users. We provide an example inside the template, but users can delete the whole example and start from scratch with the FieldPlugin.vue file (which is bare minimum)

demetriusfeijoo commented 1 year ago

And actually that empty FieldPlugin.vue file is a placeholder for users. We provide an example inside the template, but users can delete the whole example and start from scratch with the FieldPlugin.vue file (which is bare minimum)

Oh, I see @eunjae-lee.

I think once we stop using the FieldPluginProvider inside the template, we can remove also the helper, for sure. This way we avoid some developers using it and blocking us from removing it easily in the future?!

I mean, I was checking here, and after removing the FieldPluginProvider we would have anything else to offer from the helper, right? As we're not going to support this version, maybe the best way would be to remove the helper, indeed.

I was taking a better look at how the new approach would look and I started asking myself on how to make the logic below reusable between both FieldExample/index.vue and FieldPlugin.vue files.

image

Do you have any idea here? As we don't have hooks here (for useFieldPlugin()), may we use Vue mixins?! What do you think @eunjae-lee?

eunjae-lee commented 1 year ago

Do you have any idea here? As we don't have hooks here (for useFieldPlugin()), may we use Vue mixins?! What do you think @eunjae-lee?

@demetriusfeijoo hey, thanks for pointing this out. I forgot about this part. added https://github.com/storyblok/field-plugin/pull/270/commits/61be91408cafa1766393546762e654b3133e8a72

demetriusfeijoo commented 1 year ago

Hey @eunjae-lee, thanks for the adjustment. 🙌

What about getting rid of the helper? Do you have a better position on that?

eunjae-lee commented 12 months ago

Merge Activity