Skip to content

v7.0 Plan #70

@thecodrr

Description

@thecodrr

fdir has reached maximum performance. I am not saying that to discourage others from trying to make a faster directory crawler. Not at all. But I have stripped fdir down to its bones and haven't noticed any significant increase in speed. The only space left for improvement is directly in NodeJS internals. So where does that leave us?

I had initially planned to freeze the API of fdir but fdir has no proper "API". What I would be freezing, most probably, would be more features. I can't do that though. Not yet, anyway. Why?

  1. fdir is not feature complete. I don't want to make just the fastest directory crawler but also the best one.
  2. I don't want any one using fdir to ever feel like it can't do X or Z. An impossible feat but...
  3. I am not happy with the current state of the codebase. Even though an API freeze doesn't mean I can't change code, I want to be able to break things.

So what's the plan for v6.0?

  • Modernize the codebase — the whole codebase is ES3 or something. In my quest for performance, I went to the extreme. Too much, it seems. Maybe we can even use Typescript this time around (but I like keeping things simple).
  • Strip the core directory crawler down to the bare minimum — right now, everything flows in and out of fdir with a free pass. The result is that there is a lot going on at one time. It is time to simplify things...and that brings me to:
  • Make fdir pluggable — after some initial thought, this is the best way forward. The idea is to allow anyone to directly tap into the crawling process and control it.
  • Move all the extra features & flags to their own plugins — this will enable a more robust system. There will be an "official" set of plugins that will act as a foundation for others to play with the Plugin API.
  • Improve documentation — this doesn't even need explaining but yes! It's time to move to Docsaurus 😆

Does this mean that the Builder API is dying? Nope. I like the Builder API and it'll stay. It will act as a kind of a proxy for the plugins underneath. That means the Builder API will also need to be extensible.

The end goal is to make the following features possible:

  1. Streams & Iterators
  2. Globbing (the current one is a joke, I am talking about a proper globber)
  3. Multiple filesystems (locking fdir to fs is a bad idea)
  4. Deno support, maybe (not sure about this)
  5. And other stuff...you guys can suggest.

In the end, the idea is to reduce complexity, increase flexibility, improve readability, and maintain the performance (and become the de-facto directory crawler in the Nodeverse).


In any case, that's the plan. I would love to hear what you guys think about this. Ideas, suggestions, possible ways to implement a plugin system, ideas for plugins, etc, etc, etc. is all welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions