-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
What am i missing? #113
Comments
Hey, welcome to the project! require('webtorrent-hybrid') -> global.WRTC=wrtc -> require('webtorrent') -> new Webtorrent(){ ....internally checks global.WRTC.....} |
From my understanding, this package is separated out into a separate repository as it combines multiple existing components, into one new package which has a different use case and functionality, which could end up bloating the master package. e.g. your browser doesn't need to know how to create a command-line interface of the WebTorrent client. These three files outline two use cases, one when the file is being used via the command line using the The key file here is the The main The Again, the specific bloat that would come from this is the inclusion of packages like @PopTudor, thank you very much for giving @KilianKilmister an explanation regarding this, hopefully with both of these put together he now has a full understanding of why this has been done. As this is more of a question rather than an issue, I'm going to close this, but if you disagree with this or would like to continue to the discussion, please feel free to either re-open the issue or continue the conversation in the closed ticket respectively. Many thanks |
@SilentBot1 Thanks for the detailed explanation, it truly helps |
@SilentBot1 @PopTudor Thanks for the elaboration. I didn't consider the global assignment. I think part of my confusion came from one of the listed features of the main package:
It made me wonder why there was an additional package needed to make them interoperable. Before i posed the question i just finished a 20h programming session and i guess together with my surprise of how little code there was in hybrid made me not look carefully enough. I see now that just rambling from here on outMan, all that browser stuff always confuses the hell out of me. I pretty much exclusively work at the backend, started working with JS/ES with node v13 and have only ever used native esm-modules because of how smooth they work and naturally integrate with TS-language-features. And that also meant I could use all the latest ES-features as I didn't have to worry about backwards compatibility. And man, JS/ES in the browser can be total anarchy with all the globals being created and the load order sensitivity. This together with thinking about backward compatibility forcing me to use bundlers and transpilers, creating a layer of separation between me and the product. Every time i need to do something for the browser it ends up as some patchwork of code. Sure it works decently well, but it's just not the smooth symphony i'm used to from the backend that i cherish so much. My apologies for this little rant, maybe someday i'll understand the browser environment. anyways; thanks again for the detailed explanation |
@KilianKilmister yep I feel the same about JS in general. Also before using this module, this issue might be of interest in what you're trying to accomplish. I am also blocked by the issue but I'm trying to find a workaround. |
while looking for nodejs-torrent clients, i wantet to give webtorrent a try, and since i want to use it server-side, i followed the instructions to webtorrent-hybrid. And looking at this repo begs the question: Why is there a whole seperate package for 16 lines of code?
I'm sorry, and i'm really not trying to offend anybody, but i can't wrap my head around it. and most of the code consists of
require
-statements. Can someone please tell me what i'm missing here?For your visualisation, this is all the code
bin/cmd.js
index.js
lib/global.js
The text was updated successfully, but these errors were encountered: