webrtcHacks/adapter

Lot of files in node_modules when installing webrtc-adapter

oanguenot opened this issue · 4 comments

Please read first!

Please use discuss-webrtc for general technical discussions and questions.

  • I have provided steps to reproduce (e.g. a link to a jsfiddle)
  • I have provided browser name, version and adapter.js version
  • This issue only happens when adapter.js is used

Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed.

Versions affected

Version 8.0.0
No browser affected. Issue is linked to NPM packaging

Description

This is not really an issue but a possibility to enhance the delivery of webrtc-adapter.
When installing webrtc-adapter v8.0.0, there is a lot of stuff that are contained into the node_modules/webrtc-adapter

Steps to reproduce

Install webrtc-adapter and open the directory node_modules/webrtc-adapter
npm install webrtc-adapter

Expected results

Have a clean directory containing:

  • package.json
  • LICENSE.md
  • README.md
  • /dist/webrtc-adapter.js and others (_no_global): That can be imported as modules (from React, Angular) or loaded from Vanilla JS (index.html)

Actual results

Webrtc-adapter directory contains a lot of files

adapter-9.0.0 & adapter-9.0.0-variants

  • adapter-9.0.0.js: As we are in v8.0.0, what is this file about ?
  • directory 'adapter-9.0.0-variants': Same as above

Directory 'dist'
When used adapter.js from a webpack based application (React, Angular), I understand that this is where the application loads adapter.js.
-> But there is still a edge directory. It should no more be here, isn't-it ?
-> Sources here are not packaged: is it due to the fact that the application will for sure bundle the source in its package ?

Directory 'out'
I understand that this directory is for old applications not based on webpack to let them pick the file and include it to their index.html. Am I right ?
Libraries in that directory are not minified to minimize loading time.

Directory src/js
--> All the source: As they are in the github repository, why to include them here ?

bower.json
Perhaps time to remove this file as bower is less and less used

Grunt
Grunt configuration file is included into the package

Proposal:

  • include a 'files' entry in package.json to limit files included in the npm package.
  • Rework the way the application is bundled to deliver optimized binaries
  • Migrate from Grunt (less and less people know it) to webpack
fippo commented

adapter-9.0.0.js: As we are in v8.0.0, what is this file about ?

local artifact of a npm version major gone wrong, will remove in next version.

But there is still a edge directory. It should no more be here, isn't-it ?

Will remove in next version.t

All the source: As they are in the github repository, why to include them here ?

ES6 modules reference them, see package.json main.

grunt may be on its way out but adapter is nearing the end of its life as well so I don't think its worthwhile to change the build system.

adapter is nearing the end of its life

I have a simple side project that loads adapter.js. It's just an experiment, so I'm not too worried that someone can't make a call because they're using Safari or some old Android browser, but I'm wondering if there's a different polyfill that we should be using instead. I look at webrtchacks.com now and then, but I haven't noticed any discussion of future plans for the project.

In any case, thanks for all the work you've done on this project.

fippo commented

but I'm wondering if there's a different polyfill that we should be using instead

There simply haven't been a lot of changes where polyfilling made sense recently and I do not anticipate much in the future.

fippo commented

should be resolved by now