-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
More fluent GraphTraversal API #4598
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Ignored Deployments
|
✅ This change can build |
🟢 CI successful 🟢Thanks |
Benchmark for ce22e68Click to view benchmark
|
let completions = NonDeterministic::new() | ||
.skip_duplicates() | ||
.visit([root], get_referenced_assets) |
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.
This is the difference in interface: no more type wrangling to create the traversal.
@@ -66,9 +90,9 @@ where | |||
} | |||
} |
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.
SkipDuplicates
could implement skip_duplicates
and return self
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.
With the way the traits are set up, this would require specialization, so I'm going to skip this for now.
crates/turbopack-node/src/lib.rs
Outdated
.await | ||
.completed()? | ||
.into_inner(); | ||
let graph = ReverseTopological::<Type>::new() |
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.
let graph = ReverseTopological::<Type>::new() | |
let graph = ReverseTopological::new() |
It should be able to infer that, shouldn't it?
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.
I'll try!
de35f0e
to
b9cfb3b
Compare
See vercel/turborepo#4598 ### Turbopack changes * vercel/turborepo#4754 <!-- Justin Ridgewell - Match TS's extends resolution algorithm --> * vercel/turborepo#4598 <!-- Alex Kirszenberg - More fluent GraphTraversal API --> --------- Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
### Description This PR refactors the API of `GraphTraversal` to be more fluent, and less magical. It should make it easier to use and understand. Had this in store from trying to debug a lifetime issue in another branch. ### Testing Instructions Surface-level change. Next.js PR: https://github.com/vercel/turbo/pulls/alexkirsz
### Description This PR refactors the API of `GraphTraversal` to be more fluent, and less magical. It should make it easier to use and understand. Had this in store from trying to debug a lifetime issue in another branch. ### Testing Instructions Surface-level change. Next.js PR: https://github.com/vercel/turbo/pulls/alexkirsz
### Description This PR refactors the API of `GraphTraversal` to be more fluent, and less magical. It should make it easier to use and understand. Had this in store from trying to debug a lifetime issue in another branch. ### Testing Instructions Surface-level change. Next.js PR: https://github.com/vercel/turbo/pulls/alexkirsz
Description
This PR refactors the API of
GraphTraversal
to be more fluent, and less magical. It should make it easier to use and understand. Had this in store from trying to debug a lifetime issue in another branch.Testing Instructions
Surface-level change.
Next.js PR: https://github.com/vercel/turbo/pulls/alexkirsz