Skip to content

Commit acd3ed8

Browse files
committed
Remove a whole bunch of polyfills
BREAKING CHANGE: This removes a lot of polyfills, and pushes our minimum base support up
1 parent 59f866d commit acd3ed8

20 files changed

+133
-929
lines changed

docs/index.html

Lines changed: 122 additions & 332 deletions
Large diffs are not rendered by default.

src/abortsignal-abort.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/abortsignal-timeout.ts

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/array-findlast.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/array-findlastindex.ts

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/arraylike-at.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/crypto-randomuuid.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

src/event-abortsignal.ts

Lines changed: 0 additions & 48 deletions
This file was deleted.

src/form-requestsubmit.ts

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/index.ts

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,10 @@
1-
import * as abortSignalAbort from './abortsignal-abort.js'
2-
import * as abortSignalTimeout from './abortsignal-timeout.js'
3-
import * as arrayAt from './arraylike-at.js'
41
import * as clipboardItem from './clipboarditem.js'
5-
import * as cryptoRandomUUID from './crypto-randomuuid.js'
62
import * as elementCheckVisibility from './element-checkvisibility.js'
7-
import * as eventAbortSignal from './event-abortsignal.js'
83
import * as navigatorClipboard from './navigator-clipboard.js'
9-
import * as formRequestSubmit from './form-requestsubmit.js'
10-
import * as objectHasOwn from './object-hasown.js'
114
import * as requestIdleCallback from './requestidlecallback.js'
12-
import * as arrayFindLast from './array-findlast.js'
13-
import * as arrayFindLastIndex from './array-findlastindex.js'
145

156
export const baseSupport =
16-
typeof Blob === 'function' &&
17-
typeof PerformanceObserver === 'function' &&
18-
typeof Intl === 'object' &&
19-
typeof MutationObserver === 'function' &&
20-
typeof URLSearchParams === 'function' &&
21-
typeof WebSocket === 'function' &&
22-
typeof IntersectionObserver === 'function' &&
23-
typeof queueMicrotask === 'function' &&
24-
typeof TextEncoder === 'function' &&
25-
typeof TextDecoder === 'function' &&
26-
typeof customElements === 'object' &&
27-
typeof HTMLDetailsElement === 'function' &&
28-
typeof AbortController === 'function' &&
29-
typeof AbortSignal === 'function' &&
307
typeof globalThis === 'object' &&
31-
'entries' in FormData.prototype &&
32-
'toggleAttribute' in Element.prototype &&
338
// ES2019
349
'fromEntries' in Object &&
3510
'flatMap' in Array.prototype &&
@@ -41,32 +16,28 @@ export const baseSupport =
4116
'replaceAll' in String.prototype &&
4217
'any' in Promise &&
4318
// ES2022
44-
// 'at' in String.prototype && // Polyfilled
45-
// 'at' in Array.prototype && // Polyfilled
46-
// 'hasOwn' in Object && // Polyfilled
19+
'at' in String.prototype &&
20+
'at' in Array.prototype &&
21+
'hasOwn' in Object &&
4722
// ESNext
48-
// 'abort' in AbortSignal && // Polyfilled
49-
// 'timeout' in AbortSignal && // Polyfilled
23+
'abort' in AbortSignal &&
24+
'timeout' in AbortSignal &&
25+
// DOM / HTML and other specs
26+
typeof queueMicrotask === 'function' &&
27+
typeof HTMLDialogElement === 'function' &&
5028
typeof AggregateError === 'function' &&
51-
// 'randomUUID' in crypto && // Polyfilled
29+
typeof BroadcastChannel === 'function' &&
30+
'randomUUID' in crypto &&
5231
'replaceChildren' in Element.prototype &&
32+
'requestSubmit' in HTMLFormElement.prototype &&
5333
// 'requestIdleCallback' in window && // Polyfilled
5434
true
5535

5636
export const polyfills = {
57-
abortSignalAbort,
58-
abortSignalTimeout,
59-
arrayAt,
6037
clipboardItem,
61-
cryptoRandomUUID,
6238
elementCheckVisibility,
63-
eventAbortSignal,
6439
navigatorClipboard,
65-
formRequestSubmit,
66-
objectHasOwn,
6740
requestIdleCallback,
68-
arrayFindLast,
69-
arrayFindLastIndex,
7041
}
7142

7243
export function isSupported() {

src/object-hasown.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)