ipfs/js-ipfs

runtime support (Browser, Node.js versions)

daviddias opened this issue ยท 10 comments

We've been discussing which browser versions to support, what that means to our users (more browser reach, more shims, less performance, less productivity due to high maintenance cost, but also 'more' usage) and how to achieve that.

Currently, we have a set up of providing ES5 transpiled versions of our codebase, we run tests in Chrome, Firefox and PhantomJS (for ES5 tests), however, the tests that require WebRTC are not running on PhantomJS (lack of support).

So major, major concerns, questions and thoughts:

  • Current build and publish set up is confusing (thelib version)
  • Running tests also in PhantomJS is slow, slows the devs (makes CI double as expensive in terms of time
  • We need a way to communicate which browser versions we support (we have to CI tests in different browser versions)
  • There are some ES6 features that aren't available in older runtimes, even in Node.js 4
  • Can we support Node.js 6 LTS and onwards?
  • What can we do in order to support more runtimes? (Shims everywhere?)
  • What are the runtimes we want to support.

Current build and publish set up is confusing (thelib version)

Our current code base is fully compatible with Node.js 4 (as all tests are run without transpilation). So as implemented in ipfs/aegir#65 I am strongly in favour of dropping transpillation into lib for Node.js and pointing all main to src/index.js.

We need a way to communicate which browser versions we support (we have to CI tests in different browser versions)

A first pass of adding Sauce Labs tests was done in ipfs/aegir#65 this will allow us to define a set of browsers we want to support and properly test against them.

Running tests also in PhantomJS is slow, slows the devs (makes CI double as expensive in terms of time

We should really drop PhantomJS, as we have to stop running tests on it with all webcrypto modules + it really doesn't give us much benefit at this point

Can we support Node.js 6 LTS and onwards?

๐Ÿ‘

Ref: #429 in which some of these things have been discussed

Candidate updates on aegir - ipfs/aegir#65

@ipfs/js-ipfs any comments?

To sum up, this means:

  • Support from Node.js 4 LTS onwards for the time being (till it stops being LTS), with guaranteed to support Node.js 6 LTS.
  • (including the Async Crypto PR) support by default to Chrome, Firefox and Mobile Chrome, which the option of making the remaining available with some crypto shims, which need to be added as an extra.
  • No more PhantomJS
  • No more transpiled versions

According to https://nodejs.org/en/ 6 is already the official LTS version

SGTM

What David sums up in #536 (comment) makes a lot of sense ๐Ÿ‘

I believe we reached consensus :)

Closing this issue but keeping its label so that it is easy to find when we need to consider the runtimes supported again.