Skip to content

Commit 0748474

Browse files
committed
chore: update js-lint to 0.2.11 and delete .prettierrc since its no longer needed
1 parent f221c37 commit 0748474

File tree

4 files changed

+76
-35
lines changed

4 files changed

+76
-35
lines changed

.prettierrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

README.md

Lines changed: 71 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
QUIC library for TypeScript/JavaScript applications.
44

5-
This is built on top of Cloudflare's [quiche](https://github.com/cloudflare/quiche) library. It is intended to support Linux, Windows MacOS, Android and iOS. Mobile support is still pending.
5+
This is built on top of Cloudflare's
6+
[quiche](https://github.com/cloudflare/quiche) library. It is intended to
7+
support Linux, Windows MacOS, Android and iOS. Mobile support is still pending.
68

7-
Since Cloudflare's quiche is written in Rust. This uses the [napi-rs](https://github.com/napi-rs/napi-rs) binding system compile the native objects for Node.js.
9+
Since Cloudflare's quiche is written in Rust. This uses the
10+
[napi-rs](https://github.com/napi-rs/napi-rs) binding system compile the native
11+
objects for Node.js.
812

9-
This library focuses only on the QUIC protocol. It does not support HTTP3. You can build HTTP3 on top of this.
13+
This library focuses only on the QUIC protocol. It does not support HTTP3. You
14+
can build HTTP3 on top of this.
1015

1116
## Installation
1217

@@ -62,9 +67,11 @@ git push --tags
6267

6368
### Quiche
6469

65-
To understand how to develop this, it is important to understand how quiche works.
70+
To understand how to develop this, it is important to understand how quiche
71+
works.
6672

67-
Clone the https://github.com/cloudflare/quiche project. It's multi-workspace Cargo project.
73+
Clone the https://github.com/cloudflare/quiche project. It's multi-workspace
74+
Cargo project.
6875

6976
You can build and run their examples located in `/quiche/examples/`:
7077

@@ -128,55 +135,96 @@ The available target list is in `rustc --print target-list`.
128135

129136
### Structure
130137

131-
It is possible to structure the QUIC system in the encapsulated way or the injected way.
138+
It is possible to structure the QUIC system in the encapsulated way or the
139+
injected way.
132140

133-
When using the encapsulated way, the `QUICSocket` is separated between client and server.
141+
When using the encapsulated way, the `QUICSocket` is separated between client
142+
and server.
134143

135-
When using the injected way, the `QUICSocket` is shared between client and server.
144+
When using the injected way, the `QUICSocket` is shared between client and
145+
server.
136146

137147
![image](/images/quic_structure_encapsulated.svg)
138148

139-
If you are building a peer to peer network, you must use the injected way. This is the only way to ensure that hole-punching works because both the client and server for any given peer must share the same UDP socket and thus share the `QUICSocket`. When done in this way, the `QUICSocket` lifecycle is managed outside of both the `QUICClient` and `QUICServer`.
149+
If you are building a peer to peer network, you must use the injected way. This
150+
is the only way to ensure that hole-punching works because both the client and
151+
server for any given peer must share the same UDP socket and thus share the
152+
`QUICSocket`. When done in this way, the `QUICSocket` lifecycle is managed
153+
outside of both the `QUICClient` and `QUICServer`.
140154

141155
![image](/images/quic_structure_injected.svg)
142156

143-
This also means both `QUICClient` and `QUICServer` must share the same connection map. In order to allow the `QUICSocket` to dispatch data into the correct connection, the connection map is constructed in the `QUICSocket`, however setting and unsetting connections is managed by `QUICClient` and `QUICServer`.
157+
This also means both `QUICClient` and `QUICServer` must share the same
158+
connection map. In order to allow the `QUICSocket` to dispatch data into the
159+
correct connection, the connection map is constructed in the `QUICSocket`,
160+
however setting and unsetting connections is managed by `QUICClient` and
161+
`QUICServer`.
144162

145163
### Dataflow
146164

147165
The data flow of the QUIC system is a bidirectional graph.
148166

149-
Data received from the outside world is received on the UDP socket. It is parsed and then dispatched to each `QUICConnection`. Each connection further parses the data and then dispatches to the `QUICStream`. Each `QUICStream` presents the data on the `ReadableStream` interface, which can be read by a caller.
167+
Data received from the outside world is received on the UDP socket. It is parsed
168+
and then dispatched to each `QUICConnection`. Each connection further parses the
169+
data and then dispatches to the `QUICStream`. Each `QUICStream` presents the
170+
data on the `ReadableStream` interface, which can be read by a caller.
150171

151-
Data sent to the outside world is written to a `WritableStream` interface of a `QUICStream`. This data is buffered up in the underlying Quiche stream. A send procedure is triggered on the associated `QUICConnection` which takes all the buffered data to be sent for that connection, and sends it to the `QUICSocket`, which then sends it to the underlying UDP socket.
172+
Data sent to the outside world is written to a `WritableStream` interface of a
173+
`QUICStream`. This data is buffered up in the underlying Quiche stream. A send
174+
procedure is triggered on the associated `QUICConnection` which takes all the
175+
buffered data to be sent for that connection, and sends it to the `QUICSocket`,
176+
which then sends it to the underlying UDP socket.
152177

153178
![image](/images/quic_dataflow.svg)
154179

155-
Buffering occurs at the connection level and at the stream level. Each connection has a global buffer for all streams, and each stream has its own buffer. Note that connection buffering and stream buffering all occur within the Quiche library. The web streams `ReadableStream` and `WritableStream` do not do any buffering at all.
180+
Buffering occurs at the connection level and at the stream level. Each
181+
connection has a global buffer for all streams, and each stream has its own
182+
buffer. Note that connection buffering and stream buffering all occur within the
183+
Quiche library. The web streams `ReadableStream` and `WritableStream` do not do
184+
any buffering at all.
156185

157186
### Connection Negotiation
158187

159-
The connection negotiation process involves several exchanges of QUIC packets before the `QUICConnection` is constructed.
188+
The connection negotiation process involves several exchanges of QUIC packets
189+
before the `QUICConnection` is constructed.
160190

161-
The primary reason to do this is for both sides to determine their respective connection IDs.
191+
The primary reason to do this is for both sides to determine their respective
192+
connection IDs.
162193

163194
![image](/images/quic_connection_negotiation.svg)
164195

165196
### Push & Pull
166197

167-
The `QUICSocket`, `QUICClient`, `QUICServer`, `QUICConnection` and `QUICStream` are independent state machines that exposes methods that can be called as well as events that may be emitted between them.
198+
The `QUICSocket`, `QUICClient`, `QUICServer`, `QUICConnection` and `QUICStream`
199+
are independent state machines that exposes methods that can be called as well
200+
as events that may be emitted between them.
168201

169-
This creates a concurrent decentralised state machine system where there are multiple entrypoints of change.
202+
This creates a concurrent decentralised state machine system where there are
203+
multiple entrypoints of change.
170204

171-
Users may call methods which causes state transitions internally that trigger event emissions. However some methods are considered internal to the library, this means these methods are not intended to be called by the end user. They are however public relative to the other components in the system. These methods should be marked with `@internal` documentation annotation.
205+
Users may call methods which causes state transitions internally that trigger
206+
event emissions. However some methods are considered internal to the library,
207+
this means these methods are not intended to be called by the end user. They are
208+
however public relative to the other components in the system. These methods
209+
should be marked with `@internal` documentation annotation.
172210

173-
External events may also trigger event handlers that will call methods which perform state transitions and event emission.
211+
External events may also trigger event handlers that will call methods which
212+
perform state transitions and event emission.
174213

175-
Keeping track of how the system works is therefore quite complex and must follow a set of rules.
214+
Keeping track of how the system works is therefore quite complex and must follow
215+
a set of rules.
176216

177-
- Pull methods - these are either synchronous or asynchronous methods that may throw exceptions.
178-
- Push handlers - these are event handlers that can initiate pull methods, if these pull handlers throw exceptions, these exceptions must be caught, and expected runtime exceptions are to be converted to error events, all other exceptions will be considered to be software bugs and will be bubbled up to the program boundary as unhandled exceptions or unhandled promise rejections. Generally the only exceptions that are expected runtime exceptions are those that arise from perform IO with the operating system.
217+
- Pull methods - these are either synchronous or asynchronous methods that may
218+
throw exceptions.
219+
- Push handlers - these are event handlers that can initiate pull methods, if
220+
these pull handlers throw exceptions, these exceptions must be caught, and
221+
expected runtime exceptions are to be converted to error events, all other
222+
exceptions will be considered to be software bugs and will be bubbled up to
223+
the program boundary as unhandled exceptions or unhandled promise rejections.
224+
Generally the only exceptions that are expected runtime exceptions are those
225+
that arise from perform IO with the operating system.
179226

180227
## License
181228

182-
js-quic is licensed under Apache-2.0, you may read the terms of the license [here](LICENSE).
229+
js-quic is licensed under Apache-2.0, you may read the terms of the license
230+
[here](LICENSE).

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"@matrixai/quic-win32-x64": "2.0.9"
6969
},
7070
"devDependencies": {
71-
"@matrixai/lint": "^0.2.6",
71+
"@matrixai/lint": "^0.2.11",
7272
"@fast-check/jest": "^2.1.0",
7373
"@napi-rs/cli": "^2.15.2",
7474
"@noble/ed25519": "^1.7.3",

0 commit comments

Comments
 (0)