Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This removes the
Node
interface and its requirement for Graph values. This makesGraph<T>
as generic asArray<T>
.Rather than enforce an id property (which is vestigial and in our use usually reflects a content digest instead of the node's id in the graph) or a type property, users of Graph can use any shape for node values. This type can always be a disjoint union and the user can refine it in their code, but the Graph has never really been aware of the content of its values (nor should it be), so it no longer requires it.
I did not change any of the main AssetGraph, BundleGraph, or RequestGraph node value shapes, which still retain
type
andid
.type
should stay to form a disjoint union across the node values, butid
should probably be retired in the long term — it's really the content key.ContentGraph#addNodeByContentKey
no longer attempts to replace node values (it throws when a key already exists), and this behavior has been moved to where it has been expected.Test Plan:
yarn test
. Adjusted unit tests and removed many of the shapes formerly needed to fulfill these interface requirements.