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

Various cleanup in plexus #426

Merged
merged 8 commits into from
Aug 8, 2019

Conversation

tiffon
Copy link
Member

@tiffon tiffon commented Jul 31, 2019

Which problem is this PR solving?

Various cleanup of the plexus package.

Short description of the changes

Note: This builds on the #425 (the README PR).

  • Revisit the default types for generics on TEdge and TVertex
  • Remove the label field from TVertex
  • Remove the data and label fields from TEdge
  • Rename component to Digraph instead of LayeredDigraph
  • Add props factories onto Digraph as static fields
  • Rename getLocalId to getGlobalId
  • Remove scaledStrokeWidth prop factory
  • Fix perf refressions in Digraph by wrapping nodes and edges in pure wrappers
  • Fix issues in jaeger-ui introduced when removing number from TVertexKey

- Rename component to Digraph instead of LayeredDigraph
- Revisit the default types for generics on TEdge and TVertex
- Remove the label field from TVertex
- Remove the data and label fields from TEdge

Signed-off-by: Joe Farro <joef@uber.com>
- Rename getLocalId to getGlobalId
- Remove scaledStrokeWidth
- Add props factories onto Digraph

Signed-off-by: Joe Farro <joef@uber.com>
@tiffon tiffon added the plexus Specific to packages/plexus label Jul 31, 2019
@tiffon tiffon requested a review from everett980 July 31, 2019 17:17
Signed-off-by: Joe Farro <joef@uber.com>
@tiffon tiffon force-pushed the layered-digraph-package-cleanup branch from 9d4c5ed to 53b9aed Compare July 31, 2019 21:18
@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #426 into master will decrease coverage by 0.13%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #426      +/-   ##
==========================================
- Coverage   91.68%   91.54%   -0.14%     
==========================================
  Files         176      176              
  Lines        4039     4034       -5     
  Branches      968      966       -2     
==========================================
- Hits         3703     3693      -10     
- Misses        292      297       +5     
  Partials       44       44
Impacted Files Coverage Δ
...s/TraceDiff/TraceDiffGraph/traceDiffGraphUtils.tsx 58.33% <0%> (ø) ⬆️
...kages/jaeger-ui/src/model/trace-dag/convPlexus.tsx 100% <100%> (+6.66%) ⬆️
packages/jaeger-ui/src/model/trace-dag/DagNode.tsx 100% <100%> (ø) ⬆️
...nents/TracePage/TraceGraph/calculateTraceDagEV.tsx 92.85% <0%> (-7.15%) ⬇️
...eViewer/TimelineHeaderRow/TimelineViewingLayer.tsx 88.13% <0%> (-5.09%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b86cfd3...b6bc9bc. Read the comment docs.

@tiffon tiffon mentioned this pull request Aug 1, 2019
1 task
Copy link
Collaborator

@everett980 everett980 left a comment

Choose a reason for hiding this comment

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

I'm confused as to why some generics default to {} and others to Record<string, unknown>. Is there a guiding principal for when one is preferred over the other? I'd think {} would be best as it forces consumers to provide types if the generic isn't supposed to be empty.

@@ -74,7 +73,7 @@ export default class DirectedGraph<T> extends React.PureComponent<
arrowScaleDampener: undefined,
className: '',
classNamePrefix: 'plexus',
getNodeLabel: defaultGetNodeLabel,
// getNodeLabel: defaultGetNodeLabel,
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this be removed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the entire DirectedGraph component will be removed in another PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Will resolve this in the PR that removes DirectedGraph

packages/plexus/src/LayoutManager/Coordinator.tsx Outdated Show resolved Hide resolved
packages/plexus/src/LayoutManager/LayoutManager.tsx Outdated Show resolved Hide resolved
packages/plexus/src/LayoutManager/match-inputs.tsx Outdated Show resolved Hide resolved
packages/plexus/src/zoom/MiniMap.tsx Outdated Show resolved Hide resolved
Signed-off-by: Joe Farro <joef@uber.com>
(cherry picked from commit a4e4fa2)
@tiffon
Copy link
Member Author

tiffon commented Aug 7, 2019

I think the generics need a bit more refinement. I suggest this happen on a future PR as the generics are currently in pretty good shape and we have other fish to fry. Currently, the main place to supply types is on the Digraph component, everything else trickles down, from there.

Copy link
Collaborator

@everett980 everett980 left a comment

Choose a reason for hiding this comment

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

Definitely agree that refining generics can wait for now

@tiffon tiffon merged commit 219aa76 into jaegertracing:master Aug 8, 2019
@tiffon tiffon deleted the layered-digraph-package-cleanup branch August 8, 2019 03:25
@tiffon tiffon restored the layered-digraph-package-cleanup branch August 8, 2019 03:25
vvvprabhakar pushed a commit to vvvprabhakar/jaeger-ui that referenced this pull request Jul 5, 2021
Various cleanup in plexus
Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plexus Specific to packages/plexus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants