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
Support multiple edge types in Graph.hasEdge
#8550
Conversation
Benchmark ResultsKitchen Sink ✅
Timings
Cold Bundles
Cached BundlesNo bundle changes detected. React HackerNews 🚨
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... AtlasKit Editor 🚨
Timings
Cold BundlesNo bundles found, this is probably a failed build... Cached BundlesNo bundles found, this is probably a failed build... Three.js ✅
Timings
Cold BundlesNo bundle changes detected. Cached BundlesNo bundle changes detected. |
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.
@thebriando I made the changes we spoke about. Had a bit of trouble with the types, I think a lot of the serialize/deserialze types are not quite right which I ended up changing in some cases.
Let me know what you think.
Graph.hasEdge
↪️ Pull Request
This PR adds some desired functionality discovered when creating #8453. @AGawrys
Currently,
Graph.hasEdge
only accepts a single edge type to validate against. This PR adds support for:TheALL_EDGE_TYPES
constant, allowing edge checks to be type agnostic.As the graph isn't currently aware of all possible edge types without doing lookups, we (@alshdavid and I) have added a newedgeTypes
property to theAdjacencyList
which is appended insideaddEdge
. To keep things simple, we never remove edge types. This shouldn't cause any issues, but does mean it's possible to search for edge types that no longer exist in the graph and edge types are never cleaned up once they have existed.It's possible we'll decide that supportingALL_EDGE_TYPES
isn't worth tracking the extra piece of state. If that's the case it should be easy to remove that code and keep just the passed array of edge types param.After a discussion with @AGawrys we've decided simple array support is enough and
ALL_EDGE_TYPES
isn't worth the complexity.💻 Examples
✔️ PR Todo