Skip to content

Commit 06a4777

Browse files
committed
breaking(Build): Remove the IE11 polyfills-loader.
Clear out the polyfills-loader script but keep the module for backwards compatibility. No IE11 compatibility polufills are included anymore as support for IE11 has recently really and finally dropped.
1 parent 6c8f135 commit 06a4777

File tree

3 files changed

+2
-101
lines changed

3 files changed

+2
-101
lines changed

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
"@fullcalendar/list": "^5.11.3",
1313
"@fullcalendar/luxon2": "^5.11.3",
1414
"@fullcalendar/timegrid": "^5.11.3",
15-
"@juggle/resize-observer": "^3.4.0",
1615
"@stomp/stompjs": "^6.1.2",
1716
"dompurify": "^2.4.1",
1817
"google-code-prettify": "^1.0.5",
1918
"highlight.js": "<11",
2019
"imagesloaded": "^4.1.4",
21-
"intersection-observer": "^0.12.2",
2220
"jquery": "^3.6.1",
2321
"jquery-jcrop": "^0.9.13",
2422
"luxon": "2.4.0",
@@ -30,17 +28,14 @@
3028
"pikaday": "^1.8.0",
3129
"prettier": "^2.7.1",
3230
"prismjs": "^1.29.0",
33-
"promise-polyfill": "^8.2.3",
3431
"screenfull": "^6.0.2",
3532
"select2": "^3.5.1",
3633
"showdown": "^2.1.0",
3734
"showdown-prettify": "^1.3.0",
3835
"slick-carousel": "^1.8.1",
3936
"slides": "git+https://github.com/Patternslib/slides.git",
4037
"spectrum-colorpicker": "^1.8.0",
41-
"tippy.js": "^6.3.7",
42-
"url-polyfill": "^1.1.9",
43-
"whatwg-fetch": "^3.4.0"
38+
"tippy.js": "^6.3.7"
4439
},
4540
"devDependencies": {
4641
"@patternslib/dev": "^3.1.2",

src/polyfills-loader.js

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1 @@
1-
var script_source = function () {
2-
// See: https://stackoverflow.com/a/984656/1337474
3-
var scripts = document.getElementsByTagName("script");
4-
var script = scripts[scripts.length - 1];
5-
6-
if (script.getAttribute.length !== undefined) {
7-
return script.src;
8-
}
9-
10-
// Some IE quirks
11-
return script.getAttribute("src", -1);
12-
};
13-
14-
(function () {
15-
// https://stackoverflow.com/a/8578840/1337474
16-
// if IE
17-
if (/*@cc_on!@*/ false || !!document.documentMode) {
18-
var script_url = script_source();
19-
script_url = script_url.substring(0, script_url.lastIndexOf("/")) + "/";
20-
21-
var script_tag = document.createElement("script");
22-
script_tag.type = "text/javascript";
23-
script_tag.src = script_url + "bundle-polyfills.min.js";
24-
document.getElementsByTagName("head")[0].appendChild(script_tag);
25-
}
26-
})();
1+
// BBB backwards compatibility

src/polyfills.js

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +0,0 @@
1-
// Polyfills for older browsers, most notably IE11.
2-
//
3-
// Use polyfills-loader.js before the Patternslib bundle to conditionally load
4-
// the polyfills for Internet Explorer:
5-
//
6-
// <script src="polyfills-loader.js" type="text/javascript"></script>
7-
8-
// Core JS features
9-
// You can also import individual core-js features:
10-
// import "core-js/stable/object/assign";
11-
// But we're importing them all:
12-
import "core-js/stable";
13-
14-
// Web APIs
15-
import "intersection-observer";
16-
import "promise-polyfill/src/polyfill";
17-
import "url-polyfill";
18-
import "whatwg-fetch";
19-
import { ResizeObserver as ResizeObserverPolyfill } from "@juggle/resize-observer";
20-
21-
if ("ResizeObserver" in window === false) {
22-
window.ResizeObserver = ResizeObserverPolyfill;
23-
}
24-
25-
// Node.closest polyfill
26-
// https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#polyfill
27-
if (!Element.prototype.matches) {
28-
Element.prototype.matches =
29-
Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
30-
}
31-
if (!Element.prototype.closest) {
32-
Element.prototype.closest = function (s) {
33-
var el = this;
34-
do {
35-
if (Element.prototype.matches.call(el, s)) return el;
36-
el = el.parentElement || el.parentNode;
37-
} while (el !== null && el.nodeType === 1);
38-
return null;
39-
};
40-
}
41-
// END Node.closest polyfill
42-
43-
if (!document.currentScript) {
44-
var scripts = document.getElementsByTagName("script");
45-
document.currentScript = scripts.length && scripts[scripts.length - 1];
46-
}
47-
48-
// Node.remove polyfill
49-
// From: https://developer.mozilla.org/en-US/docs/Web/API/ChildNode/remove#polyfill
50-
// From: https://github.com/jserz/js_piece/blob/master/DOM/ChildNode/remove()/remove().md
51-
(function (arr) {
52-
arr.forEach(function (item) {
53-
// eslint-disable-next-line no-prototype-builtins
54-
if (item.hasOwnProperty("remove")) {
55-
return;
56-
}
57-
Object.defineProperty(item, "remove", {
58-
configurable: true,
59-
enumerable: true,
60-
writable: true,
61-
value: function remove() {
62-
this.parentNode.removeChild(this);
63-
},
64-
});
65-
});
66-
})([Element.prototype, CharacterData.prototype, DocumentType.prototype]);
67-
// END Node.remove polyfill
68-
69-
// input.labels polyfill

0 commit comments

Comments
 (0)