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

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs-inactive/js-ipfs-http-client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v41.0.1
Choose a base ref
...
head repository: ipfs-inactive/js-ipfs-http-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 15 commits
  • 107 files changed
  • 3 contributors

Commits on Jan 23, 2020

  1. refactor: async iterables (#1183)

    TLDR;
    
    * Remove Node.js streams and pull streams
    * Remove callbacks
    * Remove `peer-info` and `peer-id`
    
    ---
    
    Now that internals are all async/await/iterables and `fetch` the next step is to bubble up that goodness to the core API, removing the multiple stream APIs and removing callback support.
    
    I'm also proposing removing `peer-info` and `peer-id`, since these drastically increase the bundle size by pulling in `libp2p-crypto`, for which 99% of it's capability is unused. In place of `peer-id` we return a `CID`, which can easily be converted to a `PeerId` instance via:
    
    ```js
    const peerId = PeerId.createFromCID(peerCid)
    ```
    
    In place of `peer-info` we return an object `{ id: CID, addrs: Multiaddr[] }`, which can easily be converted to a `PeerInfo` like:
    
    ```js
    const peerInfo = new PeerInfo(PeerId.createFromCID(info.id))
    info.addrs.forEach(addr => peerInfo.multiaddrs.add(addr))
    ```
    
    refs ipfs/js-ipfs#1670
    refs ipfs/js-ipfs#2611
    refs ipfs-inactive/interface-js-ipfs-core#394
    
    TODO:
    
    * [x] Refactor local tests
    * [x] Remove `addFromFs` and `addFromUrl` and export `globSource` and `urlSource` instead
    * [x] Refactor `interface-ipfs-core` tests
    * [x] Document new APIs in `interface-ipfs-core`
    * [x] Update README with API changes
    * [x] [Document upgrade path from Node.js/pull streams to async iterables](https://gist.github.com/alanshaw/04b2ddc35a6fff25c040c011ac6acf26)
    
    Depends on:
    
    * [x] ipfs/js-ipfs-utils#15
    * [x] ipfs-inactive/interface-js-ipfs-core#567
    
    BREAKING CHANGE: Callbacks are no longer supported on any API methods. Please use a utility such as [`callbackify`](https://www.npmjs.com/package/callbackify) on API methods that return Promises to emulate previous behaviour.
    
    BREAKING CHANGE: `PeerId` and `PeerInfo` classes are no longer statically exported from `ipfs-http-client` since they are no longer used internally.
    
    BREAKING CHANGE: `pin.add` results now contain a `cid` property (a [CID instance](https://github.com/multiformats/js-cid)) instead of a string `hash` property.
    
    BREAKING CHANGE: `pin.ls` now returns an async iterable.
    
    BREAKING CHANGE: `pin.ls` results now contain a `cid` property (a [CID instance](https://github.com/multiformats/js-cid)) instead of a string `hash` property.
    
    BREAKING CHANGE: `pin.rm` results now contain a `cid` property (a [CID instance](https://github.com/multiformats/js-cid)) instead of a string `hash` property.
    
    BREAKING CHANGE: `add` now returns an async iterable.
    
    BREAKING CHANGE: `add` results now contain a `cid` property (a [CID instance](https://github.com/multiformats/js-cid)) instead of a string `hash` property.
    
    BREAKING CHANGE: `addReadableStream`, `addPullStream` have been removed.
    
    BREAKING CHANGE: `ls` now returns an async iterable.
    
    BREAKING CHANGE: `ls` results now contain a `cid` property (whose value is a [CID instance](https://github.com/multiformats/js-cid)) instead of a `hash` property.
    
    BREAKING CHANGE: `files.ls` now returns an async iterable.
    
    BREAKING CHANGE: `files.readPullStream` and `files.readReadableStream` have been removed.
    
    BREAKING CHANGE: `files.read` now returns an async iterable.
    
    BREAKING CHANGE: `files.lsPullStream` and `files.lsReadableStream` have been removed.
    
    BREAKING CHANGE: `files.ls` now returns an async iterable.
    
    BREAKING CHANGE: `files.ls` results now contain a `cid` property (whose value is a [CID instance](https://github.com/multiformats/js-cid)) instead of a `hash` property.
    
    BREAKING CHANGE: `files.ls` no longer takes a `long` option (in core) - you will receive all data by default.
    
    BREAKING CHANGE: `files.stat` result now contains a `cid` property (whose value is a [CID instance](https://github.com/multiformats/js-cid)) instead of a `hash` property.
    
    BREAKING CHANGE: `get` now returns an async iterable. The `content` property value for objects yielded from the iterator is now an async iterable that yields [`BufferList`](https://github.com/rvagg/bl) objects.
    
    BREAKING CHANGE: `stats.bw` now returns an async iterable.
    
    BREAKING CHANGE: `addFromStream` has been removed. Use `add` instead.
    
    BREAKING CHANGE: `isIPFS` is no longer exported from the client, please `npm i is-ipfs` or include the CDN script tag `<script src="https://unpkg.com/is-ipfs/dist/index.min.js"></script>` to use this utility in your applications.
    
    BREAKING CHANGE: `addFromFs` has been removed. Please use the exported `globSource` utility and pass the result to `add`. See the [glob source documentation](https://github.com/ipfs/js-ipfs-http-client#glob-source) for more details and an example.
    
    BREAKING CHANGE: `addFromURL` has been removed. Please use the exported `urlSource` utility and pass the result to `add`. See the [URL source documentation](https://github.com/ipfs/js-ipfs-http-client#url-source) for more details and an example.
    
    BREAKING CHANGE: `name.resolve` now returns an async iterable. It yields increasingly more accurate resolved values as they are discovered until the best value is selected from the quorum of 16. The "best" resolved value is the last item yielded from the iterator. If you are interested only in this best value you could use `it-last` to extract it like so:
    
    ```js
    const last = require('it-last')
    await last(ipfs.name.resolve('/ipns/QmHash'))
    ```
    
    BREAKING CHANGE: `block.rm` now returns an async iterable.
    
    BREAKING CHANGE: `block.rm` now yields objects of `{ cid: CID, error: Error }`.
    
    BREAKING CHANGE: `dht.findProvs`, `dht.provide`, `dht.put` and `dht.query` now all return an async iterable.
    
    BREAKING CHANGE: `dht.findPeer`, `dht.findProvs`, `dht.provide`, `dht.put` and `dht.query` now yield/return an object `{ id: CID, addrs: Multiaddr[] }` instead of a `PeerInfo` instance(s).
    
    BREAKING CHANGE: `refs` and `refs.local` now return an async iterable.
    
    BREAKING CHANGE: `object.data` now returns an async iterable that yields `Buffer` objects.
    
    BREAKING CHANGE: `ping` now returns an async iterable.
    
    BREAKING CHANGE: `repo.gc` now returns an async iterable.
    
    BREAKING CHANGE: `swarm.peers` now returns an array of objects with a `peer` property that is a `CID`, instead of a `PeerId` instance.
    
    BREAKING CHANGE: `swarm.addrs` now returns an array of objects `{ id: CID, addrs: Multiaddr[] }` instead of `PeerInfo` instances.
    
    BREAKING CHANGE: `block.stat` result now contains a `cid` property (whose value is a [CID instance](https://github.com/multiformats/js-cid)) instead of a `key` property.
    
    BREAKING CHANGE: `bitswap.wantlist` now returns an array of [CID](https://github.com/multiformats/js-cid) instances.
    
    BREAKING CHANGE: `bitswap.stat` result has changed - `wantlist` and `peers` values are now an array of [CID](https://github.com/multiformats/js-cid) instances.
    Alan Shaw authored Jan 23, 2020
    Configuration menu
    Copy the full SHA
    8a6bfde View commit details
    Browse the repository at this point in the history
  2. chore: update contributors

    Alan Shaw committed Jan 23, 2020
    Configuration menu
    Copy the full SHA
    e74c42f View commit details
    Browse the repository at this point in the history
  3. chore: release version v42.0.0-pre.0

    Alan Shaw committed Jan 23, 2020
    Configuration menu
    Copy the full SHA
    e9aaa75 View commit details
    Browse the repository at this point in the history

Commits on Jan 31, 2020

  1. refactor: return peer ids as strings (#1226)

    BREAKING CHANGE:
    
    Where `PeerID`s were previously [CID]s, now they are Strings
    
    - `ipfs.bitswap.stat().peers[n]` is now a String (was a CID)
    - `ipfs.dht.findPeer().id` is now a String (was a CID)
    - `ipfs.dht.findProvs()[n].id` is now a String (was a CID)
    - `ipfs.dht.provide()[n].id` is now a String (was a CID)
    - `ipfs.dht.put()[n].id` is now a String (was a CID)
    - `ipfs.dht.query()[n].id` is now a String (was a CID)
    - `ipfs.id().id` is now a String (was a CID)
    - `ipfs.id().addresses[n]` are now [Multiaddr]s (were Strings)
    achingbrain authored Jan 31, 2020
    Configuration menu
    Copy the full SHA
    2a9d765 View commit details
    Browse the repository at this point in the history
  2. chore: update bundle size

    achingbrain committed Jan 31, 2020
    Configuration menu
    Copy the full SHA
    00cdba5 View commit details
    Browse the repository at this point in the history
  3. 42.0.0-pre.1

    achingbrain committed Jan 31, 2020
    Configuration menu
    Copy the full SHA
    ddce43d View commit details
    Browse the repository at this point in the history
  4. 42.0.0-pre.2

    achingbrain committed Jan 31, 2020
    Configuration menu
    Copy the full SHA
    7d05429 View commit details
    Browse the repository at this point in the history

Commits on Feb 3, 2020

  1. fix: interface tests (#1233)

    * chore: update go-ipfs-dep
    
    * chore: build webworkers separately
    achingbrain authored Feb 3, 2020
    Configuration menu
    Copy the full SHA
    d3eee0d View commit details
    Browse the repository at this point in the history

Commits on Feb 4, 2020

  1. docs: port examples to new api (#1222)

    * fix: change name-api examples to new api
    
    * fix: change files-api example to new api
    
    * fix: change upload example to new api
    
    * fix: change bundle-webpack to support new api
    
    * fix: remove browserify example
    
    doesnt support imports
    
    * fix: change pubsub example to the new api
    
    * Update examples/bundle-webpack/src/App.js
    
    Co-Authored-By: Alan Shaw <alan.shaw@protocol.ai>
    
    * Update examples/bundle-webpack/src/App.js
    
    Co-Authored-By: Alan Shaw <alan.shaw@protocol.ai>
    
    * Update examples/files-api/files-api.js
    
    Co-Authored-By: Alan Shaw <alan.shaw@protocol.ai>
    
    * Update examples/upload-file-via-browser/src/App.js
    
    Co-Authored-By: Alan Shaw <alan.shaw@protocol.ai>
    
    * Update examples/upload-file-via-browser/src/App.js
    
    Co-Authored-By: Alan Shaw <alan.shaw@protocol.ai>
    
    Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
    hugomrdias and Alan Shaw authored Feb 4, 2020
    Configuration menu
    Copy the full SHA
    74a9147 View commit details
    Browse the repository at this point in the history
  2. chore: update contributors

    Alan Shaw committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    2e9dd9e View commit details
    Browse the repository at this point in the history
  3. chore: release version v42.0.0

    Alan Shaw committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    c20a568 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    da055df View commit details
    Browse the repository at this point in the history
  5. docs: add missing changelog

    Alan Shaw authored Feb 4, 2020
    Configuration menu
    Copy the full SHA
    69b93cc View commit details
    Browse the repository at this point in the history

Commits on Feb 11, 2020

  1. chore: update ipfsd-ctl to latest version (#1237)

    * chore: update ipfsd-ctl to latest version
    
    Also uses the same ipfsd factory for all tests.
    
    * chore: remove gh dep version
    achingbrain authored Feb 11, 2020
    Configuration menu
    Copy the full SHA
    e9ce88d View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2020

  1. Configuration menu
    Copy the full SHA
    995abb4 View commit details
    Browse the repository at this point in the history
Loading