Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update import statement for PluginPostStatusInfo #178

Merged
merged 5 commits into from
Aug 20, 2024

Conversation

gabriel-glo
Copy link
Contributor

@gabriel-glo gabriel-glo commented Jul 25, 2024

Description of the Change

Update the import statement for PluginPostStatusInfo component to use unified extensibility API.

Closes #173

How to test the Change

No functional changes to the plugin.
Adding an image with HTTP source should trigger the notice in the sidebar when trying to save a post.

Changelog Entry

Changed - Changed import of PluginPostStatusInfo component from @wordpress/edit-post to @wordpress/editor

Credits

Props @username, ...

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@gabriel-glo gabriel-glo linked an issue Jul 25, 2024 that may be closed by this pull request
2 tasks
@github-actions github-actions bot added this to the 1.3.0 milestone Jul 25, 2024
@github-actions github-actions bot added the needs:code-review This requires code review. label Jul 25, 2024
Copy link
Collaborator

@dkotter dkotter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this works fine on WordPress 6.6 but our minimum here is still 6.4. Since the @wordpress/editor package doesn't contain the PluginPostStatusInfo component there, things break. So we'll either need to try loading from both locations or wait to make this change until 6.6 becomes our minimum

@gabriel-glo
Copy link
Contributor Author

gabriel-glo commented Jul 26, 2024

I'd leave that decision to you.
If we decide with the implementation with both components, would the following approach be fine:

  • Import PluginPostStatusInfo from both @wordpress/editor and @wordpress/edit-post packages and rename them in the import.
  • Check either if WP version is higher than 6.6 or if component from @wordpress/editor is available and then render appropriate component with identical content.

@dkotter
Copy link
Collaborator

dkotter commented Jul 26, 2024

Import PluginPostStatusInfo from both @wordpress/editor and @wordpress/edit-post packages and rename them in the import.

Check either if WP version is higher than 6.6 or if component from @wordpress/editor is available and then render appropriate component with identical content.

I think this all sounds like a decent approach. May be able to simplify this and import first from the @wordpress/editor package and if PluginPostStatusInfo doesn't exist, then import from @wordpress/edit-post

@dkotter dkotter merged commit 99b831e into develop Aug 20, 2024
9 of 12 checks passed
@dkotter dkotter deleted the 173-unified-extensibility-apis-in-wordpress-66 branch August 20, 2024 22:13
@jeffpaul jeffpaul modified the milestones: 1.3.0, 1.2.1 Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:code-review This requires code review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unified Extensibility APIs in WordPress 6.6
3 participants