Skip to content

Conversation

@im3dabasia
Copy link
Contributor

@im3dabasia im3dabasia commented Aug 14, 2025

What?

Closes #48231

Adds displayName to all Context providers in the block editor.

Why?

Makes it easier to identify Context providers in React Dev Tools, improving debugging and developer experience.

How?

Set displayName for each Context instance across the codebase.

Testing Instructions

  1. Open the block editor.
  2. Inspect in React Dev Tools.
  3. Verify that Context providers display their assigned names.

@im3dabasia im3dabasia marked this pull request as ready for review August 14, 2025 12:20
@im3dabasia im3dabasia added Developer Experience Ideas about improving block and theme developer experience [Type] Enhancement A suggestion for improvement. labels Aug 14, 2025
@Mamaduka
Copy link
Member

@im3dabasia, can you include before and after screenshots from React DevTools?


// Main context.
const context = createContext< any >( { client: {}, server: {} } );
context.displayName = 'InteractivityContext';
Copy link
Member

Choose a reason for hiding this comment

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

This is a Preact context, not a React one, so I believe it's not needed in this PR.

@im3dabasia
Copy link
Contributor Author

Thanks @Mamaduka for the review.

Before

Screenshot 2025-08-21 at 11 53 46 AM

After

Screenshot 2025-08-21 at 11 51 30 AM

@Mamaduka
Copy link
Member

@im3dabasia, could you add the changelog entries and rebase this branch?

@Mamaduka Mamaduka self-requested a review August 25, 2025 11:52
@im3dabasia im3dabasia force-pushed the try/add-context-names branch from 512d33f to 81d6c76 Compare August 26, 2025 10:03
@im3dabasia im3dabasia added props-bot Manually triggers Props Bot to ensure the list of props is up to date. and removed props-bot Manually triggers Props Bot to ensure the list of props is up to date. labels Aug 26, 2025
@Mamaduka Mamaduka added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Aug 27, 2025
@Mamaduka
Copy link
Member

Not sure why the Props bot is failing. It's passing on other PRs. Should we try another rebase?

@im3dabasia im3dabasia force-pushed the try/add-context-names branch from 81d6c76 to 841df2f Compare August 29, 2025 05:02
@im3dabasia
Copy link
Contributor Author

Sorry for the delay,

@Mamaduka , I rebased the PR but still the Props bot is failing 😢

@Mamaduka Mamaduka removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Aug 29, 2025
@Mamaduka
Copy link
Member

Thanks, @im3dabasia!

That's odd. @desrosj, any ideas why this might be happening?

@desrosj
Copy link
Member

desrosj commented Aug 29, 2025

Interesting edge case!

"closingIssuesReferences":{"nodes":[{"author":null,"comments":{"nodes":[{"author":{"login":"im3dabasia"}}]}}]}

When Props Bot runs, it collects contributors from the PR itself and any linked issues. It looks like the original reporter for #48231 has chosen to delete their GitHub account, so the author is null.

I will try to get this fixed later today.

@Mamaduka
Copy link
Member

Thanks, @desrosj!

Here's another similar case, which was caused by the "Ghost" account comment on the issue - https://github.com/WordPress/gutenberg/actions/runs/17322263480/job/49178020354?pr=71402.

@desrosj desrosj added the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Sep 2, 2025
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

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: im3dabasia <im3dabasia1@git.wordpress.org>
Co-authored-by: luisherranz <luisherranz@git.wordpress.org>
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org>
Co-authored-by: desrosj <desrosj@git.wordpress.org>

At least one ghost was discovered. ghosts represent deleted GitHub user accounts.

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

@github-actions github-actions bot removed the props-bot Manually triggers Props Bot to ensure the list of props is up to date. label Sep 2, 2025
@desrosj
Copy link
Member

desrosj commented Sep 2, 2025

Looks like the fix from WordPress/props-bot-action#198 is working!

@Mamaduka
Copy link
Member

Mamaduka commented Sep 2, 2025

Thank you, @desrosj!

@im3dabasia, could you rebase (hopefully) one last time and resolve merge conflicts? Then it should be good to merge.

P.S. Failing e2e test was also resolved via WordPress/wordpress-develop#9671.

@im3dabasia im3dabasia force-pushed the try/add-context-names branch from 841df2f to 168a66c Compare September 3, 2025 07:27
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

Thank you, @im3dabasia!

@im3dabasia im3dabasia enabled auto-merge (squash) September 3, 2025 08:09
@im3dabasia im3dabasia merged commit 651bade into WordPress:trunk Sep 3, 2025
71 checks passed
@github-actions github-actions bot added this to the Gutenberg 21.6 milestone Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Developer Experience Ideas about improving block and theme developer experience [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display names for Context providers

4 participants