Card: Remove unused CardContext#77463
Conversation
8e95132 to
a087288
Compare
|
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.75 MB ℹ️ View Unchanged
|
|
Flaky tests detected in a087288. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24578025189
|
aduth
left a comment
There was a problem hiding this comment.
Is this documentation still accurate or does it need to be updated?
https://github.com/WordPress/gutenberg/tree/trunk/packages/components/src/card/card#context
aduth
left a comment
There was a problem hiding this comment.
Approving because changes make sense on their own, but see previous comment if we can also clean up potentially-confusing documentation.
The documented behavior is still accurate, but I agree the wording is a bit confusing in the context of this PR. This change removes the unused I’ll update the PR description to make that distinction clearer. |
Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: aduth <aduth@git.wordpress.org>

What?
Removes
packages/components/src/card/context.ts, which exportsCardContextanduseCardContext. Neither is used anywhere in the codebase.Why?
Dead code. The context was likely intended to share state across
Cardsubcomponents but was never wired up. Removing it reduces noise and surface area in theCarddirectory.Note
This PR removes only the unused
packages/components/src/card/context.tshelper export. It does not change the documentedCardsubcomponent behavior: props likesizeandisBorderlessare still inherited byCardBody,CardHeader, andCardFooterthrough the components context system.How?
packages/components/src/card/context.ts.Internalchangelog entry.The file isn't re-exported from any
index.ts, so this isn't a public API change for consumers of@wordpress/components.Testing Instructions
git grep CardContextandgit grep useCardContextshould return no results.CardStorybook stories should continue to work as before.Use of AI Tools
Authored with the assistance of Cursor (Claude).