From c2056d42fa07a13d919d98f395e68ac7fb2c9dea Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Tue, 21 Dec 2021 16:22:32 +0000 Subject: [PATCH 1/3] Update browserslist setting to target more recent browsers --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8d038fb5..033dd325 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,9 @@ "browserslist": [ "> 1% and last 2 versions", "Firefox ESR", - "ios_saf 12", - "safari 12", - "ie 11", + "ios_saf 14", + "safari 14", + "not ie 11", "not ie_mob 11", "not android 4.4.3-4.4.4", "not OperaMini all" From cf0b1650ec5fe11ac5463c32731c66d3684512dd Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Tue, 21 Dec 2021 16:23:45 +0000 Subject: [PATCH 2/3] Remove polyfills for IE11 --- .../static/pattern_library/src/js/app.js | 5 ----- .../src/js/polyfills/closest-polyfill.js | 18 ------------------ .../src/js/polyfills/foreach-polyfill.js | 11 ----------- 3 files changed, 34 deletions(-) delete mode 100644 pattern_library/static/pattern_library/src/js/polyfills/closest-polyfill.js delete mode 100644 pattern_library/static/pattern_library/src/js/polyfills/foreach-polyfill.js diff --git a/pattern_library/static/pattern_library/src/js/app.js b/pattern_library/static/pattern_library/src/js/app.js index 07ddd5bf..4f4d7404 100644 --- a/pattern_library/static/pattern_library/src/js/app.js +++ b/pattern_library/static/pattern_library/src/js/app.js @@ -6,11 +6,6 @@ import syntaxHighlighting from './components/syntax-highlighting'; import hideMenuMobile from './components/hide-menu-mobile'; import {setIframeSize, resizeIframe} from './components/iframe'; import {toggleNav, toggleNavItems} from './components/navigation'; -import foreachPolyfill from './polyfills/foreach-polyfill'; -import closestPolyfill from './polyfills/closest-polyfill'; - -foreachPolyfill(); -closestPolyfill(); document.addEventListener('DOMContentLoaded', () => { syntaxHighlighting(); diff --git a/pattern_library/static/pattern_library/src/js/polyfills/closest-polyfill.js b/pattern_library/static/pattern_library/src/js/polyfills/closest-polyfill.js deleted file mode 100644 index b18ab303..00000000 --- a/pattern_library/static/pattern_library/src/js/polyfills/closest-polyfill.js +++ /dev/null @@ -1,18 +0,0 @@ -export default function closestPolyfill() { - // Closest polyfill see https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill - if (!Element.prototype.matches) { - Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; - } - - if (!Element.prototype.closest) { - Element.prototype.closest = function(s) { - var el = this; - - do { - if (el.matches(s)) return el; - el = el.parentElement || el.parentNode; - } while (el !== null && el.nodeType === 1); - return null; - }; - } -} \ No newline at end of file diff --git a/pattern_library/static/pattern_library/src/js/polyfills/foreach-polyfill.js b/pattern_library/static/pattern_library/src/js/polyfills/foreach-polyfill.js deleted file mode 100644 index 953f79f8..00000000 --- a/pattern_library/static/pattern_library/src/js/polyfills/foreach-polyfill.js +++ /dev/null @@ -1,11 +0,0 @@ -export default function foreachPolyfill() { - // forEach polyfill see https://developer.mozilla.org/en-US/docs/Web/API/NodeList/forEach#Polyfill - if (window.NodeList && !NodeList.prototype.forEach) { - NodeList.prototype.forEach = function (callback, thisArg) { - thisArg = thisArg || window; - for (var i = 0; i < this.length; i++) { - callback.call(thisArg, this[i], i, this); - } - }; - } -} \ No newline at end of file From be854290deba50ed7a2fc354a3348c1b7524dd32 Mon Sep 17 00:00:00 2001 From: Thibaud Colas Date: Tue, 21 Dec 2021 16:26:32 +0000 Subject: [PATCH 3/3] Mention browser support in Getting started docs --- docs/getting-started.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/getting-started.md b/docs/getting-started.md index e86e8dfc..83e58a7d 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -20,6 +20,7 @@ We support: - Django 2.2.x, 3.0.x, 3.1.x, 3.2.x, 4.0.x (experimental) - Python 3.6, 3.7, 3.8, 3.9 - Django Templates only, no Jinja support +- Modern “evergreen” desktop and mobile browsers ## Configuration