@net-mesh/browser 0.40.0 → 0.41.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +54 -0
- package/README.md +5 -3
- package/dist/index.bundle.js +2 -2
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/leader/index.d.ts +1 -1
- package/dist/leader/session.d.ts +8 -1
- package/dist/leader/session.js +12 -4
- package/dist/lobby.js +24 -10
- package/dist/net_leaf.d.ts +2 -2
- package/dist/net_leaf.js +11 -11
- package/dist/net_leaf_bg.wasm +0 -0
- package/dist/net_leaf_bg.wasm.d.ts +2 -2
- package/dist/netcode/index.d.ts +3 -0
- package/dist/netcode/index.js +4 -0
- package/dist/node.d.ts +13 -1
- package/dist/node.js +28 -7
- package/dist/peer-driver.d.ts +77 -2
- package/dist/peer-driver.js +163 -3
- package/dist/store/host.d.ts +19 -3
- package/dist/store/host.js +21 -7
- package/dist/store/index.d.ts +23 -0
- package/dist/store/index.js +16 -0
- package/dist/store/join.d.ts +6 -1
- package/dist/store/join.js +14 -8
- package/dist/world/link.js +3 -3
- package/dist/world/regions.js +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,60 @@ missing method at the call site rather than at install time. Unlike
|
|
|
14
14
|
`@net-mesh/sdk`, this package never depends on `@net-mesh/core` — see
|
|
15
15
|
the README on why it is a sibling package rather than a sub-path.
|
|
16
16
|
|
|
17
|
+
## 0.41.1 — two pages can connect to each other at once
|
|
18
|
+
|
|
19
|
+
- **`connectPeer` from both sides no longer cancels both attempts.** When
|
|
20
|
+
two pages called `connectPeer` on each other at the same moment, each
|
|
21
|
+
answer retired the answerer's own offer, both ran out their ICE
|
|
22
|
+
deadline, and the pair stayed relayed. Every game had to hand-code a
|
|
23
|
+
tie-break. The SDK now does it, on `BrowserNode` and `MeshSession`
|
|
24
|
+
alike:
|
|
25
|
+
- the page with the **lower** node id offers;
|
|
26
|
+
- the higher one answers an offer from that peer that arrived within
|
|
27
|
+
the offerer's ICE deadline instead of offering back, and answers one
|
|
28
|
+
that crosses its own offer while that is under way. Once an answer
|
|
29
|
+
has started, its outcome is the call's;
|
|
30
|
+
- `acceptPeer` while this surface's own `connectPeer` for the peer is
|
|
31
|
+
in flight takes that call's outcome.
|
|
32
|
+
|
|
33
|
+
Offers are learned from the surface's verified signal events. With
|
|
34
|
+
none, or with the peer's node id unknown, `connectPeer` behaves as
|
|
35
|
+
before. One offerer per pair is an attempt at a direct link, not a
|
|
36
|
+
guarantee of one: read `peerAttempt()`.
|
|
37
|
+
- **`joinLobby`'s `close()` resolves only once its withdrawal has
|
|
38
|
+
settled.** An announcement replaces a node's whole tag set, so a
|
|
39
|
+
withdrawal still in flight when the page went on to `createLobby`
|
|
40
|
+
could land after the new listing and erase it. The withdrawal also
|
|
41
|
+
waits for any seeking announcement still in flight.
|
|
42
|
+
- **`counters()` reports each drop reason.** The leaf's nested `drops`
|
|
43
|
+
object came back as the string `"[object Object]"`; nested groups now
|
|
44
|
+
flatten to dotted keys (`drops.<reason>`), each still an exact decimal
|
|
45
|
+
string.
|
|
46
|
+
|
|
47
|
+
## 0.41.0 — the whole module surface is exported
|
|
48
|
+
|
|
49
|
+
- **Every module-level export is reachable from an entry point.** Code
|
|
50
|
+
that builds its own transport or tooling on the primitives the
|
|
51
|
+
high-level verbs use no longer copies them out of the package:
|
|
52
|
+
- `@net-mesh/browser/netcode`: the wire helpers `eventPeer`,
|
|
53
|
+
`peerHex`, `encodeFrame`, `decodeFrame`, `chunkOf`,
|
|
54
|
+
`snapshotFrames` and the limits;
|
|
55
|
+
- `@net-mesh/browser/store`: the store internals (wire codec,
|
|
56
|
+
ledger, chunker, assembly, patch, owner and replica);
|
|
57
|
+
- the root: the peer driver, the org trampolines and refusal
|
|
58
|
+
constants, `StreamIdentityError` and the `LeafWasmOrg*` types;
|
|
59
|
+
- `leader`: `PromotionFailedEvent`.
|
|
60
|
+
|
|
61
|
+
Additive: nothing that was exported before changed.
|
|
62
|
+
- **A host whose hex node id has no letters is joinable.** `joinStore`
|
|
63
|
+
read its `host` the way it reads an event's peer, where a string of
|
|
64
|
+
digits is decimal, so for about one host id in 1,800 the joiner
|
|
65
|
+
addressed a different node and could never join. An id the caller
|
|
66
|
+
holds (a lobby's host, a descriptor's `peerIdHex`, `nodeIdHex()`) is
|
|
67
|
+
now read as hex. The same fix covers the host store's own authority,
|
|
68
|
+
the region directory's hosts and the handoff link. 0.39 fixed the
|
|
69
|
+
joiner's own id; this is the host's.
|
|
70
|
+
|
|
17
71
|
## 0.39.0 — connectPeer waits for an attempt under way
|
|
18
72
|
|
|
19
73
|
- **`connectPeer` no longer cancels an attempt that is still under
|
package/README.md
CHANGED
|
@@ -576,9 +576,11 @@ For views the rules can't express, write the projection yourself:
|
|
|
576
576
|
audience })` (one per player). The declared rules still apply after it, so your
|
|
577
577
|
code can hide more but never reveal a declared secret.
|
|
578
578
|
|
|
579
|
-
**One tab per player.**
|
|
580
|
-
|
|
581
|
-
|
|
579
|
+
**One tab per player.** With `rememberedIdentity()`, all tabs of the same site in
|
|
580
|
+
one browser profile share a single identity once it is stored (two tabs that
|
|
581
|
+
call it for the very first time at once can each create their own), so two tabs
|
|
582
|
+
are the *same* player — and a player can't join itself. (Without it, every tab's `connect()` is a new
|
|
583
|
+
player.) To test with two players on one machine, use two browser profiles, or
|
|
582
584
|
two different browsers.
|
|
583
585
|
|
|
584
586
|
**Announcements expire.** A host that announces once disappears from searches
|