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

ref(insights): Simplify SpanTimeCharts #81931

Merged
merged 7 commits into from
Dec 10, 2024

Conversation

gggritso
Copy link
Member

@gggritso gggritso commented Dec 10, 2024

SpanTimeCharts is a very old component with a lot of issues, since it uses all kinds of old hooks for fetching, and have a lot of dead code.

Importantly, it's only used in one place! The Resources landing page. This PR renames it, moves it, and removes any code that isn't needed for that page.

There's still old data loading, and other issues, but one thing at a time.

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 10, 2024
@gggritso gggritso marked this pull request as ready for review December 10, 2024 20:57
@gggritso gggritso requested a review from a team as a code owner December 10, 2024 20:57
Copy link
Contributor

@DominikB2014 DominikB2014 left a comment

Choose a reason for hiding this comment

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

lgtm! just some nits

Comment on lines +49 to +57
if (extraQuery) {
eventView.query += ` ${extraQuery.join(' ')}`;
}

const {isPending} = useSpansQuery({
eventView,
initialData: [],
referrer: 'api.starfish.span-time-charts',
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Ideally we use useSpanMetrics here, or I suppose longterm it will be a dashboard diget?

We're not doing this because of the following comment you made right?

There's still old data loading, and other issues, but one thing at a time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep!

const {isPending} = useSpansQuery({
eventView,
initialData: [],
referrer: 'api.starfish.span-time-charts',
Copy link
Contributor

@DominikB2014 DominikB2014 Dec 10, 2024

Choose a reason for hiding this comment

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

Suggested change
referrer: 'api.starfish.span-time-charts',
referrer: 'api.performance.resources.span-time-charts',

^ Also applies to other referrers in this file

Additionally, I think ideally this comes from a referrers.ts file as the other modules do.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can update that in a follow-up! 👍🏻

@gggritso gggritso merged commit 0b51b12 into master Dec 10, 2024
44 checks passed
@gggritso gggritso deleted the ref/insights/simplify-span-time-charts-a-bit branch December 10, 2024 21:50
gggritso added a commit that referenced this pull request Dec 11, 2024
We did not finish this project. The UI code is removed in
#81931
@github-actions github-actions bot locked and limited conversation to collaborators Dec 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants