Skip to content

Commit e9cafd3

Browse files
authored
feat!: merge stat properties into stream/connection objects (#1856)
Moves `direction`, `timeline`, `status`, etc from `.stat` objects on `Stream` and `Connection` objects onto the root object so we don't have awkward constructs like `conn.stat.status`, instead the simpler `conn.status`. Fixes #1849 BREAKING CHANGE: `stream.stat.*` and `conn.stat.*` properties are now accessed via `stream.*` and `conn.*`
1 parent 06f4901 commit e9cafd3

File tree

211 files changed

+24552
-369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

211 files changed

+24552
-369
lines changed

examples/auto-relay/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
},
3131
"dependencies": {
3232
"@chainsafe/libp2p-noise": "^12.0.1",
33-
"@chainsafe/libp2p-yamux": "^4.0.2",
33+
"@chainsafe/libp2p-yamux": "^4.0.0",
3434
"@libp2p/mplex": "^8.0.0",
3535
"@libp2p/websockets": "^6.0.0",
3636
"@multiformats/multiaddr": "^12.1.3",
3737
"libp2p": "^0.45.0"
3838
},
3939
"devDependencies": {
40-
"aegir": "^39.0.10",
40+
"aegir": "^39.0.13",
4141
"execa": "^7.1.1",
4242
"p-defer": "^4.0.0",
4343
"uint8arrays": "^4.0.4"

examples/chat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"dependencies": {
3232
"@chainsafe/libp2p-noise": "^12.0.1",
33-
"@chainsafe/libp2p-yamux": "^4.0.2",
33+
"@chainsafe/libp2p-yamux": "^4.0.0",
3434
"@libp2p/mplex": "^8.0.0",
3535
"@libp2p/peer-id-factory": "^2.0.0",
3636
"@libp2p/tcp": "^7.0.0",
@@ -44,7 +44,7 @@
4444
"uint8arrays": "^4.0.4"
4545
},
4646
"devDependencies": {
47-
"aegir": "^39.0.10",
47+
"aegir": "^39.0.13",
4848
"execa": "^7.1.1",
4949
"p-defer": "^4.0.0"
5050
},

examples/connection-encryption/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
},
3131
"dependencies": {
3232
"@chainsafe/libp2p-noise": "^12.0.1",
33-
"@chainsafe/libp2p-yamux": "^4.0.2",
33+
"@chainsafe/libp2p-yamux": "^4.0.0",
3434
"@libp2p/mplex": "^8.0.0",
3535
"@libp2p/tcp": "^7.0.0",
3636
"it-pipe": "^3.0.1",
3737
"libp2p": "^0.45.0",
3838
"uint8arrays": "^4.0.4"
3939
},
4040
"devDependencies": {
41-
"aegir": "^39.0.10",
41+
"aegir": "^39.0.13",
4242
"test-ipfs-example": "^1.0.0"
4343
},
4444
"private": true

examples/delegated-routing/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"react-scripts": "^5.0.1"
4747
},
4848
"devDependencies": {
49-
"aegir": "^39.0.10"
49+
"aegir": "^39.0.13"
5050
},
5151
"browserslist": [
5252
">0.2%",

examples/discovery-mechanisms/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"dependencies": {
3333
"@chainsafe/libp2p-noise": "^12.0.1",
34-
"@chainsafe/libp2p-yamux": "^4.0.2",
34+
"@chainsafe/libp2p-yamux": "^4.0.0",
3535
"@libp2p/bootstrap": "^8.0.0",
3636
"@libp2p/floodsub": "^7.0.0",
3737
"@libp2p/mdns": "^8.0.0",
@@ -41,7 +41,7 @@
4141
"libp2p": "^0.45.0"
4242
},
4343
"devDependencies": {
44-
"aegir": "^39.0.10",
44+
"aegir": "^39.0.13",
4545
"execa": "^7.1.1",
4646
"p-wait-for": "^5.0.2",
4747
"uint8arrays": "^4.0.4"

examples/echo/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"dependencies": {
3232
"@chainsafe/libp2p-noise": "^12.0.1",
33-
"@chainsafe/libp2p-yamux": "^4.0.2",
33+
"@chainsafe/libp2p-yamux": "^4.0.0",
3434
"@libp2p/mplex": "^8.0.0",
3535
"@libp2p/peer-id-factory": "^2.0.0",
3636
"@libp2p/tcp": "^7.0.0",
@@ -42,7 +42,7 @@
4242
"uint8arrays": "^4.0.4"
4343
},
4444
"devDependencies": {
45-
"aegir": "^39.0.10",
45+
"aegir": "^39.0.13",
4646
"execa": "^7.1.1",
4747
"p-defer": "^4.0.0"
4848
},

examples/libp2p-in-the-browser/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
"test:example": "node test.js"
3131
},
3232
"dependencies": {
33-
"@chainsafe/libp2p-gossipsub": "^8.0.0",
33+
"@chainsafe/libp2p-gossipsub": "^9.0.0",
3434
"@chainsafe/libp2p-noise": "^12.0.1",
35-
"@chainsafe/libp2p-yamux": "^4.0.2",
35+
"@chainsafe/libp2p-yamux": "^4.0.0",
3636
"@libp2p/bootstrap": "^8.0.0",
3737
"@libp2p/kad-dht": "^9.0.0",
3838
"@libp2p/mplex": "^8.0.0",
@@ -42,7 +42,7 @@
4242
"libp2p": "^0.45.0"
4343
},
4444
"devDependencies": {
45-
"aegir": "^39.0.10",
45+
"aegir": "^39.0.13",
4646
"execa": "^7.1.1",
4747
"playwright": "^1.35.1",
4848
"vite": "^2.8.6"

examples/peer-and-content-routing/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
},
3131
"dependencies": {
3232
"@chainsafe/libp2p-noise": "^12.0.1",
33-
"@chainsafe/libp2p-yamux": "^4.0.2",
33+
"@chainsafe/libp2p-yamux": "^4.0.0",
3434
"@libp2p/kad-dht": "^9.0.0",
3535
"@libp2p/mplex": "^8.0.0",
3636
"@libp2p/tcp": "^7.0.0",
@@ -40,7 +40,7 @@
4040
"multiformats": "^12.0.1"
4141
},
4242
"devDependencies": {
43-
"aegir": "^39.0.10",
43+
"aegir": "^39.0.13",
4444
"test-ipfs-example": "^1.0.0"
4545
},
4646
"private": true

examples/pnet/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@
3030
},
3131
"dependencies": {
3232
"@chainsafe/libp2p-noise": "^12.0.1",
33-
"@chainsafe/libp2p-yamux": "^4.0.2",
33+
"@chainsafe/libp2p-yamux": "^4.0.0",
3434
"@libp2p/mplex": "^8.0.0",
3535
"@libp2p/tcp": "^7.0.0",
3636
"it-pipe": "^3.0.1",
3737
"libp2p": "^0.45.0",
3838
"uint8arrays": "^4.0.4"
3939
},
4040
"devDependencies": {
41-
"aegir": "^39.0.10",
41+
"aegir": "^39.0.13",
4242
"test-ipfs-example": "^1.0.0"
4343
},
4444
"private": true

examples/protocol-and-stream-muxing/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ There is still one last feature, you can provide multiple protocols for the same
9595

9696
```JavaScript
9797
node2.handle(['/another-protocol/1.0.0', '/another-protocol/2.0.0'], ({ stream }) => {
98-
if (stream.stat.protocol === '/another-protocol/2.0.0') {
98+
if (stream.protocol === '/another-protocol/2.0.0') {
9999
// handle backwards compatibility
100100
}
101101

@@ -149,7 +149,7 @@ node2.handle(['/a', '/b'], ({ stream }) => {
149149
stream,
150150
async function (source) {
151151
for await (const msg of source) {
152-
console.log(`from: ${stream.stat.protocol}, msg: ${uint8ArrayToString(msg.subarray())}`)
152+
console.log(`from: ${stream.protocol}, msg: ${uint8ArrayToString(msg.subarray())}`)
153153
}
154154
}
155155
)

0 commit comments

Comments
 (0)