10up / classifai

Supercharge WordPress Content Workflows and Engagement with Artificial Intelligence.
https://classifaiplugin.com
GNU General Public License v2.0
573 stars 53 forks source link

Update `apiVersion` of Recommended Content Block to version 3 #769

Open fabiankaegy opened 4 months ago

fabiankaegy commented 4 months ago

The recommended content block currently uses apiVerson: 2. In order to not prevent adoption of the iFramed post editor this should get updated to apiVersion: 3.

Version 3 (>= WordPress 6.3) The post editor will be iframed if all registered blocks have a Block API version 3 or higher and the editor has no classic meta boxes below the blocks. Adding version 3 support means that the block should work inside an iframe, though the block may still be rendered outside the iframe if not all blocks support version 3.

https://github.com/10up/classifai/blob/926b3659c1fd6a3d621c463afd6e968f2ce43e18/includes/Classifai/Blocks/recommended-content-block/block.json#L3

dkotter commented 4 months ago

I'm not opposed to making this change but since this feature is deprecated (due to no longer being supported by Microsoft) I'd recommend we don't spend much time on this. If all we need to due is bump the apiVersion to 3, great, but if there are additional things that need changed to ensure things work, may want to just leav this alone as this code will be removed eventually anyway

fabiankaegy commented 4 months ago

The issue we are running into is that if any block, regardless of whether it is in use or not, has an apiVersion smaller than 3 that means that the post editor doesn't get rendered in an iframe... So even with it being deprecated. As long as it exists it blocks the iframe

dkotter commented 4 months ago

The issue we are running into is that if any block, regardless of whether it is in use or not, has an apiVersion smaller than 3 that means that the post editor doesn't get rendered in an iframe... So even with it being deprecated. As long as it exists it blocks the iframe

Hmm.. interesting, that's fun. I imagine though it's only an issue if the block is actually registered and available to select from, correct? If so, that's only the case here if the Recommended Content Feature is turned on which I don't have numbers on that but I imagine it's a fairly small amount of people that actually set this up before it was deprecated.

But again, not opposed to bumping that version, I just know in testing in another plugin, that version bump broke the block and I'm concerned that may be the case here as well, which would require more effort on a feature that we aren't currently supporting.

fabiankaegy commented 4 months ago

If so, that's only the case here if the Recommended Content Feature is turned on which I don't have numbers on that but I imagine it's a fairly small amount of people that actually set this up before it was deprecated.

Ahhh okay yeah if this is behind a feature flag without a lot of use this is not as big a concern :)