-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Navigator: stabilize and export APIs #64613
base: trunk
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Legacy exports have been moved to a separate legacy.ts
file (including the legacy JSDocs mentioning the components with their experimental export name).
This makes it easy to have separate names from the stable version, different JSDocs, and deprecation warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New exports (and their up-to-date JSDocs) have been moved to the folder's main index.ts
file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All READMEs have also been updated:
- removed experimental snippet
- updated the naming of all
Navigator
sub-components, including internal links to other READMEs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was actually renamed to packages/components/src/navigator/navigator/index.tsx
, but GitHub is not picking that up
* The `NavigatorProvider` component allows rendering nested views/panels/menus | ||
* (via the `NavigatorScreen` component and navigate between these different | ||
* view (via the `NavigatorButton` and `NavigatorBackButton` components or the | ||
* The `Navigator` component allows rendering nested views/panels/menus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The top level Navigator
component (previously named NavigatorProvider
) is the only component for which I've kept a JSDoc for the internal implementation, because apparently Storybook uses it when displaying docs 🤷 Not sure why it doesn't use the one defined in packages/components/src/navigator/index.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170 | ||
BackButton: Navigator.BackButton, | ||
}, | ||
title: 'Components/Navigator', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the PREVIOUSLY_EXPERIMENTAL_COMPONENTS
in storybook/manager-head.html
to make sure old links still work
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
965220a
to
85471a9
Compare
{ | ||
"title": "NavigatorProvider", | ||
"slug": "navigator-provider", | ||
"markdown_source": "../packages/components/src/navigator/navigator-provider/README.md", | ||
"parent": "components" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, removing things from the manifest is not going to remove it from the Block Editor Handbook 😱 There are some extra steps, see #60003 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I'll follow-up accordingly
I'm going to resume work on this PR after #64675 is merged. |
Sounds good. I was starting to review it, but I will halt it for now. I wonder if it's a good idea to approach this modularly and split whatever we can to separate PRs to keep this one smaller. |
… better, remove duplicate JSDocs
85471a9
to
0f2d077
Compare
I rebased and addressed simple feedback. I would still wait before reviewing this PR. The current plan of action is:
I've also updated the tracking issue adding all of the planned follow-up step to this PR.
@tyxla , Even if the size of the PR is medium-large, I believe 99% of the changes left in this PR are simple renames — and in that sense I feel ok with the current size. Having said that, I'll re-assess once all dependency PRs are merged, before asking for a final round of review. |
That makes sense, @ciampo, will help with the review once all the dependencies are merged 👍 |
What?
Part of #59418
Supersedes #60927
Follow-up to #63317
Export the
Navigator
component, its subcomponents, and theuseNavigator
hook as stable APIs from the@wordpress/components
packageWhy?
This is part of a larger effort to remove
__experimental
prefix from all "experimental" components, effectively promoting them to regular stable components. See the related issue for more context.How?
NavigatorProvider
=>Navigator
NavigatorScreen
=>Navigator.Screen
NavigatorButton
=>Navigator.Button
NavigatorBackButton
=>Navigator.BackButton
NavigatorToParentButton
won't be exported since it's already deprecated in the experimental version of the component@wordpress/components
package)default
exports to named exports-only internally to the componentNext steps?
Testing Instructions
Navigator
;Navigator
usages across the editor;✍️ Dev note
TBD