Home:ALL Converter>Including babel-polyfill in browser slows down

Including babel-polyfill in browser slows down

Ask Time:2019-02-22T07:24:58         Author:vik

Json Formatter

I have a large code base, that assembles to a react app which runs in a website. It is only a part of a larger web-app. I have inherited that code and I have no tests.

Problem is: FireFox hangs after loading polyfill.min.js (all babel/polyfill.js features are included in that file - source: https://babeljs.io/docs/en/babel-polyfill)

babel/polyfill is loaded as an external script if it wasn't loaded before by some other code in the website.

A React-app using Promises and Arrow-functions. Most probably some more es6 code

Maybe reducing the modules of polyfill.min.js could help, but how do I know what I need to Polyfill apart from React, Promises and Arrow-functions?

Is it possible to find out progamaticaly? Because:

  • The code was written by others.
  • I have no tests.

Or should I get rid of polyfill? How to find out what exactly is the cause of the problem. Firefox doesn't tell me what part of the script is slowing down and the console log isn't a great help either (I am not seeing any error messages).

Author:vik,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/54817802/including-babel-polyfill-in-browser-slows-down
yy