Skip to content

Await @wordpress/core-abilities ready promise before executeAbility#3

Draft
Copilot wants to merge 2 commits into
trunkfrom
copilot/update-import-based-on-issue-comment
Draft

Await @wordpress/core-abilities ready promise before executeAbility#3
Copilot wants to merge 2 commits into
trunkfrom
copilot/update-import-based-on-issue-comment

Conversation

Copilot AI commented Apr 23, 2026

Copy link
Copy Markdown

@wordpress/abilities' executeAbility relies on a client-side store populated by @wordpress/core-abilities fetching from the REST API. Without awaiting that initialization, calls to executeAbility can fail with "Ability not found".

WordPress/gutenberg#77254 added a ready export to @wordpress/core-abilities precisely for this purpose.

Changes

  • WORKSHOP.md (section 7a): Updated the abilities import snippet to first import and await ready from @wordpress/core-abilities before importing from @wordpress/abilities:
// Before
const { getAbility, executeAbility } = await import( /* webpackIgnore: true */ '@wordpress/abilities' );

// After
const { ready } = await import( /* webpackIgnore: true */ '@wordpress/core-abilities' );
await ready;
const { getAbility, executeAbility } = await import( /* webpackIgnore: true */ '@wordpress/abilities' );

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/WordPress/gutenberg/issues/comments/4231633166
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update import based on GitHub issue comment Await @wordpress/core-abilities ready promise before executeAbility Apr 23, 2026
Copilot AI requested a review from jonathanbossenger April 23, 2026 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update import based on https://github.com/WordPress/gutenberg/pull/77254#issuecomment-4231633166

2 participants