-
Notifications
You must be signed in to change notification settings - Fork 0
Grump 1.0-ish wishlist #1
Description
Tracking things I'd like to do / fix for the 1.0 release:
- Rewrite Grump in Typescript
This would help ensure that GrumpFS indeed matches the Node's FS interface and increase reliability. It's also an opportunity to clean up a bunch of modules and perhaps narrow the scope some more.
- Cache the directory tree so it can be reused by GrumpFS
A lot of globbing libraries like to make a lot of fs.dirlist calls and currently each one of them triggers a full traversal of the handlers. Also, since the handlers are based on the patterns and not actual directory structure, weird requests can be served where something that looks like a directory is actually a file.
- Don't trigger the handler when doing
fs.statcalls and similar
Most callers just want to know if a file exists and if it's a directory. These can be answered by traversing the handlers. Only asking for the file size would require running the handler, but I'm yet to see any build tool that does that.
- Grump.require should wrap
graceful-fsand similar libraries, too - Add ability for handlers to pass on handling the filename in which case the next one is tried
- Find a better way to deal with *Sync calls
Currently, the sync package requires that the current stack frame starts inside a fiber somewhere which any callback based code is going to violate. There could be a separate sync path trough Grump that does it's best to serve the request. This would also let us get rid of the fibers package which is a compiled module that patches Node internals and could cause weird bugs and conflicts.
- Implement the less used fs methods for GrumpFS, like
readandopen. - Implement fs write methods that should simply write the file to the cache or with a configuration option, write it to the file system.