Skip to content
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

Update @babel/polyfill to 7.rc-1 #159

Closed
larsgw opened this issue Aug 23, 2018 · 8 comments
Closed

Update @babel/polyfill to 7.rc-1 #159

larsgw opened this issue Aug 23, 2018 · 8 comments

Comments

@larsgw
Copy link
Owner

larsgw commented Aug 23, 2018

This update involves limiting @babel/polyfill quite a lot:

@babel/polyfill will not include proposal polyfills by default

Properly updating involves determining what stage <4 polyfills Citation.js & dependencies are using, and importing those manually.

After updating and creating a bundle, running it on IE8 gives an Out of stack space error which has been linked to a lack of proper polyfills before. In conclusion, updating properly is most likely necessary. If not, I'll have to figure out what is causing this instead.

@larsgw
Copy link
Owner Author

larsgw commented Aug 23, 2018

Additional testing reveals this isn't actually a problem, but even then I can't test if it does works until the errors are resolved.

Bonus incentive (apart from installing a release candidate, which I don't think I have done on npm before): it removes ~30kb from the bundle size.

@larsgw
Copy link
Owner Author

larsgw commented Aug 23, 2018

Not sure about the stack error (happens only with the minified file), but IE<9 are hit by iterator.return (babel/babel#1286) anyway, so that won't work anytime soon probably.

@larsgw
Copy link
Owner Author

larsgw commented Aug 23, 2018

iterator.return should be fixed by babel-plugin-transform-member-expression-literals. There should probably be a separate build for IE. Still not sure about the stack error, debugging is rather difficult in IE9...

@larsgw
Copy link
Owner Author

larsgw commented Aug 24, 2018

Next: this time { default: ... } (object literals with reserved property names) is the problem which should be fixed by @babel/plugin-transform-property-literals. Just to make sure, I also installed @babel/plugin-transform-reserved-words.

@larsgw
Copy link
Owner Author

larsgw commented Aug 24, 2018

Success, now we have the stack error in the normal build as well. It seems the ie8 compat mode of uglify-js accounts for things babel doesn't account for. +1! Hopefully getting this error in the normal build eases the debugging.

@larsgw
Copy link
Owner Author

larsgw commented Aug 24, 2018

IE points to this line:

  } else if ('0'.split(undefined, 0)[LENGTH]) {
    internalSplit = function (separator, limit) {
      return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit);
    };
  }

As if internalSplit is accidentally calling itself for some reason.

@larsgw
Copy link
Owner Author

larsgw commented Aug 24, 2018

Okay, the problem was in another version (core-js v2), excluding core-js should work: zloirock/core-js#248

Excluding @babel/polyfill would probably not work, as register-runtime still needs a fix.

@larsgw
Copy link
Owner Author

larsgw commented Aug 25, 2018

Updating to rc.3 works for IE10+, so I guess that's fine.

larsgw added a commit that referenced this issue Aug 26, 2018
Update dependencies, except Babel.

See #159
@larsgw larsgw closed this as completed in 7130152 Aug 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant