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
)

examples/protocol-and-stream-muxing/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/pubsub/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/floodsub": "^7.0.0",
3535
"@libp2p/mplex": "^8.0.0",
3636
"@libp2p/tcp": "^7.0.0",
3737
"libp2p": "^0.45.0",
3838
"uint8arrays": "^4.0.4"
3939
},
4040
"devDependencies": {
41-
"aegir": "^39.0.10",
41+
"aegir": "^39.0.13",
4242
"execa": "^7.1.1",
4343
"p-defer": "^4.0.0"
4444
},

examples/transports/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/tcp": "^7.0.0",
3636
"@libp2p/websockets": "^6.0.0",
@@ -40,7 +40,7 @@
4040
"uint8arrays": "^4.0.4"
4141
},
4242
"devDependencies": {
43-
"aegir": "^39.0.10",
43+
"aegir": "^39.0.13",
4444
"test-ipfs-example": "^1.0.0"
4545
},
4646
"private": true

interop/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
## Table of contents <!-- omit in toc -->
1111

1212
- [Install](#install)
13-
- [API Docs](#api-docs)
1413
- [License](#license)
1514
- [Contribution](#contribution)
1615

@@ -20,10 +19,6 @@
2019
$ npm i multidim-interop
2120
```
2221

23-
## API Docs
24-
25-
- <https://libp2p.github.io/js-libp2p/modules/multidim_interop.html>
26-
2722
## License
2823

2924
Licensed under either of

interop/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"dependencies": {
4141
"@chainsafe/libp2p-noise": "^12.0.1",
42-
"@chainsafe/libp2p-yamux": "^4.0.2",
42+
"@chainsafe/libp2p-yamux": "^4.0.0",
4343
"@libp2p/mplex": "^8.0.0",
4444
"@libp2p/tcp": "^7.0.0",
4545
"@libp2p/webrtc": "^2.0.0",
@@ -51,7 +51,7 @@
5151
"redis": "4.5.1"
5252
},
5353
"devDependencies": {
54-
"aegir": "^39.0.10"
54+
"aegir": "^39.0.13"
5555
},
5656
"browser": {
5757
"@libp2p/tcp": false

interop/tsconfig.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
{
1515
"path": "../packages/stream-multiplexer-mplex"
1616
},
17+
{
18+
"path": "../packages/stream-multiplexer-yamux"
19+
},
1720
{
1821
"path": "../packages/transport-tcp"
1922
},

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"private": true,
1515
"scripts": {
16-
"reset": "aegir run clean && aegir clean packages/*/node_modules node_modules package-lock.json packages/*/package-lock.json",
16+
"reset": "aegir run clean && aegir clean interop/node_modules examples/*/node_modules packages/*/node_modules node_modules package-lock.json packages/*/package-lock.json examples/*/package-lock.json interop/*/package-lock.json",
1717
"test": "aegir run test",
1818
"test:node": "aegir run test:node",
1919
"test:chrome": "aegir run test:chrome",
@@ -36,7 +36,7 @@
3636
"docs": "NODE_OPTIONS=--max_old_space_size=4096 aegir docs"
3737
},
3838
"devDependencies": {
39-
"aegir": "^39.0.5"
39+
"aegir": "^39.0.13"
4040
},
4141
"eslintConfig": {
4242
"extends": "ipfs",

packages/crypto/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
},
101101
"devDependencies": {
102102
"@types/mocha": "^10.0.0",
103-
"aegir": "^39.0.10",
103+
"aegir": "^39.0.13",
104104
"benchmark": "^2.1.4",
105105
"protons": "^7.0.2"
106106
},

packages/interface-compliance-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
"uint8arrays": "^4.0.4"
133133
},
134134
"devDependencies": {
135-
"aegir": "^39.0.10"
135+
"aegir": "^39.0.13"
136136
},
137137
"typedoc": {
138138
"entryPoint": "./src/index.ts"

0 commit comments

Comments
 (0)