Skip to content

Commit

Permalink
Update compatibility docs (#2366)
Browse files Browse the repository at this point in the history
* Update docs to reflect current ES compatibility and runtimes

* Script to keep compatibility doc in sync

* Add hook to update update compatibility docs

* Point to Sinon 9 for legacy support

* Make ESLint not complain about Prettier

* Update to latest eslint-config to align with Prettier

* Update @sinonjs/eslint-plugin-no-prototype-methods
  • Loading branch information
fatso83 committed May 11, 2021
1 parent a92ee1c commit ca16559
Show file tree
Hide file tree
Showing 5 changed files with 240 additions and 119 deletions.
13 changes: 10 additions & 3 deletions COMPATIBILITY.md
Expand Up @@ -4,13 +4,16 @@ This file is the canonical resource for compatibility goals for the libraries th

## ES2017

The source is as [ES2017][es2017] and requires no transpiler or polyfills in supporting runtimes.
Sinon has historically been written as [ES5][es5], but starting from Sinon 10 we made the breaking change to allow more modern ECMAScript versions, starting with ECMAScript [2017][es2017].
The source version is [ES2017][es2017] and requires no transpiler or polyfills in supporting runtimes.

For legacy runtimes, a transpiler can be used by dependent projects.
For legacy runtimes, a transpiler can be used by dependent projects., but use of newer APIs might break. If you need to support older browsers, have a look at Sinon 9.

## Runtimes

Sinon.JS aims at supporting the following runtimes:
Sinon.JS aims at supporting the following runtimes (from our shared [eslint-config][shared-config]).

<!-- browserslist start -->

```
> 0.5%
Expand All @@ -22,6 +25,8 @@ not op_mini all
maintained node versions
```

<!-- browserslist end -->

The compatibility is enforced using [`eslint-plugin-compat`](https://www.npmjs.com/package/eslint-plugin-compat).

To see what that means in practice, you can use https://browserslist.dev
Expand All @@ -30,4 +35,6 @@ To see what that means in practice, you can use https://browserslist.dev
<a href="https://saucelabs.com/u/sinonjs"><img src="https://saucelabs.com/browser-matrix/sinonjs.svg" alt="Sauce Test Status"></a>
</p>

[es5]: http://www.ecma-international.org/ecma-262/5.1/
[es2017]: https://262.ecma-international.org/8.0/
[shared-config]: https://github.com/sinonjs/eslint-config
26 changes: 6 additions & 20 deletions docs/release-source/release.md
Expand Up @@ -25,28 +25,14 @@ This page contains the entire Sinon.JS API documentation along with brief introd

{% include docs/migration-guides.md %}

### Compatibility
## Compatibility and supported runtimes

### ES5.1
As of Sinon 10 we stopped maintaining compatibility with legacy browsers. Instead, we focus on compatibility with evergreen browsers, [Node.js LTS versions](https://github.com/nodejs/Release) and recent Safari versions.
The most up-to-date reference on which runtimes and browsers we support can be found by looking at our [compatibility docs][compat-doc].

Sinon `{{page.release_id}}` is written as [ES5.1][es5] and requires no transpiler or polyfills to run in the runtimes listed below.

### Supported runtimes

`{{page.release_id}}` has been verified in these runtimes:

- Firefox 45
- Chrome 48
- Internet Explorer 11
- Edge 14
- Safari 9
- [Node.js LTS versions](https://github.com/nodejs/Release)

There should not be any issues with using Sinon `{{page.release_id}}` in newer versions of the same runtimes.

If you need to support very old runtimes that have incomplete support for [ES5.1][es5] you might get away with using loading [`es5-shim`][es5-shim] in your test environment.
If you need to support old runtimes you can try [Sinon 9][compat-doc-v9].

{% include docs/contribute.md %}

[es5]: http://www.ecma-international.org/ecma-262/5.1/
[es5-shim]: https://github.com/es-shims/es5-shim
[compat-doc]: https://github.com/sinonjs/sinon/COMPATIBILITY.md
[compat-doc-v9]: https://github.com/sinonjs/sinon/blob/v9.2.4/COMPATIBILITY.md

0 comments on commit ca16559

Please sign in to comment.