Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

API Proposal: refactor file adding #279

Closed
6 tasks done
hackergrrl opened this issue May 20, 2016 · 1 comment
Closed
6 tasks done

API Proposal: refactor file adding #279

hackergrrl opened this issue May 20, 2016 · 1 comment

Comments

@hackergrrl
Copy link
Contributor

hackergrrl commented May 20, 2016

Background

We're in the process of unifying the js-ipfs and js-ipfs-api APIs to be consistent, provided by the interface-ipfs-core interface. For the roadmap, see this issue.

Part of this process is identifying what API calls from js-ipfs-api should be part of the IPFS Core API, and which are auxiliary functions that aren't specific to the core.

Proposed Change

One such API call from js-ipfs-api that doesn't fit well into Core is the ability to add a file or directory using add. Core needs to be as agnostic as possible, and shouldn't be responsible for interacting with the underlying file system at all (think browser support).

This is useful functionality to have though, so I suggest moving the file/directory adding logic into a separate method on the API, like addFiles, which can perform the filesystem operations within this module, and translate them to an array of streams and paths to be handed over to the Core API.

Steps

  • remove file/directory adding from add
  • introduce a new api call that does adding files from the local filesystem (addFiles)
  • remove url adding from add
  • introduce a new api call that does adding files from a URL (addURL)
  • use interface-ipfs-core for testing add
  • bump a major semver to make it clear that this is a breaking change

ping @diasdavid @nginnever @dignifiedquire

@daviddias
Copy link
Contributor

This is all done now 🎉 It was merged with the "next-generation" PR :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants