VirtusLab-Open-Source / strapi-plugin-comments

A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
MIT License
413 stars 65 forks source link

Why does it not use strapi relationships? #130

Closed jaschaio closed 2 years ago

jaschaio commented 2 years ago

I don't understand enough about the plugin yet and I am fairly new to Strapi, but it seems odd to me that this plugin is not using the build in strapi relationship types to relate comments to posts for example.

Any particular reason for that architectural decision? It breaks a lot of default strapi features and replaces them with a rather odd api, e.G. /api/comments/api::post.post:400

cyp3rius commented 2 years ago

Hello @jaschaio ,

Such decision was based on our experience with Strapi v3 and Polymorphic relations which were part of it. Since beginning Comments plugin in v1.x was based on such relations but the support was really low and keeping them got couple effects:

I think those two points explains enough ;) In simple words, while reworking plugin for Strapi v4 we took the lessons and recent v1.0 changes (including decommissioning poly) to make this plugin as flexible as it can be. If such advanced relations like poly but with better support are going to be introduced to the core, I think we might consider them. But because each built-in relation required separated related field it's not possible to maintain it.

In addition, the API you're referring to hasn't changed since beginning and we're supporting it also here. Because it's a plugin with a lot of custom stuff you can't expect it to be CRUD like.

cyp3rius commented 2 years ago

Duplicated of #127

jaschaio commented 2 years ago

Thanks for explaining