Conversation
There was a problem hiding this comment.
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.
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.
All READMEs have also been updated:
- removed experimental snippet
- updated the naming of all
Navigatorsub-components, including internal links to other READMEs
There was a problem hiding this comment.
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.
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
| // @ts-expect-error - See https://github.com/storybookjs/storybook/issues/23170 | ||
| BackButton: Navigator.BackButton, | ||
| }, | ||
| title: 'Components/Navigator', |
There was a problem hiding this comment.
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.
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.
Thank you! I'll follow-up accordingly
There was a problem hiding this comment.
Just a reminder we'll need to take care of this one after merging.
There was a problem hiding this comment.
Hey @WordPress/wordpress-org-meta-team , could you help with this? We need to update the Block Editor Handbook, removing the following components:
If possible, we'd also like to set a redirect for those pages being removed. The redirect should point to the Navigator component.
Could you please help with that? Thank you 🙏
There was a problem hiding this comment.
Thank you!
I noticed the formatting on the new doc loses consistency around the
Navigator.Buttonpoint (heading is not bold):
Good catch! Opened #65763 to fix it
|
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. |
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 👍 |
cea2b8e to
999795a
Compare
* Remove experimental status from Storybook * NavigatorProvider => Navigator (internally) * Move legacy exports to separate file * Export overloaded notation * Use overloaded notation in Storybook * Use overloaded notation in unit tests (skipping deprecated component for now) * Update docs manifest.json * Navigator: update docs * Navigator.BackButton: update docs * NavigatorToParentButton: delete README * Navigator.Button: update docs * NavigatorScreen: update docs * Restore `NavigatorToParentButton` test * Use dot notation in context namespaces too * Use named export for `NavigatorToParentButton` too * Fixup docs manifest * Export stable version from components package * CHANGELOG * Change index.ts extension to tsx to allow Storybook to extract JSDocs better, remove duplicate JSDocs * Remove unnecessary and mispelled display name for top-level `Navigator` * Remove @example tag from top-level export * Clean up unused imports * Fix storybook styles * Update new section of the docs * Update more docs * Update deprecation warning * Update and align docs * Fix tests warning checks * Typo * Fix useContextSystem names * Remove mentions of the `useNavigator` hook * useNavigator JSDocs * Move all READMEs under the main README * Move README to component's root folder * Update types JSDocs to match README * Update docs manifest * Fix JSDocs typos, grammar, and broken links. * Update storybook selector --- Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mirka <0mirka00@git.wordpress.org> Co-authored-by: tyxla <tyxla@git.wordpress.org>
This reverts commit cedb4d4.

What?
Part of #59418
Supersedes #60927
Follow-up to #63317
Export the
Navigatorcomponent, its subcomponents, and theuseNavigatorhook as stable APIs from the@wordpress/componentspackageWhy?
This is part of a larger effort to remove
__experimentalprefix from all "experimental" components, effectively promoting them to regular stable components. See the related issue for more context.How?
__experimentalprefix, add new, unprefixed exports:NavigatorProvider=>NavigatorNavigatorScreen=>Navigator.ScreenNavigatorButton=>Navigator.ButtonNavigatorBackButton=>Navigator.BackButtonNavigatorToParentButtonwon't be exported since it's already deprecated in the experimental version of the component@wordpress/componentspackage)Next steps?
Testing Instructions
Navigator;Navigatorusages across the editor;✍️ Dev note
The legacy set of
__experimentalNavigator*APIs is deprecated and should instead be imported asNavigator. All of the sub-components are also available via theNavigatornamespace.Moreover, the
__experimentalNavigatorToParentButtoncomponent and thegoToParentmethod available via the__experimentalUseNavigatorhook are now deprecated, and they now behave identically to the__experimentalNavigatorBackButtonand thegoBackmethod.To recap:
__experimentalNavigatorProvider=>Navigator__experimentalNavigatorScreen=>Navigator.Screen__experimentalNavigatorButton=>Navigator.Button__experimentalNavigatorBackButton=>Navigator.BackButton__experimentalNavigatorToParentButton=>Navigator.BackButton__experimentalUseNavigator=>useNavigator