-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: opaque symlink support #7549
Conversation
a5df678
to
b941318
Compare
@aleclarson you're my personal hero 🥇 ! Any updates on this PR? |
I suspect they won't review this PR until after the TypeScript rewrite, and then I'll need to redo it all. 😅 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@mjesun when do you think you have time to review this branch? |
@SimenB ^ |
This is a thing FB devs have to review as it's for RN/Metro. I'm not sure if it's needed for anything Jest itself does? |
I'll get to this soon. |
Any updates with this? |
Latest in this space is #9351 |
As @nicojs said, you're my personal hero too @aleclarson! |
One of the biggest problem of adopting react-native-web and mono repo setup, definitely voting fo this one! |
Rebased onto v24.9.0 |
Every "node_modules" directory within a project root is searched for linked dependencies. Each linked dependency can become a project root if its resolved path meets these criteria: - not inside a "node_modules" directory - not inside an existing project root Once all linked dependencies are found, collect every file (including symlinks) in each of the project roots. Two properties are added to the cache of "jest-haste-map": "links": Map of link paths (relative to rootDir) to their metadata "roots": Array of configured roots and linked roots One method is added to the "HasteFS" class: "follow": Lazily resolves any symlink found by the crawler⚠️ The JS crawler does *not* yet support symlinks; only the Watchman crawler does.⚠️ Watch mode does *not* yet support symlinks.
Probably the longest PR as duration I have seen. @aleclarson - nice job trying to address this! |
This adds jest.bzl and uses it to pass in specific tests. See jestjs/jest#7549
Any update from this PR? |
Landed (and released as beta) #9351 which adds support for crawling symlinks (which fixes support for Bazel at least). Is the extra features of this PR needed? If yes, can you rebase so we can re-evaluate? |
Metro users can't use linked dependencies without this PR. (facebook/metro#257)
I'm hesitant to rebase, because of past concerns here and here. |
I cannot make that promise (or even that it'd be reviewed in a timely manner), unfortunately |
I am one of them, any update on this one? |
Since a custom fork of https://github.com/facebook/metro/tree/main/packages/metro-file-map |
This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This is a follow-up to #6993.
Its goals include:
yarn link
)jest-haste-map
for later consumptionfollow
method to theHasteMap
class (for lazily resolving symlinks)More details in the commit messages and code comments.
What's missing
No support for symlinks in watch mode. 😢 But regular files in linked packages are watched.
More details on watch mode here: #7549 (comment)
Test plan
I've fixed most of the tests that were broken by my changes. Please provide guidance on the remaining unfixed tests. Also, we could use some automated tests for symlinks.
I've tested locally on projects using:
pnpm install
yarn link
npm install
For manual testing, you can use this repository:
https://github.com/aleclarson/repro/tree/jest-symlinks