From d6228e687532ba690877af02e2fca8f9024127bb Mon Sep 17 00:00:00 2001 From: Amin Arria Date: Wed, 3 Feb 2021 12:18:17 -0300 Subject: [PATCH] Update browser support caveats (#2441) * Update browser support caveats - Edge 79+ supports `TextEncoder and `TextDecoder` APIs (https://caniuse.com/textencoder) - Edge 79+ and Safari 14+ supports BigInt (https://caniuse.com/bigint) * Keep sections and specify support starting on version --- guide/src/reference/browser-support.md | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/guide/src/reference/browser-support.md b/guide/src/reference/browser-support.md index 825aeb23a6e..d71abe79bdd 100644 --- a/guide/src/reference/browser-support.md +++ b/guide/src/reference/browser-support.md @@ -19,8 +19,8 @@ also like to be aware of it! an example of doing this too](../examples/wasm2js.html)). Note that at this time no bundler will do this by default, but we'd love to document plugins which do this if you are aware of one! - -* **Edge** - the `TextEncoder` and `TextDecoder` APIs are not currently + +* **Edge before 79+** - the `TextEncoder` and `TextDecoder` APIs where not available in Edge which `wasm-bindgen` uses to encode/decode strings between JS and Rust. You can polyfill this with at least one of two strategies: @@ -31,7 +31,6 @@ also like to be aware of it! ```js const webpack = require('webpack'); - module.exports = { plugins: [ new webpack.ProvidePlugin({ @@ -39,7 +38,6 @@ also like to be aware of it! TextEncoder: ['text-encoding', 'TextEncoder'] }) ] - // ... other configuration options }; ``` @@ -58,10 +56,9 @@ also like to be aware of it! forbids the usage of 64-bit integers (Rust types `i64` and `u64`) in exported/imported functions. When using `wasm-bindgen`, however, `u64` is allowed! The reason for this is that it's translated to the `BigInt` type in - JS. The `BigInt` class, however, is only currently supported in Chrome 67+ and - Firefox 68+ (as of the time of this writing) and isn't supported in Edge or - Safari, for example. For more, up-to-date details, see [`BigInt` on Can I - use...][ciu_bigint]. + JS. The `BigInt` class is supported by all major browsers starting in the + following versions: Chrome 67+, Firefox 68+, Edge 79+, and Safari 14+. + If you find other incompatibilities please report them to us! We'd love to either keep this list up-to-date or fix the underlying bugs :) @@ -72,4 +69,3 @@ either keep this list up-to-date or fix the underlying bugs :) [`text-encoding`]: https://www.npmjs.com/package/text-encoding [soq]: https://stackoverflow.com/questions/40662142/polyfill-for-textdecoder/46549188#46549188 [mdntepi]: https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder#Polyfill -[ciu_bigint]: https://caniuse.com/#feat=bigint