-
Notifications
You must be signed in to change notification settings - Fork 55
chore(package): add polyfills to correctly work in IE11 #868
Conversation
Codecov Report
@@ Coverage Diff @@
## master #868 +/- ##
=======================================
Coverage 92.99% 92.99%
=======================================
Files 21 21
Lines 728 728
Branches 69 73 +4
=======================================
Hits 677 677
Misses 51 51 Continue to review full report at Codecov.
|
@@ -9,6 +9,7 @@ export const babelConfig = { | |||
['transform-typescript', { isTSX: true }], | |||
'transform-classes', | |||
], | |||
presets: ['es2015'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need this to run examples in IE11
@@ -26,6 +26,7 @@ | |||
</script> | |||
</head> | |||
<body> | |||
<script src="https://cdn.jsdelivr.net/npm/@babel/polyfill@7/dist/polyfill.min.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only for docs, see Semantic-Org/Semantic-UI-React#3369
@@ -145,7 +145,7 @@ | |||
"react-hot-loader": "^4.1.3", | |||
"react-router": "^4.1.2", | |||
"react-router-dom": "^4.1.2", | |||
"react-source-render": "^2.0.0-beta.4", | |||
"react-source-render": "2.0.0-beta.6", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IE11 doesn't support the object destruction, see changes in fixtures: layershifter/react-source-render@264e05a
@@ -581,7 +581,7 @@ class Dropdown extends AutoControlledComponent<Extendable<DropdownProps>, Dropdo | |||
statusDiv.setAttribute('role', 'status') | |||
statusDiv.setAttribute('aria-live', 'polite') | |||
statusDiv.setAttribute('aria-relevant', 'additions text') | |||
Object.assign(statusDiv.style, screenReaderContainerStyles) | |||
_.assign(statusDiv.style, screenReaderContainerStyles) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://lodash.com/docs/4.17.11#assign
Note: This method mutates object and is loosely based on Object.assign.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would we need to ensure that Object.assign
won't be used anywhere in the codebase? I would rather expect that we will introduce polyfill that will ensure that even if Object.assign
is used somewhere in the codebase, it will be handled correctly. Currently we are just introducing implicit rule of using _.assign
vs Object.assign
that will just serve as short-term patch.
I do understand that we may introduce lint rules, but for this particular case it seems that much easier solution will be just to introduce a polyfill - this will ensure that all the previous code would work without any additional changes necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I support too adding polyfill, it will be better for the developers. And yep, we can add additional polyfills if there are other constraints in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should enforce IE11 compatibility by lint rules
2a1dab3
to
946d810
Compare
This reverts commit 25c90cf
Fixes #769.