Skip to content
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

Deprecate kibana_react RedirectAppLinks in favor of shared_ux RedirectAppLinks #128178

Merged
merged 9 commits into from
Mar 24, 2022

Conversation

rshen91
Copy link
Contributor

@rshen91 rshen91 commented Mar 21, 2022

Summary

This PR is intended to alert teams using the RedirectAppLinks component of the deprecation of the previous implementation. The RedirectAppLinks can now be imported from the shared ux package.

  • Instead of consuming the entire application, the refactored RedirectAppLinks component requires:
currentAppId$: Observable<string | undefined>;
navigateToUrl(url: string): Promise<void>;

This PR just adds deprecation labels to the current implementations of RedirectAppLinks.

For maintainers

@rshen91 rshen91 changed the title Deprecate kibana_react RedirectAppLinks in favor of Shared_UX RedirectAppLinks Deprecate kibana_react RedirectAppLinks in favor of Shared_UX RedirectAppLinks Mar 21, 2022
@rshen91 rshen91 changed the title Deprecate kibana_react RedirectAppLinks in favor of Shared_UX RedirectAppLinks Deprecate kibana_react RedirectAppLinks in favor of shared_ux RedirectAppLinks Mar 21, 2022
@rshen91 rshen91 self-assigned this Mar 21, 2022
@rshen91 rshen91 marked this pull request as ready for review March 22, 2022 14:40
@rshen91 rshen91 requested a review from a team March 22, 2022 14:40
@rshen91 rshen91 requested review from a team as code owners March 22, 2022 14:40
@rshen91 rshen91 added release_note:skip Skip the PR/issue when compiling release notes v8.2.0 labels Mar 22, 2022
Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VisEditors changes LGTM, just adding deprecated markers

@rshen91 rshen91 added the Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) label Mar 22, 2022
@@ -23,6 +23,7 @@ import { createAppNavigationHandler } from '../app_navigation_handler';
// @ts-expect-error untyped component
import { Synopsis } from '../synopsis';
import { getServices } from '../../kibana_services';
/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-components */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think all of these comments are necessary: If you add @deprecated to the JSDoc comments where RedirectAppLinks is defined, as well as a @removeBy version, then the deprecation and all of its usages will automatically be tracked in the deprecated API docs (internal link).

Also, many IDEs will automatically indicate that the API in use is deprecated (vscode example below), so I don't think the comments are adding much.

Screen Shot 2022-03-22 at 4 33 38 PM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rshen91 Just to clarify, I was recommending the following:

 * @remarks
 * It is recommended to use the component at the highest possible level of the component tree that would
 * require to handle the links. A good practice is to consider it as a context provider and to use it
 * at the root level of an application or of the page that require the feature.
+* 
+* @deprecated
+* @removeBy 8.3 // or whatever
 */
  • Removing all of these comments (not just from this file, but from the whole PR)
-/** @deprecated Use `RedirectAppLinks` from `@kbn/shared-ux-components */

This way you don't need any CODEOWNERS reviews, and we can use our existing docs tooling to determine where deprecated APIs are in use and track that they are removed on time. (Or, as Julia suggests, it might save y'all a lot of wrangling to just make those changes in this PR directly, since it's only used in a few places).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok I think Im following thank you

@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Mar 22, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Contributor

@juliaElastic juliaElastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, out of curiosity, is there any risk of just updating the imports in this pr? It doesn't look like more effort than adding the deprecation comment.

@rshen91 rshen91 requested a review from lukeelmers March 23, 2022 14:39
@rshen91 rshen91 enabled auto-merge (squash) March 24, 2022 15:25
@rshen91 rshen91 merged commit 74a00fa into elastic:main Mar 24, 2022
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Unknown metric groups

References to deprecated APIs

id before after diff
apm 29 32 +3
cloudSecurityPosture 0 3 +3
dataEnhanced 49 55 +6
esUiShared 0 3 +3
fleet 5 20 +15
home 0 6 +6
indexLifecycleManagement 1 5 +4
infra 11 14 +3
kibanaOverview 1 12 +11
lens 15 18 +3
ml 12 18 +6
observability 0 3 +3
savedObjectsManagement 2 8 +6
spaces 9 12 +3
upgradeAssistant 8 12 +4
uptime 26 32 +6
ux 20 23 +3
visualizations 14 17 +3
total +91

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @rshen91

@rshen91 rshen91 deleted the deprecate-app-links branch March 24, 2022 16:55
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 28, 2022
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 128178 or prevent reminders by adding the backport:skip label.

2 similar comments
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 128178 or prevent reminders by adding the backport:skip label.

@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create backports run node scripts/backport --pr 128178 or prevent reminders by adding the backport:skip label.

@spalger spalger added the backport:skip This commit does not require backporting label Mar 30, 2022
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:SharedUX Team label for AppEx-SharedUX (formerly Global Experience) v8.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants