Skip to content

Components: Expose Theme via private APIs#53262

Merged
tyxla merged 5 commits into
trunkfrom
expose/theme-component-private
Aug 4, 2023
Merged

Components: Expose Theme via private APIs#53262
tyxla merged 5 commits into
trunkfrom
expose/theme-component-private

Conversation

@tyxla

@tyxla tyxla commented Aug 2, 2023

Copy link
Copy Markdown
Member

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

github-actions Bot commented Aug 2, 2023

Copy link
Copy Markdown

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:

Comment thread packages/components/src/theme/index.tsx Outdated
* @example
* ```jsx
* import { __experimentalTheme as Theme } from '@wordpress/components';
* import { privateApis as componentsPrivateApis } from '@wordpress/components';

@ntsekouras ntsekouras Aug 3, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

@ntsekouras ntsekouras left a comment

Copy link
Copy Markdown
Contributor

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
@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