WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.55k stars 4.22k forks source link

DataViews: Extensibility #61084

Open youknowriad opened 7 months ago

youknowriad commented 7 months ago

Part of https://github.com/WordPress/gutenberg/issues/55083

What problem does this address?

As we grow the usage of the DataViews package in the different editors. The need for extensibility for the different configuration objects grows. The dataviews package is built in a way that allows extensibility to be implemented in multiple places and open a new wave of possibility for plugins and third-party developers:

We should be able to:

What others would you like to see being extensible in the dataviews? Let's gather some thoughts.

Note

A lot of the above features are still very much in flux and the structure of these objects will probably change (breaking changes) while we iterate there. In the meantime, it is important to get third-party feedback to shape these objects and extensibility APIs properly. And given the scale of these APIs, we should start implementing these APIs as Gutenberg plugin-only APIs, gather real usage feedback on the plugin before committing to shipping these APIs into Core. (Use the IS_GUTENBERG_PLUGIN as a start).

Todo

Common

Actions

Fields

fabiankaegy commented 7 months ago

Thanks for opening this issue :)

I want to reference back to this comment / thread in the original "Expanding the Table component" issue from a year ago:

https://github.com/WordPress/gutenberg/issues/53233#issuecomment-1665263796

oandregal commented 7 months ago

Related ticket about (duplicate post) actions extensibility https://github.com/WordPress/gutenberg/issues/61083 considering user capabilities, ability to filter by plugins, etc.

youknowriad commented 6 months ago

I've started thinking about this a little bit (focusing on actions first). So we want to be able to define actions per post type and the first question I had to answer is where should the API live? In which package?

I'm thinking of starting exploring the "editor" package first and we can adapt over time. WDYT.

youknowriad commented 6 months ago

I updated the issue with some tasks that can be grabbed. Let's keep it up to date as we iterate and clarify what needs to be done.

youknowriad commented 4 months ago

Hello folks, Small update here.

I'm going to pause or slow down the work on the issue to focus on other priorities I have at the moment. But if folks are interested to continue push this forward, the todo list should help and I'm happy to provide support. cc @Mamaduka @jsnajdr @fabiankaegy

talldan commented 4 months ago

Not sure if this is the right place to mention it, but I found this old issue, which seems relevant for data views for post types - Post actions: "force delete" isn't supported

Testing today and the post editor shows ‘Move to trash’ as an action, but the post isn’t deleted when clicking it.

oandregal commented 1 week ago

Over the past week, I've been moving some things around (field definitions to the fields package, usePostFields hook to the editor package) in preparation for this PR https://github.com/WordPress/gutenberg/pull/67175 It allows register/unregister fields for the page post type, in the same way we do with actions.

Updated the issue description with all this info. The conditions for this to work are the same as actions: it only works with the Gutenberg plugin active and it's private.

youknowriad commented 2 days ago

Before being able to stabilize the APIs, we need to implement apiVersion for all these configs. I created this issue to track this work #67274