Skip to content

Components: move displayName assignment to top-level files#64793

Merged
ciampo merged 3 commits into
trunkfrom
docs/components-composite-display-name
Aug 26, 2024
Merged

Components: move displayName assignment to top-level files#64793
ciampo merged 3 commits into
trunkfrom
docs/components-composite-display-name

Conversation

@ciampo

@ciampo ciampo commented Aug 26, 2024

Copy link
Copy Markdown
Contributor

What?

As discussed in #64613 (comment), this PR tweaks how the displayName is assigned to each sub-component.

Previously, each displayName assignment was performed in the sub-component files — this PR moves the assignments to the top-level file.

Why?

Since assigning a displayName to sub-components is a consequence of how we're building and exporting our composite components, moving the assignment closer to where the exported object is built just makes sense.

How?

Moved the assignments across files, updated the CONTRIBUTING guidelines accordingly.

Testing Instructions

This PR has no runtime changes

  • make sure the project builds
  • load storybook / the editor, make sure that Composite and DropdownMenuV2 subcomponents are named as expected in React Dev Tools and Storybook code snippets

@ciampo ciampo requested a review from ajitbohra as a code owner August 26, 2024 09:37
@ciampo ciampo self-assigned this Aug 26, 2024
@github-actions

github-actions Bot commented Aug 26, 2024

Copy link
Copy Markdown

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: mirka <0mirka00@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 requested review from mirka and tyxla August 26, 2024 09:37
@ciampo ciampo added [Type] Developer Documentation Documentation for developers [Package] Components /packages/components labels Aug 26, 2024

@mirka mirka left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the consistency cleanup!

@ciampo ciampo merged commit 8a24345 into trunk Aug 26, 2024
@ciampo ciampo deleted the docs/components-composite-display-name branch August 26, 2024 17:04
@github-actions github-actions Bot added this to the Gutenberg 19.2 milestone Aug 26, 2024
bph pushed a commit to bph/gutenberg that referenced this pull request Aug 31, 2024
…#64793)

* Update CONTRIBUTING guidelines

* Update Composite component

* Update DropdownMenuV2 component

---

Co-authored-by: ciampo <mciampini@git.wordpress.org>
Co-authored-by: mirka <0mirka00@git.wordpress.org>
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.

2 participants