Skip to content

UI: Remove usage of private APIs #75319

@aduth

Description

@aduth

What problem does this address?

Using private APIs in bundled packages like @wordpress/ui (example) can cause issues for downstream projects that depend on them, due to the unavailability of private APIs, or the potential for multiple versions of the @wordpress/private-apis package due to bundling.

What is your proposed solution?

Avoid using private APIs in @wordpress/ui.

Options to consider:

  • Recommended: Create a new @wordpress/theme/theme-provider exported entrypoint that's used internally or by external consumers using the npm package directly, i.e. not through the wp. window global.
    • Noting that this could still cause some duplication of the component with the one that would end up being shipped as the wp. window global (private) component.
  • Alternative: Promote ThemeProvider to a public API.

Metadata

Metadata

Assignees

Labels

[Package] Theme/packages/theme[Package] UI/packages/ui[Status] In ProgressTracking issues with work in progress[Type] TaskIssues or PRs that have been broken down into an individual action to take

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions