Connectors: Align client registration API with server#76737
Conversation
Rename `label` to `name` and `icon` to `logo` in ConnectorConfig and ConnectorRenderProps to match the server-side PHP connector registry. Promote `authentication` and `plugin` to first-class properties on both types so they flow through the store and into render props automatically, removing the need for manual destructuring in each render callback.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
Size Change: 0 B Total Size: 7.66 MB ℹ️ View Unchanged
|
|
Flaky tests detected in 40ef5a9. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/23355088660
|
gziolo
left a comment
There was a problem hiding this comment.
Thank you for all the fixes. It looks great and aligns perfectly with what servers passes to the client.
Rename `label` to `name` and `icon` to `logo` in ConnectorConfig and ConnectorRenderProps to match the server-side PHP connector registry. Promote `authentication` and `plugin` to first-class properties on both types so they flow through the store and into render props automatically, removing the need for manual destructuring in each render callback. Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org>
|
I just cherry-picked this PR to the wp/7.0 branch to get it included in the next release: a0cab4e |
Update the e2e test plugin to use the renamed ConnectorRenderProps (name instead of label, logo instead of icon) from PR #76737. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e test (#76722) * Connectors: Support non-AI provider types and add JS extensibility e2e test Extends registerDefaultConnectors to handle connector types beyond ai_provider, adds an e2e test plugin demonstrating client-side connector registration via the merging strategy, and verifies the full flow in a new test case. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Tests: Add e2e coverage for server-only connector without JS render Registers a second connector (test_server_only_service) in the test plugin that has no client-side registerConnector call with a render function, and asserts that no card is displayed for it in the Connectors UI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Update plugin header to document both test connectors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix comments to accurately describe server+client merging behavior Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Disable import/no-extraneous-dependencies for test plugin module Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address PR feedback: hyphen support, type widening, and empty state fix Allow hyphens in connector IDs (aligning with wordpress-develop@b8e0c3df), widen ConnectorData.type from literal 'ai_provider' to string, and filter connectors by render function before checking empty state in stage.tsx. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix test plugin to use renamed connector props (name/logo) Update the e2e test plugin to use the renamed ConnectorRenderProps (name instead of label, logo instead of icon) from PR #76737. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: gziolo <gziolo@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
…e test (#76722) * Connectors: Support non-AI provider types and add JS extensibility e2e test Extends registerDefaultConnectors to handle connector types beyond ai_provider, adds an e2e test plugin demonstrating client-side connector registration via the merging strategy, and verifies the full flow in a new test case. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Tests: Add e2e coverage for server-only connector without JS render Registers a second connector (test_server_only_service) in the test plugin that has no client-side registerConnector call with a render function, and asserts that no card is displayed for it in the Connectors UI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Update plugin header to document both test connectors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix comments to accurately describe server+client merging behavior Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Disable import/no-extraneous-dependencies for test plugin module Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address PR feedback: hyphen support, type widening, and empty state fix Allow hyphens in connector IDs (aligning with wordpress-develop@b8e0c3df), widen ConnectorData.type from literal 'ai_provider' to string, and filter connectors by render function before checking empty state in stage.tsx. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix test plugin to use renamed connector props (name/logo) Update the e2e test plugin to use the renamed ConnectorRenderProps (name instead of label, logo instead of icon) from PR #76737. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: gziolo <gziolo@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
This updates the pinned hash from the `gutenberg` from `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d` to `3edafcc90fc4520939d69279e26ace69390582be`. The following changes are included: - RTC: Use activation hook to enable RTC by default (WordPress/gutenberg#76736) - Connectors: Align client-side registration API with server-side (WordPress/gutenberg#76737) - Connectors: Support non-AI provider types and add JS extensibility e2e test (WordPress/gutenberg#76722) - RTC: Add E2E "stress test" with complex interactions (WordPress/gutenberg#76055) - Button: restore specificity of high-contrast mode focus ring (WordPress/gutenberg#76719) (WordPress/gutenberg#76770) - Connectors: Improve AI plugin button (WordPress/gutenberg#76759) - RTC: Use prepared queries instead of `*_post_meta` functions (WordPress/gutenberg#76779) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d…3edafcc90fc4520939d69279e26ace69390582be. Log created with: git log --reverse --format="- %s" 2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d..3edafcc90fc4520939d69279e26ace69390582be | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy See #64595. git-svn-id: https://develop.svn.wordpress.org/trunk@62102 602fd350-edb4-49c9-b593-d223f7449a82
This updates the pinned hash from the `gutenberg` from `2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d` to `3edafcc90fc4520939d69279e26ace69390582be`. The following changes are included: - RTC: Use activation hook to enable RTC by default (WordPress/gutenberg#76736) - Connectors: Align client-side registration API with server-side (WordPress/gutenberg#76737) - Connectors: Support non-AI provider types and add JS extensibility e2e test (WordPress/gutenberg#76722) - RTC: Add E2E "stress test" with complex interactions (WordPress/gutenberg#76055) - Button: restore specificity of high-contrast mode focus ring (WordPress/gutenberg#76719) (WordPress/gutenberg#76770) - Connectors: Improve AI plugin button (WordPress/gutenberg#76759) - RTC: Use prepared queries instead of `*_post_meta` functions (WordPress/gutenberg#76779) A full list of changes can be found on GitHub: https://github.com/WordPress/gutenberg/compare/2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d…3edafcc90fc4520939d69279e26ace69390582be. Log created with: git log --reverse --format="- %s" 2ee7ede6be6d4e55d5c7047394c5c4e0ea8d521d..3edafcc90fc4520939d69279e26ace69390582be | sed 's|#\([0-9][0-9]*\)|https://github.com/WordPress/gutenberg/pull/\1|g; /github\.com\/WordPress\/gutenberg\/pull/!d' | pbcopy See #64595. Built from https://develop.svn.wordpress.org/trunk@62102 git-svn-id: http://core.svn.wordpress.org/trunk@61384 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Rename `label` to `name` and `icon` to `logo` in ConnectorConfig and ConnectorRenderProps to match the server-side PHP connector registry. Promote `authentication` and `plugin` to first-class properties on both types so they flow through the store and into render props automatically, removing the need for manual destructuring in each render callback. Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org>
…e test (#76722) * Connectors: Support non-AI provider types and add JS extensibility e2e test Extends registerDefaultConnectors to handle connector types beyond ai_provider, adds an e2e test plugin demonstrating client-side connector registration via the merging strategy, and verifies the full flow in a new test case. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Tests: Add e2e coverage for server-only connector without JS render Registers a second connector (test_server_only_service) in the test plugin that has no client-side registerConnector call with a render function, and asserts that no card is displayed for it in the Connectors UI. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Update plugin header to document both test connectors Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix comments to accurately describe server+client merging behavior Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Disable import/no-extraneous-dependencies for test plugin module Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Address PR feedback: hyphen support, type widening, and empty state fix Allow hyphens in connector IDs (aligning with wordpress-develop@b8e0c3df), widen ConnectorData.type from literal 'ai_provider' to string, and filter connectors by render function before checking empty state in stage.tsx. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Fix test plugin to use renamed connector props (name/logo) Update the e2e test plugin to use the renamed ConnectorRenderProps (name instead of label, logo instead of icon) from PR #76737. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: gziolo <gziolo@git.wordpress.org> Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Summary
label→nameandicon→logoinConnectorConfig/ConnectorRenderPropsto match the server-side PHP connector registryauthenticationandpluginto first-class properties on connectors.ApiKeyConnectorto acceptConnectorRenderPropsdirectly instead of a flat mix of custom propsTest plan
npm run test:unit packages/connectors— all 7 tests passtsc --noEmit)