From c6ead520f226930983171d706c148122ea6352d2 Mon Sep 17 00:00:00 2001 From: Frederik Wessberg Date: Mon, 23 Jan 2023 22:03:31 +0100 Subject: [PATCH] BREAKING CHANGE: remove 'esnext' polyfills. Only stage 4 features are served --- README.md | 113 +-- package-lock.json | 73 +- package.json | 7 +- scripts/markdown-format-feature-names.ts | 6 +- scripts/tsconfig.json | 3 +- src/constant/constant.ts | 880 ++++------------------- src/polyfill/polyfill-name.ts | 98 +-- test/api/api.test.ts | 2 +- tsconfig.json | 2 +- 9 files changed, 195 insertions(+), 989 deletions(-) diff --git a/README.md b/README.md index 63d8fff..79b9af4 100644 --- a/README.md +++ b/README.md @@ -468,6 +468,9 @@ And, if you request `performance.now`, `date.now` will also be included since th - `es.array.sort` - `es.array.species` - `es.array.splice` + - `es.array.at` + - `es.array.find-last` + - `es.array.find-last-index` - **`es.array-buffer`** - `es.array-buffer.constructor` - `es.array-buffer.is-view` @@ -503,6 +506,8 @@ And, if you request `performance.now`, `date.now` will also be included since th - `es.string.trim-start` - `es.string.trim-end` - `es.string.replace-all` + - `es.string.match-all` + - `es.string.at` - **`es.regexp`** - `es.regexp.constructor` - `es.regexp.flags` @@ -600,6 +605,9 @@ And, if you request `performance.now`, `date.now` will also be included since th - `es.typed-array.uint8-clamped-array` - `es.typed-array.uint16-array` - `es.typed-array.uint32-array` + - `es.typed-array.at` + - `es.typed-array.find-last` + - `es.typed-array.find-last-index` - **`es.reflect`** - `es.reflect.apply` - `es.reflect.construct` @@ -614,103 +622,6 @@ And, if you request `performance.now`, `date.now` will also be included since th - `es.reflect.prevent-extensions` - `es.reflect.set` - `es.reflect.set-prototype-of` -- **`esnext`** - - `esnext.array` - - `esnext.collections` - - `esnext.math` - - `esnext.number` - - `esnext.object` - - `esnext.promise` - - `esnext.reflect` - - `esnext.string` - - `esnext.symbol` -- **`es2016+`** - - `esnext` -- **`esnext.array`** - - `es.array.last-index` - - `es.array.last-item` -- **`esnext.object`** -- **`esnext.collections`** - - `esnext.map` - - `esnext.weak-map` - - `esnext.set` - - `esnext.weak-set` -- **`esnext.map`** - - `es.map.every` - - `es.map.filter` - - `es.map.find` - - `es.map.find-key` - - `es.map.from` - - `es.map.group-by` - - `es.map.includes` - - `es.map.key-by` - - `es.map.key-of` - - `es.map.map-keys` - - `es.map.map-values` - - `es.map.merge` - - `es.map.of` - - `es.map.reduce` - - `es.map.some` - - `es.map.update` - - `es.map.emplace` -- **`esnext.weak-map`** - - `es.weak-map.from` - - `es.weak-map.of` -- **`esnext.set`** - - `es.set.add-all` - - `es.set.delete-all` - - `es.set.difference` - - `es.set.every` - - `es.set.filter` - - `es.set.find` - - `es.set.from` - - `es.set.intersection` - - `es.set.join` - - `es.set.map` - - `es.set.of` - - `es.set.reduce` - - `es.set.some` - - `es.set.symmetric-difference` - - `es.set.union` - - `es.set.is-disjoint-from` - - `es.set.is-subset-of` - - `es.set.is-superset-of` -- **`esnext.weak-set`** - - `es.weak-set.from` - - `es.weak-set.of` -- **`esnext.math`** - - `es.math.clamp` - - `es.math.deg-per-rad` - - `es.math.degrees` - - `es.math.fscale` - - `es.math.iaddh` - - `es.math.imulh` - - `es.math.isubh` - - `es.math.rad-per-deg` - - `es.math.radians` - - `es.math.scale` - - `es.math.signbit` - - `es.math.umulh` -- **`esnext.number`** - - `es.number.from-string` -- **`esnext.promise`** - - `es.promise.try` -- **`esnext.reflect`** - - `es.reflect.define-metadata` - - `es.reflect.delete-metadata` - - `es.reflect.get-metadata` - - `es.reflect.get-metadata-keys` - - `es.reflect.get-own-metadata` - - `es.reflect.get-own-metadata-keys` - - `es.reflect.has-metadata` - - `es.reflect.has-own-metadata` - - `es.reflect.metadata` -- **`esnext.string`** - - `es.string.at` - - `es.string.code-points` - - `es.string.match-all` -- **`esnext.symbol`** - - `es.symbol.pattern-match` - **`dom.collections.iterable`** - `dom.collections.iterator` - `dom.collections.for-each` @@ -741,13 +652,17 @@ And, if you request `performance.now`, `date.now` will also be included since th - `es.global-this` - **`adopted-style-sheets`** - `constructable-style-sheets` +- **`structuredclone`** + - `structured-clone` +- **`base64`** + - `atob` + - `btoa` - `systemjs` - `zone` - `performance.now` - `url` - `object-fit` - `console` -- `base64` - `blob` - `proxy` - `es.string.replace` @@ -773,4 +688,4 @@ And, if you request `performance.now`, `date.now` will also be included since th - `mutation-observer` - `resize-observer` - `broadcast-channel` -- `proto` +- `proto` \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index fe2636a..b067099 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,14 +32,13 @@ "@wessberg/di": "2.1.0", "@wessberg/pointer-events": "1.0.9", "@wessberg/stringutil": "1.0.19", - "Base64": "1.1.0", "blob-polyfill": "5.0.20210201", "browserslist": "4.21.4", - "browserslist-generator": "2.0.1", + "browserslist-generator": "2.0.2", "chalk": "5.2.0", "console-polyfill": "0.3.0", "construct-style-sheets-polyfill": "3.0.1", - "core-js": "3.18.0", + "core-js": "3.27.2", "crosspath": "2.0.0", "esbuild": "0.17.4", "events-polyfill": "2.1.2", @@ -4670,11 +4669,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "node_modules/Base64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/Base64/-/Base64-1.1.0.tgz", - "integrity": "sha512-qeacf8dvGpf+XAT27ESHMh7z84uRzj/ua2pQdJg483m3bEXv/kVFtDnMgvf70BQGqzbZhR9t6BmASzKvqfJf3Q==" - }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -4960,23 +4954,23 @@ } }, "node_modules/browserslist-generator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/browserslist-generator/-/browserslist-generator-2.0.1.tgz", - "integrity": "sha512-j1qOeu8E8BDdsuzQ3XEdncgLUEke+m4XaT5DHdJ1lG9+ZBaVHYOzja3kTTHv29xeg9vX1y8e2fMrUcglInMCaw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/browserslist-generator/-/browserslist-generator-2.0.2.tgz", + "integrity": "sha512-jQ0EIPx4P0k4/AF3cYuEQ49OByCAOJU5jc0ZLiw9WZlLdAkm3rxJIca+AIltAiKe4hcUMqtozsL3s+FYSs3ojQ==", "dependencies": { "@mdn/browser-compat-data": "^5.2.30", "@types/object-path": "^0.11.1", "@types/semver": "^7.3.13", "@types/ua-parser-js": "^0.7.36", "browserslist": "4.21.4", - "caniuse-lite": "^1.0.30001446", + "caniuse-lite": "^1.0.30001447", "isbot": "3.6.5", "object-path": "^0.11.8", "semver": "^7.3.8", - "ua-parser-js": "^1.0.32" + "ua-parser-js": "^1.0.33" }, "engines": { - "node": ">=14.9.0", + "node": ">=16.15.1", "npm": ">=7.0.0", "pnpm": ">=3.2.0", "yarn": ">=1.13" @@ -5109,9 +5103,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001446", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001446.tgz", - "integrity": "sha512-fEoga4PrImGcwUUGEol/PoFCSBnSkA9drgdkxXkJLsUBOnJ8rs3zDv6ApqYXGQFOyMPsjh79naWhF4DAxbF8rw==", + "version": "1.0.30001447", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001447.tgz", + "integrity": "sha512-bdKU1BQDPeEXe9A39xJnGtY0uRq/z5osrnXUw0TcK+EYno45Y+U7QU9HhHEyzvMDffpYadFXi3idnSNkcwLkTw==", "funding": [ { "type": "opencollective", @@ -5972,9 +5966,9 @@ "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, "node_modules/core-js": { - "version": "3.18.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.0.tgz", - "integrity": "sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w==", + "version": "3.27.2", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.27.2.tgz", + "integrity": "sha512-9ashVQskuh5AZEZ1JdQWp1GqSoC1e1G87MzRqg2gIfVAQ7Qn9K+uFj8EcniUFA4P2NLZfV+TOlX1SzoKfo+s7w==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -15198,9 +15192,9 @@ } }, "node_modules/ua-parser-js": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.32.tgz", - "integrity": "sha512-dXVsz3M4j+5tTiovFVyVqssXBu5HM47//YSOeZ9fQkdDKkfzv2v3PP1jmH6FUyPW+yCSn7aBVK1fGGKNhowdDA==", + "version": "1.0.33", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.33.tgz", + "integrity": "sha512-RqshF7TPTE0XLYAqmjlu5cLLuGdKrNu9O1KLA/qp39QtbZwuzwv1dT46DZSopoUMsYgXpB3Cv8a03FI8b74oFQ==", "funding": [ { "type": "opencollective", @@ -19087,11 +19081,6 @@ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, - "Base64": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/Base64/-/Base64-1.1.0.tgz", - "integrity": "sha512-qeacf8dvGpf+XAT27ESHMh7z84uRzj/ua2pQdJg483m3bEXv/kVFtDnMgvf70BQGqzbZhR9t6BmASzKvqfJf3Q==" - }, "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -19296,20 +19285,20 @@ } }, "browserslist-generator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/browserslist-generator/-/browserslist-generator-2.0.1.tgz", - "integrity": "sha512-j1qOeu8E8BDdsuzQ3XEdncgLUEke+m4XaT5DHdJ1lG9+ZBaVHYOzja3kTTHv29xeg9vX1y8e2fMrUcglInMCaw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/browserslist-generator/-/browserslist-generator-2.0.2.tgz", + "integrity": "sha512-jQ0EIPx4P0k4/AF3cYuEQ49OByCAOJU5jc0ZLiw9WZlLdAkm3rxJIca+AIltAiKe4hcUMqtozsL3s+FYSs3ojQ==", "requires": { "@mdn/browser-compat-data": "^5.2.30", "@types/object-path": "^0.11.1", "@types/semver": "^7.3.13", "@types/ua-parser-js": "^0.7.36", "browserslist": "4.21.4", - "caniuse-lite": "^1.0.30001446", + "caniuse-lite": "^1.0.30001447", "isbot": "3.6.5", "object-path": "^0.11.8", "semver": "^7.3.8", - "ua-parser-js": "^1.0.32" + "ua-parser-js": "^1.0.33" } }, "buffer": { @@ -19397,9 +19386,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001446", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001446.tgz", - "integrity": "sha512-fEoga4PrImGcwUUGEol/PoFCSBnSkA9drgdkxXkJLsUBOnJ8rs3zDv6ApqYXGQFOyMPsjh79naWhF4DAxbF8rw==" + "version": "1.0.30001447", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001447.tgz", + "integrity": "sha512-bdKU1BQDPeEXe9A39xJnGtY0uRq/z5osrnXUw0TcK+EYno45Y+U7QU9HhHEyzvMDffpYadFXi3idnSNkcwLkTw==" }, "cbor": { "version": "8.1.0", @@ -20069,9 +20058,9 @@ "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" }, "core-js": { - "version": "3.18.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.18.0.tgz", - "integrity": "sha512-WJeQqq6jOYgVgg4NrXKL0KLQhi0CT4ZOCvFL+3CQ5o7I6J8HkT5wd53EadMfqTDp1so/MT1J+w2ujhWcCJtN7w==" + "version": "3.27.2", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.27.2.tgz", + "integrity": "sha512-9ashVQskuh5AZEZ1JdQWp1GqSoC1e1G87MzRqg2gIfVAQ7Qn9K+uFj8EcniUFA4P2NLZfV+TOlX1SzoKfo+s7w==" }, "core-js-compat": { "version": "3.27.2", @@ -26903,9 +26892,9 @@ "dev": true }, "ua-parser-js": { - "version": "1.0.32", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.32.tgz", - "integrity": "sha512-dXVsz3M4j+5tTiovFVyVqssXBu5HM47//YSOeZ9fQkdDKkfzv2v3PP1jmH6FUyPW+yCSn7aBVK1fGGKNhowdDA==" + "version": "1.0.33", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.33.tgz", + "integrity": "sha512-RqshF7TPTE0XLYAqmjlu5cLLuGdKrNu9O1KLA/qp39QtbZwuzwv1dT46DZSopoUMsYgXpB3Cv8a03FI8b74oFQ==" }, "uglify-js": { "version": "3.14.2", diff --git a/package.json b/package.json index cae2688..b674fe8 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "build": "npm run rollup", "watch": "npm run rollup -- --watch", "rollup": "rollup -c rollup.config.ts --configPlugin rollup-plugin-ts", - "scripts:markdown-format-feature-names": "ts-node --project scripts/tsconfig.json scripts/markdown-format-feature-names.ts", + "scripts:markdown-format-feature-names": "ts-node-esm --project scripts/tsconfig.json scripts/markdown-format-feature-names.ts", "preversion": "npm run build", "version": "npm run generate:all && git add .", "release": "np --no-cleanup --no-yarn", @@ -94,14 +94,13 @@ "@wessberg/pointer-events": "1.0.9", "@wessberg/stringutil": "1.0.19", "lit": "2.6.1", - "Base64": "1.1.0", "blob-polyfill": "5.0.20210201", "browserslist": "4.21.4", - "browserslist-generator": "2.0.1", + "browserslist-generator": "2.0.2", "chalk": "5.2.0", "console-polyfill": "0.3.0", "construct-style-sheets-polyfill": "3.0.1", - "core-js": "3.18.0", + "core-js": "3.27.2", "crosspath": "2.0.0", "esbuild": "0.17.4", "events-polyfill": "2.1.2", diff --git a/scripts/markdown-format-feature-names.ts b/scripts/markdown-format-feature-names.ts index 1bd5968..ceee563 100644 --- a/scripts/markdown-format-feature-names.ts +++ b/scripts/markdown-format-feature-names.ts @@ -1,6 +1,6 @@ -import {constant} from "../src/constant/constant"; -import {PolyfillName} from "../src/polyfill/polyfill-name"; -import {PolyfillDictEntry} from "../src/polyfill/polyfill-dict"; +import {constant} from "../src/constant/constant.js"; +import type {PolyfillName} from "../src/polyfill/polyfill-name.js"; +import type {PolyfillDictEntry} from "../src/polyfill/polyfill-dict.js"; const seenPolyfills: Set = new Set(); diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 0c52dbe..bd1f94d 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -1,8 +1,7 @@ { "extends": "@wessberg/ts-config", "compilerOptions": { - "target": "es2017", - "module": "commonjs", + "target": "es2020", "resolveJsonModule": true } } diff --git a/src/constant/constant.ts b/src/constant/constant.ts index 7b06771..3a101c9 100644 --- a/src/constant/constant.ts +++ b/src/constant/constant.ts @@ -90,7 +90,7 @@ export const constant: IConstant = { worker: ["perfnow.js"], node: ["lib/performance-now.js"] }, - features: ["high-resolution-time"], + features: ["api.Performance.now"], dependencies: ["es.date.now"], contexts: ALL_CONTEXTS @@ -98,7 +98,7 @@ export const constant: IConstant = { url: { library: "url-polyfill", relativePaths: ["url-polyfill.js"], - features: ["url", "urlsearchparams"], + features: ["api.URL", "api.URLSearchParams"], dependencies: ["es.object.define-properties", "es.array.for-each"], contexts: ALL_CONTEXTS @@ -117,7 +117,7 @@ export const constant: IConstant = { "object-fit": { library: "@polyfiller/object-fit", relativePaths: ["polyfill/index.js"], - features: ["object-fit"], + features: ["css.properties.object-fit"], dependencies: [ "window", @@ -149,15 +149,7 @@ export const constant: IConstant = { console: { library: "console-polyfill", relativePaths: ["index.js"], - features: ["console-basic", "console-time"], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - base64: { - library: "Base64", - relativePaths: ["base64.js"], - features: ["atob-btoa"], + features: ["api.console.info", "api.console.time"], dependencies: [], contexts: ALL_CONTEXTS @@ -165,7 +157,7 @@ export const constant: IConstant = { blob: { library: "blob-polyfill", relativePaths: ["Blob.js"], - features: ["blobbuilder", "bloburls"], + features: ["api.Blob.Blob", "api.URL.createObjectURL"], dependencies: ["base64", "url"], contexts: ALL_CONTEXTS @@ -179,7 +171,7 @@ export const constant: IConstant = { "request-idle-callback": { library: "requestidlecallback", relativePaths: ["index.js"], - features: ["requestidlecallback"], + features: ["api.Window.requestIdleCallback"], dependencies: ["requestanimationframe"], contexts: WINDOW_CONTEXT @@ -187,7 +179,7 @@ export const constant: IConstant = { "request-animation-frame": { library: "requestanimationframe", relativePaths: ["app/requestAnimationFrame.js"], - features: ["requestanimationframe"], + features: ["api.Window.requestAnimationFrame"], dependencies: ["es.date.now", "performance.now"], contexts: WINDOW_CONTEXT @@ -195,7 +187,7 @@ export const constant: IConstant = { proxy: { library: "proxy-polyfill", relativePaths: ["proxy.min.js"], - features: ["proxy"], + features: ["javascript.builtins.Proxy"], dependencies: ["es"], contexts: ALL_CONTEXTS @@ -230,7 +222,7 @@ export const constant: IConstant = { "es.promise.constructor": { library: "core-js", relativePaths: ["modules/es.promise.js"], - features: ["promises"], + features: ["javascript.builtins.Promise"], dependencies: [], contexts: ALL_CONTEXTS @@ -251,15 +243,6 @@ export const constant: IConstant = { dependencies: ["es.promise.constructor"], contexts: ALL_CONTEXTS }, - "es.promise.try": { - library: "core-js", - relativePaths: ["modules/esnext.promise.try.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.promise.constructor"], - contexts: ALL_CONTEXTS - }, "es.promise.any": { library: "core-js", relativePaths: ["modules/es.promise.any.js"], @@ -348,7 +331,7 @@ export const constant: IConstant = { "es.object.values": { library: "core-js", relativePaths: ["modules/es.object.values.js"], - features: ["object-values"], + features: ["javascript.builtins.Object.values"], dependencies: [], contexts: ALL_CONTEXTS @@ -544,7 +527,10 @@ export const constant: IConstant = { "es.array.some", "es.array.sort", "es.array.species", - "es.array.splice" + "es.array.splice", + "es.array.at", + "es.array.find-last", + "es.array.find-last-index" ] }, "es.array.concat": { @@ -571,24 +557,7 @@ export const constant: IConstant = { dependencies: [], contexts: ALL_CONTEXTS }, - "es.array.last-index": { - library: "core-js", - relativePaths: ["modules/esnext.array.last-index.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.array.last-item": { - library: "core-js", - relativePaths: ["modules/esnext.array.last-item.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - dependencies: [], - contexts: ALL_CONTEXTS - }, "es.array.copy-within": { library: "core-js", relativePaths: ["modules/es.array.copy-within.js"], @@ -800,6 +769,30 @@ export const constant: IConstant = { dependencies: ["es.array-buffer.constructor"], contexts: ALL_CONTEXTS }, + "es.array.at": { + library: "core-js", + relativePaths: ["modules/es.array.at.js"], + features: ["javascript.builtins.Array.at"], + + dependencies: [], + contexts: ALL_CONTEXTS + }, + "es.array.find-last": { + library: "core-js", + relativePaths: ["modules/es.array.find-last.js"], + features: ["javascript.builtins.Array.findLast"], + + dependencies: [], + contexts: ALL_CONTEXTS + }, + "es.array.find-last-index": { + library: "core-js", + relativePaths: ["modules/es.array.find-last-index.js"], + features: ["javascript.builtins.Array.findLastIndex"], + + dependencies: [], + contexts: ALL_CONTEXTS + }, "es.string": { polyfills: [ "es.string.anchor", @@ -831,23 +824,15 @@ export const constant: IConstant = { "es.string.trim", "es.string.trim-start", "es.string.trim-end", - "es.string.replace-all" + "es.string.replace-all", + "es.string.match-all", + "es.string.at" ] }, "es.string.at": { library: "core-js", - relativePaths: ["modules/esnext.string.at.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.string.code-points": { - library: "core-js", - relativePaths: ["modules/esnext.string.code-points.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], + relativePaths: ["modules/es.string.at-alternative.js"], + features: ["javascript.builtins.String.at"], dependencies: [], contexts: ALL_CONTEXTS @@ -1151,15 +1136,7 @@ export const constant: IConstant = { "es.number.to-precision" ] }, - "es.number.from-string": { - library: "core-js", - relativePaths: ["modules/esnext.number.from-string.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - dependencies: [], - contexts: ALL_CONTEXTS - }, "es.number.constructor": { library: "core-js", relativePaths: ["modules/es.number.constructor.js"], @@ -1277,114 +1254,6 @@ export const constant: IConstant = { "es.math.trunc" ] }, - "es.math.clamp": { - library: "core-js", - relativePaths: ["modules/esnext.math.clamp.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.math.deg-per-rad": { - library: "core-js", - relativePaths: ["modules/esnext.math.deg-per-rad.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.math.degrees": { - library: "core-js", - relativePaths: ["modules/esnext.math.degrees.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.math.fscale": { - library: "core-js", - relativePaths: ["modules/esnext.math.fscale.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.math.iaddh": { - library: "core-js", - relativePaths: ["modules/esnext.math.iaddh.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.math.imulh": { - library: "core-js", - relativePaths: ["modules/esnext.math.imulh.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.math.isubh": { - library: "core-js", - relativePaths: ["modules/esnext.math.isubh.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.math.rad-per-deg": { - library: "core-js", - relativePaths: ["modules/esnext.math.rad-per-deg.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.math.radians": { - library: "core-js", - relativePaths: ["modules/esnext.math.radians.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.math.scale": { - library: "core-js", - relativePaths: ["modules/esnext.math.scale.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.math.signbit": { - library: "core-js", - relativePaths: ["modules/esnext.math.signbit.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.math.umulh": { - library: "core-js", - relativePaths: ["modules/esnext.math.umulh.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, "es.math.acosh": { library: "core-js", relativePaths: ["modules/es.math.acosh.js"], @@ -1599,15 +1468,6 @@ export const constant: IConstant = { dependencies: ["es.symbol.constructor"], contexts: ALL_CONTEXTS }, - "es.symbol.pattern-match": { - library: "core-js", - relativePaths: ["modules/esnext.symbol.pattern-match.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.symbol.constructor"], - contexts: ALL_CONTEXTS - }, "es.symbol.constructor": { library: "core-js", relativePaths: ["modules/es.symbol.js"], @@ -1731,159 +1591,6 @@ export const constant: IConstant = { dependencies: [], contexts: ALL_CONTEXTS }, - "es.map.every": { - library: "core-js", - relativePaths: ["modules/esnext.map.every.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.filter": { - library: "core-js", - relativePaths: ["modules/esnext.map.filter.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.find": { - library: "core-js", - relativePaths: ["modules/esnext.map.find.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.find-key": { - library: "core-js", - relativePaths: ["modules/esnext.map.find-key.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.from": { - library: "core-js", - relativePaths: ["modules/esnext.map.from.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.group-by": { - library: "core-js", - relativePaths: ["modules/esnext.map.group-by.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.includes": { - library: "core-js", - relativePaths: ["modules/esnext.map.includes.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.key-by": { - library: "core-js", - relativePaths: ["modules/esnext.map.key-by.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.key-of": { - library: "core-js", - relativePaths: ["modules/esnext.map.key-of.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.map-keys": { - library: "core-js", - relativePaths: ["modules/esnext.map.map-keys.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.map-values": { - library: "core-js", - relativePaths: ["modules/esnext.map.map-values.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.merge": { - library: "core-js", - relativePaths: ["modules/esnext.map.merge.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.of": { - library: "core-js", - relativePaths: ["modules/esnext.map.of.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.reduce": { - library: "core-js", - relativePaths: ["modules/esnext.map.reduce.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.some": { - library: "core-js", - relativePaths: ["modules/esnext.map.some.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.update": { - library: "core-js", - relativePaths: ["modules/esnext.map.update.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, - "es.map.emplace": { - library: "core-js", - relativePaths: ["modules/esnext.map.emplace.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.map"], - contexts: ALL_CONTEXTS - }, "es.weak-map": { library: "core-js", relativePaths: ["modules/es.weak-map.js"], @@ -1892,24 +1599,6 @@ export const constant: IConstant = { dependencies: [], contexts: ALL_CONTEXTS }, - "es.weak-map.from": { - library: "core-js", - relativePaths: ["modules/esnext.weak-map.from.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.weak-map"], - contexts: ALL_CONTEXTS - }, - "es.weak-map.of": { - library: "core-js", - relativePaths: ["modules/esnext.weak-map.of.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.weak-map"], - contexts: ALL_CONTEXTS - }, "es.set": { library: "core-js", relativePaths: ["modules/es.set.js"], @@ -1918,168 +1607,6 @@ export const constant: IConstant = { dependencies: [], contexts: ALL_CONTEXTS }, - "es.set.add-all": { - library: "core-js", - relativePaths: ["modules/esnext.set.add-all.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.delete-all": { - library: "core-js", - relativePaths: ["modules/esnext.set.delete-all.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.difference": { - library: "core-js", - relativePaths: ["modules/esnext.set.difference.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.every": { - library: "core-js", - relativePaths: ["modules/esnext.set.every.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.filter": { - library: "core-js", - relativePaths: ["modules/esnext.set.filter.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.find": { - library: "core-js", - relativePaths: ["modules/esnext.set.find.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.from": { - library: "core-js", - relativePaths: ["modules/esnext.set.from.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.intersection": { - library: "core-js", - relativePaths: ["modules/esnext.set.intersection.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.join": { - library: "core-js", - relativePaths: ["modules/esnext.set.join.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.map": { - library: "core-js", - relativePaths: ["modules/esnext.set.map.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.of": { - library: "core-js", - relativePaths: ["modules/esnext.set.of.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.reduce": { - library: "core-js", - relativePaths: ["modules/esnext.set.reduce.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.some": { - library: "core-js", - relativePaths: ["modules/esnext.set.some.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.symmetric-difference": { - library: "core-js", - relativePaths: ["modules/esnext.set.symmetric-difference.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.union": { - library: "core-js", - relativePaths: ["modules/esnext.set.union.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.is-disjoint-from": { - library: "core-js", - relativePaths: ["modules/esnext.set.is-disjoint-from.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.is-subset-of": { - library: "core-js", - relativePaths: ["modules/esnext.set.is-subset-of.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, - "es.set.is-superset-of": { - library: "core-js", - relativePaths: ["modules/esnext.set.is-superset-of.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.set"], - contexts: ALL_CONTEXTS - }, "es.weak-set": { library: "core-js", relativePaths: ["modules/es.weak-set.js"], @@ -2088,24 +1615,6 @@ export const constant: IConstant = { dependencies: [], contexts: ALL_CONTEXTS }, - "es.weak-set.from": { - library: "core-js", - relativePaths: ["modules/esnext.weak-set.from.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.weak-set"], - contexts: ALL_CONTEXTS - }, - "es.weak-set.of": { - library: "core-js", - relativePaths: ["modules/esnext.weak-set.of.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: ["es.weak-set"], - contexts: ALL_CONTEXTS - }, "es.typed-array": { polyfills: [ "es.typed-array.copy-within", @@ -2141,7 +1650,10 @@ export const constant: IConstant = { "es.typed-array.uint8-array", "es.typed-array.uint8-clamped-array", "es.typed-array.uint16-array", - "es.typed-array.uint32-array" + "es.typed-array.uint32-array", + "es.typed-array.at", + "es.typed-array.find-last", + "es.typed-array.find-last-index" ] }, "es.typed-array.copy-within": { @@ -2416,6 +1928,30 @@ export const constant: IConstant = { dependencies: [], contexts: ALL_CONTEXTS }, + "es.typed-array.at": { + library: "core-js", + relativePaths: ["modules/es.typed-array.at.js"], + features: ["javascript.builtins.TypedArray.at"], + + dependencies: [], + contexts: ALL_CONTEXTS + }, + "es.typed-array.find-last": { + library: "core-js", + relativePaths: ["modules/es.typed-array.find-last.js"], + features: ["javascript.builtins.TypedArray.findLast"], + + dependencies: [], + contexts: ALL_CONTEXTS + }, + "es.typed-array.find-last-index": { + library: "core-js", + relativePaths: ["modules/es.typed-array.find-last-index.js"], + features: ["javascript.builtins.TypedArray.findLastIndex"], + + dependencies: [], + contexts: ALL_CONTEXTS + }, "es.reflect": { polyfills: [ "es.reflect.apply", @@ -2433,88 +1969,6 @@ export const constant: IConstant = { "es.reflect.set-prototype-of" ] }, - - "es.reflect.define-metadata": { - library: "core-js", - relativePaths: ["modules/esnext.reflect.define-metadata.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.reflect.delete-metadata": { - library: "core-js", - relativePaths: ["modules/esnext.reflect.delete-metadata.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.reflect.get-metadata": { - library: "core-js", - relativePaths: ["modules/esnext.reflect.get-metadata.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.reflect.get-metadata-keys": { - library: "core-js", - relativePaths: ["modules/esnext.reflect.get-metadata-keys.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.reflect.get-own-metadata": { - library: "core-js", - relativePaths: ["modules/esnext.reflect.get-own-metadata.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.reflect.get-own-metadata-keys": { - library: "core-js", - relativePaths: ["modules/esnext.reflect.get-own-metadata-keys.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.reflect.has-metadata": { - library: "core-js", - relativePaths: ["modules/esnext.reflect.has-metadata.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.reflect.has-own-metadata": { - library: "core-js", - relativePaths: ["modules/esnext.reflect.has-own-metadata.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, - "es.reflect.metadata": { - library: "core-js", - relativePaths: ["modules/esnext.reflect.metadata.js"], - // TODO: Update when MDN or Caniuse Compatibility is added - features: [], - - dependencies: [], - contexts: ALL_CONTEXTS - }, "es.reflect.apply": { library: "core-js", relativePaths: ["modules/es.reflect.apply.js"], @@ -2619,112 +2073,6 @@ export const constant: IConstant = { dependencies: ["proto"], contexts: ALL_CONTEXTS }, - esnext: { - polyfills: ["esnext.array", "esnext.collections", "esnext.math", "esnext.number", "esnext.object", "esnext.promise", "esnext.reflect", "esnext.string", "esnext.symbol"] - }, - // An alias for the alias 'esnext' - "es2016+": { - polyfills: ["esnext"] - }, - "esnext.array": { - polyfills: ["es.array.last-index", "es.array.last-item"] - }, - "esnext.object": { - polyfills: [] - }, - "esnext.collections": { - polyfills: ["esnext.map", "esnext.weak-map", "esnext.set", "esnext.weak-set"] - }, - "esnext.map": { - polyfills: [ - "es.map.every", - "es.map.filter", - "es.map.find", - "es.map.find-key", - "es.map.from", - "es.map.group-by", - "es.map.includes", - "es.map.key-by", - "es.map.key-of", - "es.map.map-keys", - "es.map.map-values", - "es.map.merge", - "es.map.of", - "es.map.reduce", - "es.map.some", - "es.map.update", - "es.map.emplace" - ] - }, - "esnext.weak-map": { - polyfills: ["es.weak-map.from", "es.weak-map.of"] - }, - "esnext.set": { - polyfills: [ - "es.set.add-all", - "es.set.delete-all", - "es.set.difference", - "es.set.every", - "es.set.filter", - "es.set.find", - "es.set.from", - "es.set.intersection", - "es.set.join", - "es.set.map", - "es.set.of", - "es.set.reduce", - "es.set.some", - "es.set.symmetric-difference", - "es.set.union", - "es.set.is-disjoint-from", - "es.set.is-subset-of", - "es.set.is-superset-of" - ] - }, - "esnext.weak-set": { - polyfills: ["es.weak-set.from", "es.weak-set.of"] - }, - "esnext.math": { - polyfills: [ - "es.math.clamp", - "es.math.deg-per-rad", - "es.math.degrees", - "es.math.fscale", - "es.math.iaddh", - "es.math.imulh", - "es.math.isubh", - "es.math.rad-per-deg", - "es.math.radians", - "es.math.scale", - "es.math.signbit", - "es.math.umulh" - ] - }, - "esnext.number": { - polyfills: ["es.number.from-string"] - }, - "esnext.promise": { - polyfills: ["es.promise.try"] - }, - "esnext.reflect": { - polyfills: [ - "es.reflect.define-metadata", - "es.reflect.delete-metadata", - "es.reflect.get-metadata", - "es.reflect.get-metadata-keys", - "es.reflect.get-own-metadata", - "es.reflect.get-own-metadata-keys", - "es.reflect.has-metadata", - "es.reflect.has-own-metadata", - "es.reflect.metadata" - ] - }, - "esnext.string": { - polyfills: ["es.string.at", "es.string.code-points", "es.string.match-all"] - }, - "esnext.symbol": { - polyfills: ["es.symbol.pattern-match"] - }, "es.global-this": { library: "core-js", relativePaths: ["modules/es.global-this.js"], @@ -2756,7 +2104,7 @@ export const constant: IConstant = { "pointer-event": { library: "@wessberg/pointer-events", relativePaths: ["dist/index.js"], - features: ["pointer"], + features: ["css.properties.pointer-events"], dependencies: [ // TODO: Also relies on "elementFromPoint" which there isn't a polyfill for yet. Add it to the dependencies when the polyfill is ready @@ -2778,14 +2126,14 @@ export const constant: IConstant = { xhr: { library: "xhr-polyfill", relativePaths: ["dist/xhr-polyfill.js"], - features: ["xhr2"], + features: ["api.XMLHttpRequest"], dependencies: [], contexts: WINDOW_CONTEXT }, fetch: { localPaths: ["polyfill-lib/fetch/fetch.js"], - features: ["fetch"], + features: ["api.fetch"], version: "1.0.0", dependencies: ["es.array.for-each", "es.object.get-own-property-names", "es.promise", "xhr"], contexts: WINDOW_CONTEXT @@ -3009,7 +2357,7 @@ export const constant: IConstant = { "web-animations": { library: "web-animations-js", relativePaths: ["web-animations.min.js"], - features: ["web-animation"], + features: ["api.Element.animate"], dependencies: ["element", "requestanimationframe"], contexts: WINDOW_CONTEXT @@ -3025,7 +2373,7 @@ export const constant: IConstant = { template: { library: "@webcomponents/template", relativePaths: ["template.js"], - features: ["template"], + features: ["html.elements.template"], dependencies: ["es"], contexts: WINDOW_CONTEXT @@ -3036,7 +2384,7 @@ export const constant: IConstant = { "custom-elements": { library: "@webcomponents/custom-elements", relativePaths: ["src/custom-elements.js"], - features: ["custom-elementsv1"], + features: ["api.CustomElementRegistry"], dependencies: ["es", "mutation-observer"], contexts: WINDOW_CONTEXT @@ -3056,7 +2404,7 @@ export const constant: IConstant = { ], lit: ["node_modules/lit/polyfill-support.js"] }, - features: ["shadowdomv1"], + features: ["api.ShadowRoot"], version: pkg.dependencies["@webcomponents/shadydom"], dependencies: ["es", "template", "mutation-observer", "event", "node.contains", "queryselector"], contexts: WINDOW_CONTEXT, @@ -3065,22 +2413,21 @@ export const constant: IConstant = { queryselector: { library: "polyfill-library", relativePaths: ["polyfills/__dist/document.querySelector/raw.js"], - features: ["queryselector"], + features: ["api.Document.querySelector"], dependencies: ["element", "document", "document-fragment"], contexts: WINDOW_CONTEXT }, "document-fragment": { library: "polyfill-library", relativePaths: ["polyfills/__dist/DocumentFragment/raw.js"], - features: ["queryselector"], + features: ["api.DocumentFragment"], dependencies: [], contexts: WINDOW_CONTEXT }, "node.parentelement": { library: "node.parentelement", relativePaths: ["polyfill.js"], - // If 'addEventListener' isn't found, the Window interface shouldn't exist on the window - features: ["addeventlistener"], + features: ["api.Node.parentElement"], dependencies: ["document"], contexts: WINDOW_CONTEXT @@ -3088,7 +2435,7 @@ export const constant: IConstant = { "scroll-behavior": { library: "scroll-behavior-polyfill", relativePaths: ["dist/index.js"], - features: ["css-scroll-behavior", "scrollintoview"], + features: ["css.properties.scroll-behavior", "api.Element.scrollIntoView"], dependencies: ["es.object.define-property", "es.object.get-own-property-descriptor", "requestanimationframe"], contexts: WINDOW_CONTEXT @@ -3096,30 +2443,28 @@ export const constant: IConstant = { "focus-visible": { library: "focus-visible", relativePaths: ["dist/focus-visible.js"], - features: ["css-focus-visible"], + features: ["css.selectors.focus-visible"], dependencies: ["class-list"], contexts: WINDOW_CONTEXT }, "node.contains": { library: "polyfill-library", relativePaths: ["polyfills/__dist/Node.prototype.contains/raw.js"], - // If 'addEventListener' isn't found, the Window interface shouldn't exist on the window - features: ["addeventlistener"], + features: ["api.Node.contains"], dependencies: ["element"], contexts: WINDOW_CONTEXT }, window: { library: "polyfill-library", relativePaths: ["polyfills/__dist/Window/raw.js"], - features: ["addeventlistener"], + features: ["api.Window"], dependencies: [], contexts: WINDOW_CONTEXT }, document: { library: "polyfill-library", relativePaths: ["polyfills/__dist/document/raw.js"], - // If 'addEventListener' isn't found, the Document interface shouldn't exist on the window - features: ["addeventlistener"], + features: ["api.Document"], dependencies: [], contexts: WINDOW_CONTEXT }, @@ -3140,8 +2485,7 @@ export const constant: IConstant = { element: { library: "polyfill-library", relativePaths: ["polyfills/__dist/Element/raw.js"], - // If 'addEventListener' isn't found, the Element interface shouldn't exist on the window - features: ["addeventlistener"], + features: ["api.Element"], dependencies: ["document"], contexts: WINDOW_CONTEXT @@ -3160,7 +2504,7 @@ export const constant: IConstant = { "event.focusin": { library: "polyfill-library", relativePaths: ["polyfills/__dist/Event.focusin/raw.js"], - features: ["focusin-focusout-events"], + features: ["api.Element.focusin_event"], dependencies: ["event.constructor"], contexts: WINDOW_CONTEXT @@ -3168,7 +2512,7 @@ export const constant: IConstant = { "event.hashchange": { library: "polyfill-library", relativePaths: ["polyfills/__dist/Event.hashchange/raw.js"], - features: ["hashchange"], + features: ["api.Window.hashchange_event"], dependencies: ["event.constructor"], contexts: WINDOW_CONTEXT @@ -3176,7 +2520,7 @@ export const constant: IConstant = { "custom-event": { library: "polyfill-library", relativePaths: ["polyfills/__dist/CustomEvent/raw.js"], - features: ["customevent"], + features: ["api.CustomEvent", "api.CustomEvent.CustomEvent"], dependencies: ["event"], contexts: WINDOW_CONTEXT @@ -3184,7 +2528,7 @@ export const constant: IConstant = { "event-source": { library: "polyfill-library", relativePaths: ["polyfills/__dist/EventSource/raw.js"], - features: ["eventsource"], + features: ["api.EventSource"], dependencies: [], contexts: WINDOW_CONTEXT @@ -3192,7 +2536,7 @@ export const constant: IConstant = { "get-computed-style": { library: "polyfill-library", relativePaths: ["polyfills/__dist/getComputedStyle/raw.js"], - features: ["getcomputedstyle"], + features: ["api.Window.getComputedStyle"], dependencies: ["window"], contexts: WINDOW_CONTEXT @@ -3200,7 +2544,7 @@ export const constant: IConstant = { "intersection-observer": { library: "intersection-observer", relativePaths: ["intersection-observer.js"], - features: ["intersectionobserver"], + features: ["api.IntersectionObserver"], dependencies: [ "get-computed-style", @@ -3219,21 +2563,21 @@ export const constant: IConstant = { "mutation-observer": { library: "mutationobserver-shim", relativePaths: ["dist/mutationobserver.min.js"], - features: ["mutationobserver"], + features: ["api.MutationObserver"], dependencies: [], contexts: WINDOW_CONTEXT }, "resize-observer": { localPaths: ["polyfill-lib/resize-observer/resize-observer.js"], - features: ["resizeobserver"], + features: ["api.ResizeObserver"], version: "1.0.0", dependencies: ["es.weak-map", "es.object.create", "mutation-observer", "get-computed-style", "requestanimationframe"], contexts: WINDOW_CONTEXT }, "broadcast-channel": { localPaths: ["polyfill-lib/broadcast-channel/broadcast-channel.js"], - features: ["broadcastchannel"], + features: ["api.BroadcastChannel"], version: "1.0.0", dependencies: [], contexts: WINDOW_CONTEXT @@ -3244,7 +2588,7 @@ export const constant: IConstant = { "set-immediate": { library: "setimmediate", relativePaths: ["setImmediate.js"], - features: ["setimmediate"], + features: ["api.Window.setImmediate"], dependencies: [], contexts: ALL_CONTEXTS @@ -3274,6 +2618,36 @@ export const constant: IConstant = { version: "1.0.0", dependencies: [], contexts: ALL_CONTEXTS + }, + "structured-clone": { + library: "core-js", + relativePaths: ["modules/web.structured-clone.js"], + features: ["api.structuredClone"], + + dependencies: [], + contexts: ALL_CONTEXTS + }, + structuredclone: { + polyfills: ["structured-clone"] + }, + atob: { + library: "core-js", + relativePaths: ["modules/web.atob.js"], + features: ["api.atob"], + + dependencies: [], + contexts: ALL_CONTEXTS + }, + btoa: { + library: "core-js", + relativePaths: ["modules/web.btoa.js"], + features: ["api.btoa"], + + dependencies: [], + contexts: ALL_CONTEXTS + }, + base64: { + polyfills: ["atob", "btoa"] } } }; diff --git a/src/polyfill/polyfill-name.ts b/src/polyfill/polyfill-name.ts index e9b147a..380bf55 100644 --- a/src/polyfill/polyfill-name.ts +++ b/src/polyfill/polyfill-name.ts @@ -16,21 +16,6 @@ export declare type PolyfillName = | "es.collections" | "es.typed-array" | "es.reflect" - | "esnext" - | "es2016+" - | "esnext.array" - | "esnext.collections" - | "esnext.math" - | "esnext.number" - | "esnext.promise" - | "esnext.object" - | "esnext.reflect" - | "esnext.string" - | "esnext.symbol" - | "esnext.map" - | "esnext.weak-map" - | "esnext.set" - | "esnext.weak-set" | "event" | "dom.collections.iterable" | "web-components" @@ -42,7 +27,9 @@ export declare type PolyfillName = | "formdata" | "adopted-style-sheets" | "global-this" - | "globalthis"; + | "globalthis" + | "structuredclone" + | "base64"; export declare type PolyfillDealiasedName = | "es.object.assign" @@ -75,8 +62,6 @@ export declare type PolyfillDealiasedName = | "es.array.concat" | "es.array.flat" | "es.array.flat-map" - | "es.array.last-index" - | "es.array.last-item" | "es.array.copy-within" | "es.array.every" | "es.array.fill" @@ -100,11 +85,13 @@ export declare type PolyfillDealiasedName = | "es.array.splice" | "es.array.species" | "es.array.includes" + | "es.array.at" + | "es.array.find-last" + | "es.array.find-last-index" | "es.array-buffer.constructor" | "es.array-buffer.is-view" | "es.array-buffer.slice" | "es.string.at" - | "es.string.code-points" | "es.string.match-all" | "es.string.replace-all" | "es.string.trim-start" @@ -137,6 +124,7 @@ export declare type PolyfillDealiasedName = | "es.string.sub" | "es.string.sup" | "es.string.trim" + | "es.string.at" | "es.regexp.constructor" | "es.regexp.flags" | "es.regexp.to-string" @@ -152,50 +140,10 @@ export declare type PolyfillDealiasedName = | "es.number.parse-int" | "es.number.to-fixed" | "es.number.to-precision" - | "es.number.from-string" | "es.map" - | "es.map.every" - | "es.map.filter" - | "es.map.find" - | "es.map.find-key" - | "es.map.from" - | "es.map.group-by" - | "es.map.includes" - | "es.map.key-by" - | "es.map.key-of" - | "es.map.map-keys" - | "es.map.map-values" - | "es.map.merge" - | "es.map.of" - | "es.map.reduce" - | "es.map.some" - | "es.map.update" - | "es.map.emplace" | "es.weak-map" - | "es.weak-map.from" - | "es.weak-map.of" | "es.set" - | "es.set.add-all" - | "es.set.delete-all" - | "es.set.difference" - | "es.set.every" - | "es.set.filter" - | "es.set.find" - | "es.set.from" - | "es.set.intersection" - | "es.set.join" - | "es.set.map" - | "es.set.of" - | "es.set.reduce" - | "es.set.some" - | "es.set.symmetric-difference" - | "es.set.union" - | "es.set.is-disjoint-from" - | "es.set.is-subset-of" - | "es.set.is-superset-of" | "es.weak-set" - | "es.weak-set.from" - | "es.weak-set.of" | "es.math.acosh" | "es.math.asinh" | "es.math.atanh" @@ -213,18 +161,6 @@ export declare type PolyfillDealiasedName = | "es.math.sinh" | "es.math.tanh" | "es.math.trunc" - | "es.math.clamp" - | "es.math.deg-per-rad" - | "es.math.degrees" - | "es.math.fscale" - | "es.math.iaddh" - | "es.math.imulh" - | "es.math.isubh" - | "es.math.rad-per-deg" - | "es.math.radians" - | "es.math.scale" - | "es.math.signbit" - | "es.math.umulh" | "es.data-view" | "es.date.now" | "es.date.to-iso-string" @@ -234,7 +170,6 @@ export declare type PolyfillDealiasedName = | "es.promise.finally" | "es.promise.constructor" | "es.promise.all-settled" - | "es.promise.try" | "es.promise.any" | "es.symbol.constructor" | "es.symbol.async-iterator" @@ -251,7 +186,6 @@ export declare type PolyfillDealiasedName = | "es.symbol.to-string-tag" | "es.symbol.unscopables" | "es.symbol.description" - | "es.symbol.pattern-match" | "es.typed-array.copy-within" | "es.typed-array.every" | "es.typed-array.fill" @@ -286,6 +220,9 @@ export declare type PolyfillDealiasedName = | "es.typed-array.uint8-clamped-array" | "es.typed-array.uint16-array" | "es.typed-array.uint32-array" + | "es.typed-array.at" + | "es.typed-array.find-last" + | "es.typed-array.find-last-index" | "es.reflect.apply" | "es.reflect.construct" | "es.reflect.define-property" @@ -299,22 +236,12 @@ export declare type PolyfillDealiasedName = | "es.reflect.prevent-extensions" | "es.reflect.set" | "es.reflect.set-prototype-of" - | "es.reflect.define-metadata" - | "es.reflect.delete-metadata" - | "es.reflect.get-metadata" - | "es.reflect.get-metadata-keys" - | "es.reflect.get-own-metadata" - | "es.reflect.get-own-metadata-keys" - | "es.reflect.has-metadata" - | "es.reflect.has-own-metadata" - | "es.reflect.metadata" | "es.global-this" | "regenerator-runtime" | "systemjs" | "performance.now" | "blob" | "url" - | "base64" | "xhr" | "dom.collections.iterator" | "dom.collections.for-each" @@ -362,4 +289,7 @@ export declare type PolyfillDealiasedName = | "form-data" | "constructable-style-sheets" | "proto" - | "focus-visible"; + | "focus-visible" + | "structured-clone" + | "atob" + | "btoa"; diff --git a/test/api/api.test.ts b/test/api/api.test.ts index 42086dc..083b1a3 100644 --- a/test/api/api.test.ts +++ b/test/api/api.test.ts @@ -160,7 +160,7 @@ test("Is able to generate a bundle of every available polyfill", async t => { test("Will generate correct polyfills for IE11. #1", async t => { const result = await sendRequest({ - path: `${constant.endpoint.polyfill}?features=web-components,es,class-list,systemjs|variant=system,custom-event,url,fetch,object-fit,intersection-observer,animation,regenerator-runtime,requestanimationframe,requestidlecallback,resize-observer,pointer-event,dom.collections.iterable,scroll-behavior,zone|error|shadydom,esnext.reflect,intl|force|locale=en~da`, + path: `${constant.endpoint.polyfill}?features=web-components,es,class-list,systemjs|variant=system,custom-event,url,fetch,object-fit,intersection-observer,animation,regenerator-runtime,requestanimationframe,requestidlecallback,resize-observer,pointer-event,dom.collections.iterable,scroll-behavior,zone|error|shadydom.reflect,intl|force|locale=en~da`, headers: { "User-Agent": ie("11") } diff --git a/tsconfig.json b/tsconfig.json index 203f2eb..1d918b5 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "di": { "identifier": "container" }, - "include": ["src/**/*.*", "test/**/*.*", "rollup.config.ts"], + "include": ["src/**/*.*", "test/**/*.*", "rollup.config.ts", "scripts/markdown-format-feature-names.ts"], "extends": "@wessberg/ts-config", "compilerOptions": { "target": "es2020",