Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

add babel-polyfill #396

Merged
merged 1 commit into from
Aug 2, 2017
Merged

add babel-polyfill #396

merged 1 commit into from
Aug 2, 2017

Conversation

dannycoates
Copy link
Contributor

fixes #395

and before @pdehaan mentions webpack, i know, but not right now

@dannycoates dannycoates requested a review from abhinadduri August 2, 2017 18:49
package.json Outdated
@@ -79,7 +80,7 @@
"build:upload": "browserify frontend/src/upload.js -g uglifyify -o public/upload.js",
"build:download": "browserify frontend/src/download.js -g uglifyify -o public/download.js",
"build:version": "node scripts/version",
"build:l10n": "cp node_modules/l20n/dist/web/l20n.min.js public",
"build:3rd": "cp node_modules/l20n/dist/web/l20n.min.js public && cp node_modules/babel-polyfill/dist/polyfill.min.js public",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give you a 💵 if we rename this to something more grep-able like "build:vendor".

You could even combine the two:

cp node_modules/l20n/dist/web/l20n.min.js node_modules/babel-polyfill/dist/polyfill.min.js public

@pdehaan
Copy link
Contributor

pdehaan commented Aug 2, 2017

Do we know where the Object.entries() is coming from? I didn't see it in our source (via a quick git grep).

I mean, babel-polyfill seems like a big [96KB] hammer for an API call:

$ ls -lash node_modules/babel-polyfill/dist/polyfill.min.js | awk '{ print $6, $10 }'

96K node_modules/babel-polyfill/dist/polyfill.min.js

UPDATE: Actually, I think it may be coming from testpilot-ga:

$ grep "Object.entries(" -irn .

./node_modules/core-js/README.md:1476:Object.entries({a: 1, b: 2, c: 3}); // => [['a', 1], ['b', 2], ['c', 3]]
./node_modules/testpilot-ga/dist/index.js:51:      Object.entries(productDetails).forEach(([key, value]) => {
./node_modules/testpilot-ga/dist/index.js:88:      Object.entries(allOptions).forEach(([key, value]) => this[key] = value);
./node_modules/testpilot-ga/src/TestPilotGA.js:53:    Object.entries(productDetails).forEach(([key, value]) => {
./node_modules/testpilot-ga/src/TestPilotGA.js:95:    Object.entries(allOptions).forEach(([key, value]) => (this[key] = value));

/cc @chuckharmston

https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/entries#Browser_compatibility

object_entries___-_javascript___mdn

object_entries___-_javascript___mdn

@dannycoates
Copy link
Contributor Author

I mean, babel-polyfill seems like a big [96KB] hammer for an API call

it is, but this isn't the only error in sentry the polyfill will fix

@pdehaan
Copy link
Contributor

pdehaan commented Aug 2, 2017

it is, but this isn't the only error in sentry the polyfill will fix

👍 Great point! Ship it. I think we were considering doing webpack+babel+transpiling (#359) anyways, so this is a great start.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Object.entries is not a function
2 participants