-
Notifications
You must be signed in to change notification settings - Fork 4.7k
List View Panel: Fix circular dependency issue that was breaking some Storybook stories #74399
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
Conversation
… Storybook stories
|
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. |
SirLouen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm it's blowing. Patch looking good ✅
|
Size Change: -86 B (0%) Total Size: 3.08 MB
ℹ️ View Unchanged
|
|
Thanks for the quick review! 🙇 |
… Storybook stories (#74399) Co-authored-by: andrewserong <[email protected]> Co-authored-by: SirLouen <[email protected]>
What?
Fixes a regression introduced in #74120 that caused some Storybook stories to break (I noticed this in the the Fields and Media Fields stories).
Specifically, in the List View Panel, don't attempt to
unlockthePrivateListViewcomponent, but simply use it directly as we're already in the block editor package.Why?
Because we're already in the block editor package, we shouldn't be importing and unlocking the private api, since we're already in this package. This caused a circular dependency that was apparent in Storybook's dev mode (but not its build mode). This is the summary that Claude gave me:
"The PR added the packages/block-editor/src/hooks/list-view.js file which created the circular dependency by importing and unlocking privateApis at the module top-level. The issue became more apparent after the Storybook v9 upgrade (PR #74143) on December 31, 2025, which changed webpack's module resolution behavior in dev mode."
How?
Import the
PrivateListViewcomponent directly instead of attempting to unlock.Testing Instructions
Test that everything works correctly:
Insert a social icons block and add a few child blocks. Select the parent social icons block and the list view panel should be available (you could also check the Buttons/Button block):
Next up, run
npm run storybook:devlocally to boot up Storybook. Then navigate to the Fields stories, e.g. this one, and it should render without error: http://localhost:50240/?path=/story/fields-base-fields--data-views-previewScreenshots or screencast
Before
After