guerrerocarlos / CacheP2P

"More users = More capacity"
http://www.cachep2p.com/
MIT License
865 stars 52 forks source link

[DO NOT MERGE] Add potential linting. #19

Closed wtgtybhertgeghgtwtg closed 8 years ago

wtgtybhertgeghgtwtg commented 8 years ago

Uses eslint-config-airbnb-base. I can change that if you wish.

deckar01 commented 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.

wtgtybhertgeghgtwtg commented 8 years ago

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.

deckar01 commented 8 years ago

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.

wtgtybhertgeghgtwtg commented 8 years ago

Missed that. I am working on stripping out the stuff Uglify cannot parse, but it's looking like Babel might be worth looking into.

deckar01 commented 8 years ago

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.

wtgtybhertgeghgtwtg commented 8 years ago

Either way, I think it's something that should be looked at before proceeding. I'm putting this PR on ice for now.