Skip to content

Commit

Permalink
Compatibility table
Browse files Browse the repository at this point in the history
  • Loading branch information
cabraviva committed Apr 15, 2023
1 parent bc9ba4a commit a5e8c25
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
37 changes: 37 additions & 0 deletions COMPATIBILITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Compatibility

## This is based on caniuse tables and may not always be accurate

**Last updated: 2023-04-15**


| Browser | Supported versions | Usage of supported versions | Usage of unsupported versions | Necessary Polyfills (for supported versions) |
| ------------------------ | -------------------- | ----------------------------- | ------------------------------- | ---------------------------------------------- |
| Chrome | >33 | ~25% | 0.14% | URLSearchParams[^2] |
| Edge | >12 | ~2.6% | 0% | URLSearchParams[^2] |
| Safari (Desktop) | >7 | ~4.4% | 0.04% | URLSearchParams[^2] |
| Firefox | >29 | ~3% | 0.18% | None |
| IE | 10, 11 | 0.42% | 0.13% | Promise, URLSearchParams |
| Chrome for Android | >111[^1] | ~41% | Unknown | None |
| Safari (Mobile) | >12.1 | ~1% | 0.01% | None |
| Samsung Internet | >4 | ~2.7% | 0% | None |
| Opera Mini | None | Unknown | ~1% | None |
| Opera Mobile | 73[^1] | 0.01% | 0% | None |
| UC Browser for Android | >13.4 | 0.91% | 0% | None |
| Firefox for Android | >110[^1] | 0.3% | 0% | None |
| Android Browser | >4.4.4 | 0.25% | 0.18% | URLSearchParams[^2] |
| **Total** | Unknown | 98.4% | 1.6% | Promise on IE, URLSearchParams[^2] |

## Sources

**If you want to check something yourself or want newer info, take a look at this:**

*Only relevant sources will be included here*

[XHR2](https://caniuse.com/xhr2)
[Promise](https://caniuse.com/promises)
[URLSearchParams](https://caniuse.com/urlsearchparams)

[^1]: Previous versions are probably supported too

[^2]: Only if you wish to support legacy browsers and only when using POST requests with data
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
- 🤝 Promise based
- ➡️ Automatically parses JSON
- 👨‍💻 Splendid developer experience
- 🚀 Extremely good backwards [compatibility](https://caniuse.com/es6) (~97%)
- 🚀 Extremely good [compatibility](/COMPATIBILITY.md) (~98.4%)

# Installation
**With a module bundler:**
Expand Down
10 changes: 10 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,16 @@ type HTTPMethod = 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'PATC
}

/* @__PURE__ */ function execXHR(method: HTTPMethod, sendData: boolean, url: string, options?: RequestOptions, data?: RequestData): Promise<KnorryResponse> {
var Blib
try {
// @ts-expect-error
Blib = Blob || function () {}
} catch {
Blib = function () {}
}
// @ts-expect-error
var Blob: Blob = Blib

return new Promise(function (resolve, promiseReject) {
// Merge options
options = mergeObject((namespace().__knorry__ || {}).options || {}, options || {})
Expand Down

0 comments on commit a5e8c25

Please sign in to comment.