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

Components: Expose Theme via private APIs #53262

Merged
merged 5 commits into from
Aug 4, 2023
Merged

Conversation

tyxla
Copy link
Member

@tyxla tyxla commented Aug 2, 2023

What?

This exposes the existing Theme component via the @wordpress/component private APIs.

Why?

It's necessary for #53032, for usage outside of the @wordpress/components package.

Any prior usages of that component were within the package, so it could be directly imported.

Usage of Theme was suggested by @mirka here: #53030 (comment)

How?

  • We're adding Theme to the list of @wordpress/components private APIs,
  • We're removing the original README example since it was incorrect (it was assuming __experimentalTheme exposition, which isn't the case),
  • We're improving the inline example.

Testing Instructions

  • Verify that Theme still works well in storybook.
  • Verify all checks are green.

Testing Instructions for Keyboard

None

Screenshots or screencast

None

@tyxla tyxla added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components labels Aug 2, 2023
@tyxla tyxla requested a review from ajitbohra as a code owner August 2, 2023 09:28
@tyxla tyxla self-assigned this Aug 2, 2023
@github-actions
Copy link

github-actions bot commented Aug 2, 2023

Flaky tests detected in 9ff62c0.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5737134101
📝 Reported issues:

@@ -20,7 +20,15 @@ import { useCx } from '../utils';
*
* @example
* ```jsx
* import { __experimentalTheme as Theme } from '@wordpress/components';
* import { privateApis as componentsPrivateApis } from '@wordpress/components';
Copy link
Contributor

@ntsekouras ntsekouras Aug 3, 2023

Choose a reason for hiding this comment

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

I don't think we should add the unlocking in the example. Maybe just mention it's private? Whatever we decide here, should also apply to the other private components too(not for this PR). --cc @mirka

We could also do that in a follow up.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, agreed - I was a bit torn about whether to include it or not, so I've removed that part from the example in 87e9815

Happy to do follow-up updates if anyone has a further suggestion.

Copy link
Contributor

@ntsekouras ntsekouras left a comment

Choose a reason for hiding this comment

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

Besides the comments about readme usage, the change is straight forward. I'll pre-approve. Thanks!

@tyxla tyxla force-pushed the expose/theme-component-private branch from 9ff62c0 to 87e9815 Compare August 4, 2023 08:40
@tyxla tyxla merged commit 162eb4b into trunk Aug 4, 2023
51 checks passed
@tyxla tyxla deleted the expose/theme-component-private branch August 4, 2023 09:20
@github-actions github-actions bot added this to the Gutenberg 16.5 milestone Aug 4, 2023
@SiobhyB SiobhyB mentioned this pull request Sep 6, 2023
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants