-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(client): introduce core-js #1950
Conversation
client-src/default/polyfill.js
Outdated
'use strict'; | ||
|
||
require('core-js/features/string/includes'); | ||
require('core-js/features/array/includes'); |
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 pollute global namespace 😞 We should use named import like in docs https://github.com/zloirock/core-js
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.
sorry, why?
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.
Maybe we need setup support import
/export
in our babel config for client too
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.
Using require('core-js/features/array/includes');
modify Array.prototype
, so if developer already have modified Array.prototype
we break can break their app. Using import arrayIncludes from 'core-js/features/array/includes'
doesn't modify Array.prototype
so it is safe to use
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.
Makes sense. ok, I'll change
Because opn was renamed to open.
ddfff11
to
3ea39ad
Compare
@evilebottnawi updated, PTAL |
Codecov Report
@@ Coverage Diff @@
## next #1950 +/- ##
==========================================
+ Coverage 92.61% 92.62% +0.01%
==========================================
Files 29 30 +1
Lines 1124 1126 +2
Branches 325 325
==========================================
+ Hits 1041 1043 +2
Misses 79 79
Partials 4 4
Continue to review full report at Codecov.
|
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.
Looks good! Before merge please manually check what we don't modify global built-in (just looks in client and this file should not have any String.prototype
or Array.prototype
)
589bbdf
to
eeb3fd2
Compare
f469dc3
to
534dede
Compare
148dfd5
to
d0893f1
Compare
I'll create other new pr. |
For Bugs and Features; did you add new tests?
modify only
Motivation / Use-Case
#1948 (comment)
Breaking Changes
no
Additional Info