Skip to content

Releases: zen-fs/core

1.9.5

06 Feb 22:28
v1.9.5
529a6b6
Compare
Choose a tag to compare
  • Fixed nested symlink path resolution
  • PR CI/CD is no longer run with sub-checks (permissions)
  • Added nested symlinks tests (#187, thanks @mcandeia)
  • Fixed help message formatting
  • Added support for file URLs (#186)
  • Improved worker tests
  • Remove deprecated clearSync from InMemoryStore

1.9.4

04 Feb 19:57
v1.9.4
5f5888b
Compare
Choose a tag to compare
  • Fixed the FSRequest type for Port not including usage
  • Optimized _open so only one stat is done
  • Removed experimental VFS Caching
    • It was not maintainable and had numerous issues. Caching at the VFS level may return in a future release.
  • Fixed realpath using the FS specific instead of absolute path
  • Added internal _resolve
  • Documentation updates

1.9.3

03 Feb 05:05
v1.9.3
75ddb17
Compare
Choose a tag to compare
  • Added lots of documentation!
  • Added categories to documentation comments
  • Fixed rename removing files when renaming with the same name
  • Added internal _asyncDone to FetchFS
  • Fixed race condition with test exit
  • npm update

1.9.2

03 Feb 02:02
v1.9.2
c19348e
Compare
Choose a tag to compare
  • Fixed IndexFS not removing the old file on rename
  • Fixed assertion comparison in rename test

1.9.1

03 Feb 00:41
v1.9.1
17b11c7
Compare
Choose a tag to compare

IndexFS statSync will now throw ENOENT if the data in the index is undefined, not just when it is missing. Additionally, stat does not call statSync, which fixes usage with Async.

1.9.0

01 Feb 00:40
v1.9.0
8238edd
Compare
Choose a tag to compare

Important

This release includes some big changes and has had over 100 hours of work.
Please read carefully, as changes to internal APIs could impact your use case(s).

Logging

Modeling after various Linux logging interfaces, the new log API is very useful. It uses the same log levels as syslog, and is designed to be flexible and work well with any use case. There are a few built-in formats.

The majority of internal errors are logged. Errors that should be handled by the user (e.g. ENOENT when reading a file) are not logged. Additionally, deprecated functions and classes will log a deprecation warning.

The log is enabled by default. If you are working with resource constraints, you may want to disable logging since all entries are kept in memory. You could also periodically run log.entries.clear().

When using zenfs-test, you can set the level needed for logs to be displayed using the --log/-l options. The default is CRIT.

You can read more about logging in the documentation.

FileSystem metadata

FileSystemMetadata has been difficult to work with. It is computed every time it is fetched, damaging performance. This also has lead to numerous workarounds for its perceived immutability (e.g. _disableSync).

This release deprecates FileSystemMetadata, and introduces better designed and more intuitive ways to work with metadata:

  • attributes is designed to keep track of simple values. This is analogous to options in /etc/fstab. At the moment, the built-in attributes are all booleans, which is indicated by a void type on FileSystemAttributes. This is because the presence of the key is used rather than the value. For non-boolean types, you can use attributes like a normal Map.

  • usage returns UsageInfo, which is a subset of FileSystemMetadata. While the only file systems that return usable information for this are from @zenfs/archives, there are plans to introduce usage information for many others.

  • name is for the name of the file system type. For example, tmpfs is the name of InMemory. This is modeled after file_system_type->name in Linux

  • id is a unique 32-bit unsigned integer for the type of file system. It is currently unused internally but may in the future (one compelling use case is to resolve collisions of name). This is primarily designed for users, for example it could be used for partition tables.

  • label is an optional field that is designed to be used with instances. This is the same as labels in the context of normal partitions and file systems.

Fetch

Fetch received some much needed improvements. You can now use HTTP range requests (#53) and update the remote (#181). Note if your server supports being updated, you will almost certainly want to perform lots of authentication and value checking. Additionally, Fetch is now tested with disableAsyncCache, to make sure it will still work. Along with these change to Fetch, IndexFS has been refactored.

StoreFS, Stores, and Transactions

As many of you know, StoreFS is used by many ZenFS backends (e.g. InMemory and IndexedDB). This release cleans up StoreFS and the underlying stores and transactions.

  • StoreFS now builds an ino lookup table when initialized.
    • This significantly improves performance after initialization, especially for stores that are slow (e.g. IndexedDB).
    • The old behavior is no longer available, but could be in a future release if desirable
  • Fixed write failing if the file didn't already exist
  • read will no longer read data when the requested length is 0
    • It still checks for file existence and gets metadata
  • StoreFS can now allocate new IDs for inodes and data in constant time instead of the previous O(n)
  • Removed the type parameter from commitNew and commitNewSync

For stores and transactions:

  • Renamed Simple* to Map* (e.g. SimpleTransaction to MapTransaction) for clarification
  • Added caching to AsyncTransaction, which makes implementing an async backend even easier
    • Implementors: You will need to make sure you update the cache properly.
    • This also includes a new interface, AsyncStore
  • Extracted the transaction rollback capabilities into WrappedTransaction, a new internal class used to abstract the "raw" transaction.
    • Removed the commit, abort, and [Symbol.dispose] properties from Transaction, along with their synchronous variants
  • Removed keysSync from Transaction, since it isn't used internally.
  • The Transaction methods get and getSync can now return undefined
    • This should happen when no data is available, rather than throwing an ENOENT/ENODATA
    • Error throwing for missing data is now done by StoreFS
  • Deprecated the Store methods clear and clearSync since they aren't used

Miscellaneous

  • Move raw test data from being inlined into files
  • Cleaned up fs.promises.watch
  • Fixed FSWatcher not respecting context when added to watchers
  • Fixed emitChange from within context (#167)
  • Correctly labeled emitChange as internal and hidden
  • Moved the FileContents type to vfs/types.ts
  • zenfs-test setup files can now be skipped.
    • You can prefix the filename with _
  • Added a deadlock canary to context test
  • Fixed PassthroughFS.readSync
  • Consolidated Port test suites into a single file
  • Added copySync and copyAsync functions for tests

Internal API organization

The various internal APIs have all been moved into the src/internal directory. Please make sure to update any imports you have.

1.8.8

21 Jan 17:49
v1.8.8
146d66a
Compare
Choose a tag to compare
  • Added missing Sync methods: read and write
  • Improved how Async handles async queueing
  • Fixed an assertion in write tests (assert(...).equals(...) -> assert.equals)
  • Improved a message in write tests

1.8.7

20 Jan 19:54
v1.8.7
0844477
Compare
Choose a tag to compare
  • Performance improvements to realpath (#174)
  • Switched to strict assertion mode for tests
  • Improved messages and file names for rename tests

1.8.6

18 Jan 01:39
v1.8.6
5f53d2f
Compare
Choose a tag to compare
  • Index.directories is no longer memoized since caching lead to invalid entries
  • Added Index.directoryEntries to get the directory entries for a single path in the index
  • Enabled tsconfig verbatimModuleSyntax option
  • Changed type-only imports to use type

1.8.5

17 Jan 05:04
v1.8.5
b4bc88f
Compare
Choose a tag to compare
  • Changed default Inode.size from 4096 to 0
  • Rename unit tests (Unit tests (...)Unit tests: ...)
  • Some CI steps (e.g. tests) now show up as GitHub checks
  • Added CI CLI (zci)
  • Added zenfs-test --ci/-C
  • Added zenfs-test --inspect/-I