Skip to content

Commit

Permalink
refactor: Drop IE11 support
Browse files Browse the repository at this point in the history
Description:

Remove the full version of the polyfill for ESL UI site renderer
Remove shims and targets =ES5 in the site codebase
Remove ES5-related OOTB ESL polyfills except es5-target-shim.ts
Drop support for IE11 and ES5 target

BREAKING CHANGES:

ESL UI site renderer and ESL polyfills no longer support IE11 and ES5 target.
  • Loading branch information
HenadzV authored and ala-n committed Mar 17, 2023
1 parent 1c402eb commit 6d376ee
Show file tree
Hide file tree
Showing 25 changed files with 5 additions and 750 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ to meet your project needs.

ESL is based solely on Web API and ECMAScript 6 features, which let our web UI components library work
well across all modern browsers such as Firefox, Chrome, Safari, Opera, and Edge.
ESL can also work on IE11 when the whole list of polyfills is provided (see [Browser support & Polyfills](https://github.com/exadel-inc/esl/blob/HEAD/docs/BROWSER_SUPPORT.md) for more details).

## Library Structure

Expand Down
22 changes: 0 additions & 22 deletions docs/BROWSER_SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,6 @@
Exadel Smart Library does not have dependencies but uses the following list of native browser features:

- ECMAScript 6 features
- [Array.from](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/from) (no Iterable Objects support required)
([ESL polyfill](../src/polyfills/list/es6.array.from.ts) provided)
- [Array.prototype.find](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find)
([ESL polyfill](../src/polyfills/list/es6.array.find.ts) provided)
- [Array.prototype.findIndex](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex)
([ESL polyfill](../src/polyfills/list/es6.array.find.ts) provided)
- [Array.prototype.include](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes)
([ESL polyfill](../src/polyfills/list/es6.array.includes.ts) provided)
- [Object.is](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
([ESL polyfill](../src/polyfills/list/es6.object.is.ts) provided)
- [Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) (accurate polyfill required)
([ESL polyfill](../src/polyfills/list/es6.object.assign.ts) provided)
- [ES6 Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)
- Web API
- [Event](https://developer.mozilla.org/en-US/docs/Web/API/Event) constructor + `preventDefault` polyfill
Expand All @@ -34,20 +22,10 @@ All of them are fully supported by modern browsers such as Chrome, Firefox, Safa

In order to make ESL work in older browsers, you can use a "light" polyfills list of IntersectionObserver, ResizeObserver and Custom Elements (for older versions of Edge and Safari).

Or make the library work in IE11 or Edge (<14) by using the "full" polyfills list provided.

See more details on what polyfill approach might look like in the demo pages source code.

Also, ESL has built-in polyfills for some of DOM and ES6 features. They are available under [polyfills](../src/polyfills) directory:
- ECMA Script 5: output shim (`HTMLElement` constructor call) - [es5-target-shim.ts](../src/polyfills/es5-target-shim.ts)
- ECMA Script 5: IE11, Edge <14 support - [polyfills.es5.ts](../src/polyfills/polyfills.es5.ts)
- `Object.is`, `Object.assign`
- `Array.from`, `Array.prototype.find`, `Array.prototype.findIndex`, `Array.prototype.index`
- `Event`, `CustomEvent`, `MouseEvent`, `KeyboardEvent`, `FocusEvent` shim
- `Event.prototype.preventDefault` shim
- `Element.prototype.closest`
- `DOMTokenList.prototype.toggle`
- *Note: there is no promise polyfill embedded*, use npm:[promise-polyfill](https://www.npmjs.com/package/promise-polyfill) or similar
- ECMA Script 6: DOM - [polyfills.es6.ts](../src/polyfills/polyfills.es6.ts)
- `Node.isConnected`
- `KeyboardKey.prototype.key`
Expand Down
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions pages/src/polyfill-full.ts

This file was deleted.

4 changes: 1 addition & 3 deletions pages/views/_includes/polyfill.njk
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script>
(function () {
var version = '';
if (!window.Promise || !window.CustomEvent){
version = 'full';
} else if (!('getRootNode' in Element.prototype) || !window.customElements){
if (!('getRootNode' in Element.prototype) || !window.customElements) {
version = 'medium';
} else if (!window.scrollBy || !window.IntersectionObserver || !window.ResizeObserver || !window.ResizeObserver) {
version = 'light';
Expand Down
1 change: 0 additions & 1 deletion pages/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module.exports = {
devtool: 'source-map',
entry: {
'localdev': './src/localdev.ts',
'polyfill-full': './src/polyfill-full.ts',
'polyfill-medium': './src/polyfill-medium.ts',
'polyfill-light': './src/polyfill-light.ts'
},
Expand Down
2 changes: 0 additions & 2 deletions src/modules/draft/esl-carousel/core/esl-carousel-arrows.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ esl-carousel {
border: none;
opacity: .5;
cursor: pointer;

// TODO: IE11 support
appearance: none;
}
button.arrow-next {
Expand Down
2 changes: 0 additions & 2 deletions src/modules/esl-tab/core/esl-tabs.arrows.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ esl-tabs[scrollable] {
border: none;
opacity: .5;
cursor: pointer;

// TODO: IE11 support
appearance: none;
}
.arrow-next {
Expand Down
22 changes: 0 additions & 22 deletions src/polyfills/list/dom.element.closest.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/polyfills/list/dom.element.toggleAttribute.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Group: DOM API shims
* Target Browsers: `IE11`, `Edge < 18`, `Safari < 13`
* Target Browsers: `Edge < 18`, `Safari < 13`
* Element.toggleAttribute polyfill
*/
if (!Element.prototype.toggleAttribute) {
Expand Down
40 changes: 0 additions & 40 deletions src/polyfills/list/dom.event.base.ts

This file was deleted.

27 changes: 0 additions & 27 deletions src/polyfills/list/dom.event.custom.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/polyfills/list/dom.event.focus.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/polyfills/list/dom.event.keyboard.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Group: DOM API shims
* Target Browsers: `IE11`, `Edge < 18`
* Target Browsers: `Edge < 18`
* KeyboardEvent polyfill: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/KeyboardEvent
*/
try {
Expand Down
45 changes: 0 additions & 45 deletions src/polyfills/list/dom.event.mouse.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/polyfills/list/dom.keyboard.key.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Group: DOM API shims
* Target Browsers: `IE11`, `Edge < 18`
* Target Browsers: `Edge < 18`
* KeyboardEvent.prototype.key shim to normalize key values to W3C spec
* Based on published shim https://www.npmjs.com/package/shim-keyboard-event-key
*/
Expand Down
2 changes: 1 addition & 1 deletion src/polyfills/list/dom.node.isConnected.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Group: DOM polyfills
* Target browsers: `IE11`, `Edge <= 18`
* Target browsers: `Edge <= 18`
* Node.isConnected polyfill
*/
if (!('isConnected' in Node.prototype)) {
Expand Down
21 changes: 0 additions & 21 deletions src/polyfills/list/dom.tokenList.toggle.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/polyfills/list/es6.array.find.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/polyfills/list/es6.array.from.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/polyfills/list/es6.array.includes.ts

This file was deleted.

Loading

0 comments on commit 6d376ee

Please # to comment.