-
Notifications
You must be signed in to change notification settings - Fork 445
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
Checking for WebSockets constructor name fails under uglification #65
Comments
This is unfortunate, we use this pattern in a couple of places. I guess we need to find a new way to do these kinds of detections. |
Trying to come up with an elegant solution and I always end up in making something that looks too complicated. The crux of this problem is the fact that we might handle several versions of the same module that are compatible with each other, but because of the dependency tree, they coexist. Seems that we need to go 🦆 typing all the way, which isn't the best, but will suffice for the majority (if not all) the cases. |
Warning: I did not look at the code yet. Can you explain the crux of the problem a bit more? I might try to solve this issue |
Actually |
@fsdiogo is handling this. |
PR #182 fixes this. |
Check ipfs/js-ipfs#1321 for more info. |
WoooT! |
Updates project config using the `aegir check-project` command. * Updates CI files ahead of turning on unified CI * Resets project version to 0 (otherwise first version published will be 2.0.0) * Renames project to publish under @libp2p namespace * Standardises readme * Remove unused dependencies * Use chai from aegir * Fix formatting in example
## 1.0.0 (2022-12-13) ### Bug Fixes * update project config ([libp2p#65](libp2p/js-libp2p-webrtc#65)) ([09c33cc](libp2p/js-libp2p-webrtc@09c33cc)) ### Dependencies * update libp2p to release version ([dbd0237](libp2p/js-libp2p-webrtc@dbd0237)) ### Trivial Changes * Update .github/workflows/stale.yml [skip ci] ([43c70bc](libp2p/js-libp2p-webrtc@43c70bc)) ### Documentation * fix 'browser to server' build config ([libp2p#66](libp2p/js-libp2p-webrtc#66)) ([b54132c](libp2p/js-libp2p-webrtc@b54132c))
## [6.0.1](libp2p/js-libp2p-peer-store@v6.0.0...v6.0.1) (2023-02-28) ### Trivial Changes * replace err-code with CodeError ([libp2p#53](libp2p/js-libp2p-peer-store#53)) ([e6b87d7](libp2p/js-libp2p-peer-store@e6b87d7)), closes [js-libp2p#1269](libp2p#1269) * Update .github/workflows/semantic-pull-request.yml [skip ci] ([1139dc4](libp2p/js-libp2p-peer-store@1139dc4)) ### Documentation * Update API link ([libp2p#65](libp2p/js-libp2p-peer-store#65)) ([1b75110](libp2p/js-libp2p-peer-store@1b75110)), closes [libp2p#64](libp2p/js-libp2p-peer-store#64)
Currently to add the WebSockets transport index.js does a check for the constructor.name being 'WebSockets'. This fails under uglification unless 'WebSockets' is made a reserved word in the uglify config, as constructor names are one of the things uglify removes. I recommend that either this is documented, or a different solution is devised; there is already a TODO in the code suggesting that this is found. For example, we could standardise some kind of boolean flag in a transport class which tells libp2p to include it even if there are no listening addresses. That wouldn't be websocket-specific, and wouldn't require checking the name against a string.
The text was updated successfully, but these errors were encountered: