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

feat(query): reverse tracing #9319

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

NicholasLYang
Copy link
Contributor

@NicholasLYang NicholasLYang commented Oct 23, 2024

Description

Implements an MVP of reverse tracing. Basically goes through all the JavaScript/TypeScript files in the repo, checks which ones import the reverse traced file, and returns those. Does this concurrently with a JoinSet.

Also adds code to detect if a tsconfig is in scope for a file and if so, add it to the resolver. That way custom aliases work.

Testing Instructions

Added some tests including a monorepo setup with tsconfigs in the packages that define aliases

Copy link

vercel bot commented Oct 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 25, 2024 8:03pm
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 8:03pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 8:03pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 8:03pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 8:03pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 8:03pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 8:03pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 8:03pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview Oct 25, 2024 8:03pm

@NicholasLYang NicholasLYang marked this pull request as draft October 23, 2024 15:46
Copy link

socket-security bot commented Oct 25, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/[email protected] Transitive: filesystem +25 234 kB jonschlinkert

View full report↗︎

…ixes in a repo where we may have multiple tsconfigs

let mut parser = Parser::new_from(Capturing::new(lexer));
pub async fn reverse_trace(mut self) -> TraceResult {
let files = match globwalk::globwalk(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd love at some point to combine the glob walking and the import resolution so that we can have more concurrency. Right now we have to walk the entire repo, then do the import resolution step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant