-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: use stable export instead of experimental export #65753
Conversation
Size Change: +499 B (+0.03%) Total Size: 1.77 MB
ℹ️ View Unchanged
|
4806ee3
to
dfbc26b
Compare
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. |
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.
Only tangential, but I found it a bit misleading that there is no separate legacy implementation of useNavigator
, but it's exported from the legacy
folder. For clarity, maybe export it directly from the current implementation folder?
diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts
index cc3c0265c4..1d0e1dd839 100644
--- a/packages/components/src/index.ts
+++ b/packages/components/src/index.ts
@@ -130,9 +130,13 @@ export {
NavigatorButton as __experimentalNavigatorButton,
NavigatorBackButton as __experimentalNavigatorBackButton,
NavigatorToParentButton as __experimentalNavigatorToParentButton,
- useNavigator as __experimentalUseNavigator,
} from './navigator/legacy';
-export { Navigator, useNavigator } from './navigator';
+export {
+ Navigator,
+ useNavigator,
+ /** @deprecated Import `useNavigator` instead. */
+ useNavigator as __experimentalUseNavigator,
+} from './navigator';
export { default as Notice } from './notice';
export { default as __experimentalNumberControl } from './number-control';
export { default as NoticeList } from './notice/list';
packages/block-editor/src/components/inserter/mobile-tab-navigation.js
Outdated
Show resolved
Hide resolved
packages/edit-site/src/components/global-styles/font-library-modal/installed-fonts.js
Outdated
Show resolved
Hide resolved
dfbc26b
to
b28a122
Compare
export { | ||
Navigator, | ||
useNavigator, | ||
useNavigator as __experimentalUseNavigator, |
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 deprecation will happen in a follow-up PR
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.
Looks good 🚀
* Navigator: use stable export instead of experimental export * More clear export of useNavigator --- Co-authored-by: ciampo <[email protected]> Co-authored-by: mirka <[email protected]>
…s#65753) * Navigator: use stable export instead of experimental export * More clear export of useNavigator --- Co-authored-by: ciampo <[email protected]> Co-authored-by: mirka <[email protected]>
…ordPress#65753)" This reverts commit 591700a.
* Navigator: use stable export instead of experimental export * More clear export of useNavigator --- Co-authored-by: ciampo <[email protected]> Co-authored-by: mirka <[email protected]>
What?
Part of #59418
Refactor existing usages of
Navigator
to use the stable export of the component, instead of the experimental export.Why?
The component had become stable, and the experimental APIs will be deprecated soon.
How?
By refactoring the imports throughout the repository.
Testing Instructions
Smoke test the app, make sure that all places where
Navigator
is used keep working as expected: