Skip to content

fix: update dependency smocket to v0.5.0 - #343

Closed
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/smocket-0.x
Closed

fix: update dependency smocket to v0.5.0#343
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/smocket-0.x

Conversation

@renovate

@renovate renovate Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
smocket 0.4.20.5.0 age confidence

Release Notes

electrohyun/smocket (smocket)

v0.5.0

Compare Source

smocket. Test socket.io without a server. Sweet setup, rocket speed.

What matters in this one

v0.5.0 is expected to be the last minor release before v1.0.0. The remaining stabilization work may produce one or two v0.5.x patch releases, but the public surface intended for 1.0.0 is now substantially in place.

This is the first synchronized release of smocket and smocket-client. The root smocket package owns the in-memory server and connection registry. The new smocket-client package preserves Socket.IO Client's package shape—default, io, connect, callable CommonJS, and the client Socket type—while delegating every lookup to an exact-version smocket peer. Publishing both as 0.5.0 means a test's client import and its in-memory server resolve through the same implementation and registry instead of duplicating connection state (#​235, #​276).

Install both packages at the same version:

npm install -D smocket smocket-client

An application can keep its existing import:

// src/chat.ts — unchanged application code
import { io } from 'socket.io-client';

export const socket = io('http://localhost:3000');

In tests, substitute that client package with smocket-client and provide the in-memory server:

// chat.test.ts
import { Server } from 'smocket';

const io = new Server('http://localhost:3000');
io.on('connection', (socket) => {
  socket.on('message', (text) => socket.broadcast.emit('message', text));
});

Runner-specific substitution examples live in the test-runner integration guide.

New public surface

The package boundary now matches the server/client split applications already use. smocket exports the server-side Socket type, while smocket-client exports the client-side Socket type with the correct event-map direction. The facade works through ESM, callable CommonJS, Node16 resolution, bundler resolution, and Chromium (#​178, #​235, #​276).

Sockets gained the observable state and extension points used by real applications: connected, disconnected, recovered, mutable client auth, per-packet server middleware, complete catch-all and listener-inspection methods, and the accepted inherited emitter surface. A direct Server.connect() plus nextConnection() pair is also available for tests that already hold the server instance (#​266, #​267, #​268, #​274, #​275, #​277).

Namespace and broadcast coverage grew together. Dynamic namespace parents and new_namespace are supported; broadcast operators gained Promise acknowledgements, aliases, compression modifiers, local socket lookup, bulk room membership, and bulk disconnect. The built-in Adapter lifecycle is observable through its live rooms map, and deterministic tracing or dropping adapters can inspect or alter local delivery without pretending to implement multi-server scaling (#​238, #​261, #​262, #​269, #​278, #​322, #​323, #​324).

Non-binary payloads now cross the same JSON snapshot boundary measured on Socket.IO's default parser, and disconnect(true) closes every namespace socket sharing the client Manager rather than only the selected namespace (#​237, #​250, #​254).

Corrected observable results

These corrections move the mock to the results measured on Socket.IO 4.7.5 and 4.8.3:

  • Static namespaces: 0.4.2 could admit an unregistered namespace and treated equivalent namespace spellings as different keys. 0.5.0 normalizes static names and rejects an unregistered namespace with Invalid namespace before a connection handler runs (case, #​228).
  • Abandoned connections: rejected middleware could leave temporary rooms behind, and a client disconnected during pending middleware could still connect later. Rejection and cancellation now remove the attempt and a late middleware continuation cannot admit it (case, #​229).
  • Disconnected membership: teardown could leave an empty sid entry, and a disconnected server socket could join rooms again. The sid is now removed and later joins cannot recreate membership (case, #​230).
  • Reserved events: application code could emit Socket.IO lifecycle names through public emitters. Those emits now throw before peer delivery or outgoing catch-all observation (case, #​232).
  • Volatile and timeout modifiers: socket modifiers used reusable wrapper objects and could leak into an unrelated broadcast. They now preserve Socket identity, apply to one operation, and stay isolated from recipient sockets; narrowed broadcast operators expose volatile as an operator again (volatile cases, timeout cases, #​231, #​259).
  • Fluent APIs: server and namespace middleware registration plus client/server connect or disconnect methods returned void. They now return the same receiver measured on Socket.IO, preserving chaining and event maps (cases, #​233).
  • Payload isolation: JSON-compatible payloads could cross the in-memory boundary by reference, so mutation on one side was visible on the other. They now cross a serialization snapshot while binary values retain their supported pass-through behavior (cases, #​237, #​250).
  • Manager teardown: disconnect(true) could leave sibling namespace sockets from the same client alive. It now closes the shared Manager group and reports each namespace lifecycle once (cases, #​236, #​254).
  • Emitter removal: the final removeListener observer now follows the maintained Node and Socket.IO host behavior instead of a locally fixed bulk-removal rule (cases, #​309).

Upgrade notes

The two packages must stay on the same exact version. Load both through ESM or both through CommonJS so they share one in-process registry; mixed formats can create separate root module instances.

This release includes public declaration changes that can reject TypeScript call sites accepted by 0.4.2. Code that assigned to socket.volatile, treated fluent APIs as explicitly void, or passed names outside a typed event map to listener-removal methods may need adjustment. The runtime changes generally expose the Socket.IO-compatible receiver or restriction, but helpers and type assertions written around the older declarations should be checked during the upgrade.

The Node.js floor remains >=20, and the packed root package still has zero runtime dependencies.

The governing ADR 0019 row is “a public type change that still compiles at existing call sites, else major.” Existing call sites no longer compile in the cases above, so the change is major under the stable-version rule. Before 1.0.0 that rule applies one place to the right, making 0.5.0 the required minor release. Newly covered Socket.IO surface and observable corrections also ship here, with the corrected results called out above rather than hidden in the version number.

Package adoption and release reliability

The documented Vitest and Jest substitutions now run as clean consumers outside the checkout. Candidate checks install the exact two tarballs through ESM, CommonJS, Node16, bundler, browser, and application fixtures. Release candidates also record each package's name, version, size, and SHA-256 digest so every package-level check consumes the same artifact set (#​280, #​281, #​310).

The supported Socket.IO declarations are independently inventoried, package tarballs reject runtime dependencies, non-receipt assertions use completion markers instead of wall-clock waits, and exact published versions have a bounded registry verifier and remediation path (#​273, #​282, #​283, #​284, #​310, #​314, #​316, #​318).

What's Changed

Full Changelog: v0.4.2...v0.5.0


Configuration

📅 Schedule: (in timezone Asia/Seoul)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot requested a review from electrohyun as a code owner August 17, 2026 07:11
@github-actions github-actions Bot added bug Something isn't working 📏 s Pull request changes 10–49 lines labels Aug 17, 2026
@renovate
renovate Bot force-pushed the renovate/smocket-0.x branch 3 times, most recently from 37736c4 to 023215e Compare August 20, 2026 05:13
@renovate
renovate Bot force-pushed the renovate/smocket-0.x branch from 023215e to 421e0d3 Compare August 20, 2026 06:00
@electrohyun

Copy link
Copy Markdown
Owner

Closing this update because the published-smocket fixture is an intentionally pinned case-study snapshot, not a dependency that should follow the current package release automatically. Updating only its package manifests to 0.5.0 would leave the accompanying documentation and recorded observations describing the 0.4.2 adoption state. A future snapshot refresh should update and revalidate the entire case study as one deliberate change.

@renovate

renovate Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (0.5.0). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate
renovate Bot deleted the renovate/smocket-0.x branch August 20, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working 📏 s Pull request changes 10–49 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant