js-ipfs 0.35.0 released

js-ipfs 0.35.0 released

Small, acyclic and flexible, just the way you like it

# 🔦 Highlights

# ✂️ Huge bundle size cuts!

One of the biggest goals for JS IPFS is to enable the distributed web in the browser. Part of that is being a good web citizen and minimising the amount of code we ship, to ensure IPFS downloads quicker, npm install's quicker, loads quicker and utilizes fewer resources. It's especially important on resource constrained mobiles and IoT devices.

The good news you want to hear is that we've now chopped around 50% off the bundle size of JS IPFS since 0.33, that's a reduction of nearly half of the code we were previously shipping! This is an amazing improvement and a great reason to upgrade.

# 🌳 DAG HTTP API

The HTTP API now has endpoints for DAG operations like get, put and resolve. Hooray! It was actually super easy so we just decided to do it spontaneously. I know, we're so zany.

On a more serious note, this brings JS IPFS another step closer to feature parity with Go IPFS. We're pushing forwards with this in every release 🚀 - stay tuned!

# 🙉 Multiple address listening for API and Gateway servers

The HTTP API and the HTTP Gateway started by your IPFS node can now listen on multiple addresses. It's a backward compatible change, all you have to do is change the value of Addresses.API or Addresses.Gateway in your JSON config file to be an array of multiaddrs (opens new window) instead of a single string multiaddr. Here's an example:

{
  "Addresses": {
    "API": ["/ip4/127.0.0.1/tcp/5001", "/ip6/::1/tcp/5002"],
    "Gateway": ["/ip4/127.0.0.1/tcp/8080", "/ip6/::1/tcp/8080"]
  }
}

DNS link (opens new window) TXT records like dnslink=/ipns/domain.com can now be recursively resolved until they hit an IPFS hash like /ipfs/QmHash. Even better, that's the new default. 👌

# 🏗 API Changes

  • CLI

    • The global flag --local was renamed to --offline
    • Added flag --enable-preload to jsipfs daemon command to allow users to enable or disable content preloading
  • Core

    • ipfs.util.isIPFS and ipfs.util.crypto have moved to static exports and should now be accessed like:

      const { isIPFS, crypto } = require('ipfs')
      
    • ipfs.types.* have moved to static exports and should now be accessed like:

      const {
        Buffer,
        CID,
        multiaddr,
        multibase,
        multihash,
        PeerId,
        PeerInfo,
      } = require('ipfs')
      
    • ipfs.resolve now supports resolving to the middle of an IPLD block instead of erroring. Given:

      b = { c: 'some value' }
      a = { b: { '/': cidOf(b) } }
      

      ipfs resolve /ipld/cidOf(a)/b/c should return /ipld/cidOf(b)/c. That is, it resolves the path as much as it can. Previously it would simply fail with an error.

    • ipfs.dns now resolves recursively by default, set the recursive options to false to prevent this behaviour

  • HTTP API

    • Added the following DAG endpoints:
      • /api/v0/dag/put
      • /api/v0/dag/get
      • /api/v0/dag/resolve

# ❤️ Huge thank you to everyone that made this release possible

In alphabetical order, here are all the humans that contributed to the release:

# 🙌🏽 Want to contribute?

Would you like to contribute to the IPFS project and don't know how? Well, there are a few places you can get started:

  • Check the issues with the help wanted label at the Ready column in our waffle board - https://waffle.io/ipfs/js-ipfs?label=help%20wanted
  • Join an IPFS All Hands, introduce yourself and let us know where you would like to contribute - https://github.com/ipfs/team-mgmt/#weekly-ipfs-all-hands
  • Hack with IPFS and show us what you made! The All Hands call is also the perfect venue for demos, join in and show us what you built
  • Join the discussion at http://discuss.ipfs.tech/ and help users finding their answers.
  • Join the ⚡️ⒿⓈ Core Dev Team Weekly Sync 🙌🏽 (opens new window) and be part of the Sprint action!

# ⁉️ Do you have questions?

The best place to ask your questions about IPFS, how it works and what you can do with it is at discuss.ipfs.tech (opens new window). We are also available at the #ipfs channel on Freenode.