-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat: turbo-trace #9134
feat: turbo-trace #9134
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
8 Skipped Deployments
|
da14f3e
to
80fcd19
Compare
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.
LGTM
Just two minor comments
crates/turbo-trace/src/tracer.rs
Outdated
// Convert found imports/requires to absolute paths and add them to files to | ||
// visit | ||
for (import, span) in finder.imports() { | ||
let file_dir = file_path.parent().unwrap_or(&self.cwd); |
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 think an expect
might be more appropriate than .unwrap_or
here since None
would mean that we're currently process the root dir.
} | ||
|
||
impl File { | ||
pub fn new(run: Arc<Run>, path: AbsoluteSystemPathBuf) -> 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.
Not blocking, but would it make sense to just pass in repo_root
instead of the entire Run object? It would make writing unit tests a lot easier.
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.
Eventually I want to be able to map from a file to affected packages, so that will require the whole run object
928bcef
to
26e893a
Compare
Description
A long long time ago we had a node-file-trace implementation in the repository. Unfortunately this was tied to turbopack and the turbo-tasks code. Since that's now in a different repository, we're gonna implement our own version, because that's easier than coordinating multi-repo dependencies.
This implementation uses
oxc_resolver
andswc
to resolve dependencies and parse files.This PR hooks it up to
turbo query
but we'll probably have other uses later.Testing Instructions
Adds some tests in
turbo-trace.t
usingquery