Skip to content

Commit

Permalink
TMP use updated wrtc
Browse files Browse the repository at this point in the history
  • Loading branch information
tharvik committed Feb 8, 2024
1 parent 32c8271 commit 4bf2d64
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 391 deletions.
2 changes: 1 addition & 1 deletion discojs/discojs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"homepage": "https://github.com/epfml/disco#readme",
"dependencies": {
"@koush/wrtc": "0.5",
"@roamhq/wrtc": "^0.7.1",
"@tensorflow/tfjs": "4",
"@types/msgpack-lite": "0.1",
"axios": "0.27",
Expand Down
2 changes: 1 addition & 1 deletion discojs/discojs-core/src/client/decentralized/peer.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from 'chai'
import { List, Range, Set } from 'immutable'
import wrtc from '@koush/wrtc'
import wrtc from '@roamhq/wrtc'

import { Peer } from './peer'

Expand Down
8 changes: 4 additions & 4 deletions discojs/discojs-core/src/client/decentralized/peer_pool.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Map, Set } from 'immutable'
import { SignalData } from 'simple-peer'
import { WRTC } from '@koush/wrtc'
import * as WRTC from '@roamhq/wrtc'

import { Peer } from './peer'
import { NodeID } from '../types'
Expand All @@ -13,15 +13,15 @@ export class PeerPool {

private constructor (
private readonly id: NodeID,
private readonly wrtc?: WRTC
private readonly wrtc?: typeof WRTC
) {}

static async init (id: NodeID): Promise<PeerPool> {
// needed on node
let wrtc: WRTC | undefined
let wrtc: typeof WRTC | undefined
try {
// resolve relatively to where it is run, not from discojs dir
const path = require.resolve('@koush/wrtc', { paths: ['.'] })
const path = require.resolve('@roamhq/wrtc', { paths: ['.'] })
wrtc = await import(path)
} catch (e) {
// expected
Expand Down
11 changes: 0 additions & 11 deletions discojs/discojs-core/types/koush__wrtc/index.d.ts

This file was deleted.

2 changes: 0 additions & 2 deletions discojs/tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
"downlevelIteration": true, // needed by <ES6

"declaration": true,

"typeRoots": ["../node_modules/@types", "discojs-core/types"]
},
"include": []
}
Expand Down
Loading

0 comments on commit 4bf2d64

Please sign in to comment.