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

perf(kit,nuxt): use fdir to speed up fs scanning #27803

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft

Conversation

danielroe
Copy link
Member

🔗 Linked issue

📚 Description

This aims to provide faster glob performance when resolving files with Nuxt.

Discovered @antfu's thoughts in unocss/unocss#3722 (comment) too late, so would value his review. 🙏

We might choose to revert the adoption of fdir here and later go with native fs.glob, keeping just the move to native readdir...

Copy link

stackblitz bot commented Jun 24, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

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

Package New capabilities Transitives Size Publisher
npm/@types/[email protected] None 0 18 kB types
npm/[email protected] filesystem 0 56.3 kB thecodrr

View full report↗︎

@danielroe danielroe changed the title perf(nuxt,vite): use native node fs utils rather than fs-extra perf(kit,nuxt): use fdir to speed up fs scanning Jun 24, 2024
@antfu
Copy link
Member

antfu commented Jun 24, 2024

I also continued the discussion with @43081j in e12e's discord - my main worry about this is the cost of API changes and implicit behavior changes. My suggestion would be we find a fs.glob shims with the exact API for Node.js prior that version. This way it would be more like the ultimate state (zero-deps, standardized) that the ecosystem would likely to agree to move to. And at one point when we drop the Node version that without the API, we can then remove the shims without migrating again

@danielroe danielroe closed this Jun 25, 2024
@43081j
Copy link

43081j commented Jun 25, 2024

just my two cents: only the API style will differ here. behaviour is likely the same if setup correctly

for that reason though, i'd likely still opt for fs.glob if you're able to (but its pretty new so doubt we can require that version yet). not sure how likely a shim/polyfill is

@danielroe danielroe deleted the perf/fdir branch June 26, 2024 10:26
@danielroe danielroe restored the perf/fdir branch June 26, 2024 10:26
@danielroe danielroe reopened this Jun 26, 2024
@danielroe danielroe marked this pull request as draft July 3, 2024 21:50
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.

None yet

3 participants