-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Build: Replace globby with fdir #19297
Conversation
I ran fdir's benchmarks, which include fast-glob (globby) and tiny-glob, and it came out on top:
|
Any idea what this pnp e2e failure could be from?
|
I've broken out a separate PR to fix the issues with |
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.
Though the code generally looks a bit more complex, I'm ok with it.
But i noticed in a few places we're using .sync()
; which seems wasteful because this is going to touch the FS and so be potentially slow & blocking.
Waiting for thecodrr/fdir#80 to be released, which should fix yarn pnp. I'll try making these calls async as well. |
# Conflicts: # code/lib/cli/scripts/generate-sb-packages-versions.js
Socket Security Report👍 No new dependency issues detected in pull request Socket.dev scan summary
Bot CommandsTo ignore an alert, reply with a comment starting with Powered by socket.dev |
Merge when green! |
Unfortunately I've hit another snag with fdir. The way it handles symlinks is by resolved path, not the symlink path. This breaks in our testing setup, where we symlink in various addon stories. The author is considering changing this behavior, but until/unless he does, I think we can't move forward with fdir. I may need to put this back down for a while and focus on other parts of the jest upgrade, and come back to this later either when fdir's symlink behavior is changed, or find a different alternative, or maybe just find a way to adjust jest to work correctly with globby, our existing tool. |
# Conflicts: # code/addons/storysource/package.json
I found a different way to handle the underlying issue with setImmediate. We may want to re-evaluate the use of globby in the future, but given the challenges I've had getting fdir to work in an equivalent way, I'm closing this out for now. |
Would you be up for taking another look at this? There have been a lot of changes in the way A few examples:
The reason I am bringing this up again is due to the performance benefits Storybook can get by migrating to |
Thanks for your work on fdir, @thecodrr. I think this PR is probably quite a bit outdated at this point, but I will try to find some time to take another crack at this in the not-too-distant future. |
Issue:
What I did
I was trying to upgrade our version of jest from 26 to 29, and I started getting failures of:
These were coming from
globby
(or one of its dependencies).I could have solved this in three ways, I think:
I did some checking around, and while
tiny-glob
seemed like a promising candidate, it didn't have a way to ignore node_modules (terkelg/tiny-glob#79).I then came across
fdir
, which claims to be the fastest glob solution around, with no dependencies and a small size. https://github.com/thecodrr/fdirThis PR swaps out globby for fdir. I think every thing we can do to gain some perf is a win, but happy to explore the other alternatives here as well.
How to test
If your answer is yes to any of these, please make sure to include it in your PR.