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

Composite: add context-forwarding with SlotFill example #65051

Merged
merged 3 commits into from
Sep 4, 2024

Conversation

ciampo
Copy link
Contributor

@ciampo ciampo commented Sep 4, 2024

What?

Extracted from #64723

Add a new "With Slot Fill" Storybook example for the Composite component

Why?

To better showcase the utility of the Composite.Context component, especially as we're planning on obfuscating the type of the store prop on the context.

How?

  • Added a storybook example
  • Tweaked the example's shown code to include the custom slotfill creation

Testing Instructions

  • Open the "With Slot Fill" Storybook example for the Composite component
  • Interact with the sample, make sure it works as expected
  • In the Composite "Docs" Storybook page, check the code snippet generated for this new example

Screenshots or screencast

Screenshot 2024-09-04 at 13 24 13

@ciampo ciampo requested a review from a team September 4, 2024 11:24
Copy link

github-actions bot commented Sep 4, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@ciampo ciampo self-assigned this Sep 4, 2024
@ciampo ciampo added [Type] Developer Documentation Documentation for developers [Package] Components /packages/components labels Sep 4, 2024
Copy link
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

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

Looks great and tests well! 🚀

Thanks for building a story for this elaborate use case, @ciampo 🙌

@ciampo ciampo merged commit abf72c9 into trunk Sep 4, 2024
62 checks passed
@ciampo ciampo deleted the feat/stabilize-composite/storybook-slot-fill-example branch September 4, 2024 15:13
@github-actions github-actions bot added this to the Gutenberg 19.2 milestone Sep 4, 2024
@mirka
Copy link
Member

mirka commented Sep 4, 2024

Wow, good call to document this 🙇 Thank you.

Also TIL display: contents 😳

@ciampo
Copy link
Contributor Author

ciampo commented Sep 5, 2024

Also TIL display: contents 😳

I did while working with DropdownMenuV2 and its sub-grid layout (which is IMO very cool!)

Wow, good call to document this 🙇 Thank you.

I wonder if we should have a more systematic approach to it:

  • should all components that use context to "function" have dedicated SlotFIll docs and examples?
  • as an alternative (or in addition to the above), should we move these docs and examples under the SlotFIll component?
  • as an alternative (or in addition to the above), should we have a separate docs page on Storybook ? I feel like we should document this properly.

@mirka
Copy link
Member

mirka commented Sep 5, 2024

I wonder if we should have a more systematic approach to it

Yes, I think we could very well do all the things you listed! It's a tricky thing that could waste a lot of time to figure out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants