Skip to content

v1.4.0

Compare
Choose a tag to compare
@jvilk jvilk released this 24 Jul 01:48
· 239 commits to master since this release

This should be the last minor version of BrowserFS in the 1.x series. Future releases in the 1.x series will be limited to bug fixes.

This version standardizes the way that users instantiate BrowserFS backends, provides a much more convenient method of configuring BrowserFS as a whole, and should be significantly easier to use for newcomers to the library.

This version also adds deprecation notices to a number of APIs that will be removed in 2.x in favor of these more convenient and standardized instantiation methods.

Here are the changes in this version:

  • New convenience methods:
    • BrowserFS.configure(configObj, function(e) {}): Configure BrowserFS with a single object. See the README for more information. This is the single best change to BrowserFS in this update!
    • Create() Methods: Every single file system has a Create function that accepts file system-specific options as an object and a callback. These are easy to promisify, but you don't even have to use these directly if you use BrowserFS.configure!
    • MountableFileSystem.Create(): The new way of instantiating the MountableFileSystem takes in a mount map: BrowserFS.FileSystem.MountableFileSystem.Create({ '/tmp': inMemory }, function(e, fs) {})
  • Deprecated methods: Deprecates awkward initialization phases from file systems and constructors that require callbacks.
    • new BrowserFS.FileSystem.AsyncMirror(sync, async): Use BrowserFS.FileSystem.AsyncMirror.Create({ sync: sync, async: async }, function (e, fs) {}) instead.
    • AsyncMirror.initialize(): Use AsyncMirror.Create, which handles initialization for you.
    • new BrowserFS.FileSystem.Dropbox(client): Use BrowserFS.FileSystem.Dropbox.Create({client: client}, function (e, fs) {}) instead.
    • new BrowserFS.FileSystem.HTML5FS(size, type): Use BrowserFS.FileSystem.HTML5FS.Create({ type: type, size: size }, function (e, fs) {}) instead.
    • HTML5FS.allocate(): Use HTML5FS.Create() instead, which handles allocation for you.
    • new BrowserFS.FileSystem.IndexedDB(storeName): Use BrowserFS.FileSystem.IndexedDB({ storeName: storeName }, function(e, fs) { }) instead.
    • new BrowserFS.FileSystem.IsoFS(data, name): Use BrowserFS.FileSystem.IsoFS({ data: data, name: name}, function(e, fs) {}) instead.
    • new BrowserFS.FileSystem.OverlayFS(writable, readable): Use BrowerFS.FileSystem.OverlayFS({ readable: readable, writable: writable }, function (e, fs) {}) instead.
    • OverlayFS.initialize(): Use OverlayFS.Create() instead, which initializes OverlayFS for you!
    • new BrowserFS.FileSystem.WorkerFS(worker): Use BrowserFS.FileSystem.WorkerFS({ worker: worker }, function (e, cb){}) instead.
    • new BrowserFS.FileSystem.XmlHttpRequest(index, baseUrl): Use BrowserFS.FileSystem.XmlHttpRequest.Create({ index: index, baseUrl: baseUrl}) instead.
    • XmlHttpRequest.FromUrl: Use XmlHttpRequest.Create() instead, which handles index URLs asynchronously.
    • new BrowserFS.FileSystem.ZipFS(zipData, name): Use BrowserFS.FileSystem.ZipFS.Create({ zipData: zipData, name: name }, function (e, fs) {}) instead.
    • ZipFS.computeIndex(): Use ZipFS.Create() instead, which already computes indexes responsively.