Closed wtgtybhertgeghgtwtg closed 8 years ago
@wtgtybhertgeghgtwtg Does webpack browserify need a transpiler like babel for these es6 features? If WebRTC support overlaps with es6 support for the most part I could see it not being needed.
I do not see Webpack being used here. Am I missing something?
Yes, support for template strings and arrow functions are implemented in all browsers that support WebRTC.
Sorry, that I was looking at unprefixed WebRTC. There are some version of Chrome and Firefox that do not support template strings or arrow functions, but do support WebRTC. All versions that WebTorrent tests for, however, do support template strings and arrow functions.
Have you tried to run the build? I was not able to get mishoo/UglifyJS to minify es6 in another project. Last time I checked es6 support was still being worked on in mishoo/UglifyJS2.
Missed that. I am working on stripping out the stuff Uglify cannot parse, but it's looking like Babel might be worth looking into.
It might be easier to just use rollup to bundle it as an es6 module and let it perform tree shaking. The size savings of uglification are dwarfed in comparison to gzipping. (The Difference Between Minification and Gzipping)
Edit: Rollup can't tree shake node modules, only es6 modules. I don't think WebTorrent is planning on making the jump to es6 modules any time soon. It looks like babel is required before minification.
Either way, I think it's something that should be looked at before proceeding. I'm putting this PR on ice for now.
Uses
eslint-config-airbnb-base
. I can change that if you wish.