Skip to content

Documentation site and editorial pass - #149

Open
Astn wants to merge 3 commits into
masterfrom
docs-site
Open

Astn wants to merge 3 commits into
masterfrom
docs-site

Conversation

@Astn

@Astn Astn commented Sep 24, 2026

Copy link
Copy Markdown
Owner

Documentation site and editorial pass

Two things, both documentation only; no code under Json-Rpc/ or the packages changes.

Site

site/ builds https://astn.github.io/JSON-RPC.NET/ from the Markdown files already in the repository, so GitHub, NuGet and the site never drift apart. Typst 0.14 renders each page through the cmarker package inside site/page.typ (the page shell: top bar, grouped page list, article, table of contents, footer); site/build.py adds GitHub-compatible heading ids, a per-page table of contents, link resolution (pages become site links, other files link to GitHub or are copied under their repository path), Pygments highlighting in light and dark, and copies the benchmark charts and the explorer. .github/workflows/pages.yml runs the same build on every push to master that touches a documentation file and fails the deploy if a page does not compile or a chart is stale. site/README.md says how to build locally and add a page.

The landing page at https://astn.github.io/ (repository Astn/astn.github.io) links here.

Editorial pass

Two independent reviews of the README, docs/serializers.md, the three package READMEs, the WebAssembly sample page and the micro-benchmark page, each with mirrored lenses (flow and human against structure and enterprise), a second round where each answered the other, and one merged list applied here. Every factual claim in the reviews was checked against the source before the docs were changed, and the Getting started sample was compiled and run on net8.0 and net10.0.

Factual corrections worth knowing about:

  • Conversion failures are -32602 with structured data, not -32603 (both serializer READMEs said the latter).
  • NaN and the infinities are written as quoted strings, not bare symbols (System.Text.Json README).
  • Config.SetErrorHandler(handler) and the other session-less setters set the default session's handler only; the Configuration section now has a scope table.
  • Process(json, null) does not compile (CS0121, ambiguous with the JsonRpcStateAsync overload) and ProcessAsync(json, null) binds json as the session id and throws ArgumentNullException; the upgrade notes now say so and show Process(json) / Process(json, context: null).
  • The StreamJsonRpc comparison ran JSON-RPC.Net's built-in serializer, not "the same JSON library underneath".
  • Exception disclosure: the CLR type name and message are sent by default; "redacted" was overstating it.
  • AddJsonRpcService<T>() is a singleton resolved once at startup; scoped dependencies and per-request services are explained, and the raw-connection samples now listen on loopback.
  • An unknown session id creates a session that persists; SessionSelector must map to a fixed set of ids.
  • AustinHarris.JsonRpc.AspNet targets .NET Framework 4.0 and cannot be combined with the 2.0 core; it is documented as 1.x only.
  • A bare byte[] is ambiguous between the memory and span overloads on C# 12; samples use AsSpan().
  • The WebAssembly page's "bytes beat strings" holds under the interpreter only, and it now derives its ratios from the README's 217 ns figure.

Structure: the README is ordered around the reader's path (Getting started keeps the class example only; Defining methods, Hosting, Errors, Asynchronous methods and cancellation, Sessions and context, Configuration, a new Security section, Benchmarks with a summary table first, Upgrading grouped by impact, Versioning and support, Building, License). render.py --check passes; no published benchmark figure changed.

Open decisions for the maintainer

These came out of the reviews and are not changed here:

  1. Should an unhandled exception's Message be sent to clients by default, or only with IncludeExceptionDetails?
  2. Should the request path stop creating sessions for unknown ids (answer -32601 without a registry entry)?
  3. Should the session-less handler setters become truly process-wide, and should SetBeforeProcessHandler(sessionId, …) get a SetPreProcessHandler alias and a per-session post-process setter on Config?
  4. A JsonRpcService subclass bound through DI to another session is still exposed on the default session (its base constructor binds it there). Document only, or add a non-binding base constructor?
  5. Versioning commitments (SemVer, 1.x maintenance), SECURITY.md with a private reporting route, CHANGELOG.md: the docs state only what the repository establishes today.
  6. The core package's NuGet description says "no dependencies"; it depends on NonBlocking. "No JSON library dependency" would be accurate.

site/build.py renders README.md, docs/serializers.md, the package READMEs, the WebAssembly
sample and the micro-benchmark READMEs through Typst's HTML export (cmarker) inside the page
shell site/page.typ, then adds GitHub-compatible heading anchors, a table of contents, resolved
relative links (pages, copied assets, GitHub for sources), Pygments highlighting, and copies the
charts, data and benchmark explorer under benchmarks/charts/. The Pages workflow builds the
site on every documentation change and fails on a page that does not compile.

README: the documentation site is linked at the top and in the footer; the benchmark explorer
moved to benchmarks/charts/explorer.html; the buy-me-a-coffee section is gone.
Two independent editorial reviews of the README, the serializer guide,
the package READMEs, the WebAssembly sample and the micro-benchmark page,
reconciled into one list and applied here.

Factual corrections:
- conversion failures are -32602 with structured data, not -32603
  (Newtonsoft and System.Text.Json READMEs)
- NaN and the infinities are written as quoted strings, not bare symbols
- the session-less handler setters on Config set the default session's
  handler only; the Configuration table now shows the scope of each setting
- Process(json, null) is ambiguous and ProcessAsync(json, null) binds json
  as the session id; the upgrade notes say so and show the working forms
- the StreamJsonRpc comparison did not use the same JSON library
- exception disclosure: the type name and message are sent by default
- AddJsonRpcService<T>() registers a singleton resolved once at startup;
  scoped dependencies and per-request services are explained
- unknown session ids create sessions that persist; session selectors
  must map to a fixed set of ids
- the classic ASP.NET package targets .NET Framework 4.0 and cannot be
  combined with the 2.0 core
- "Bytes beat strings" holds under the interpreter only; the WebAssembly
  page now cites the README's 217 ns figure and derives its ratios from it
- byte[] arguments need AsSpan() on C# 12; the quick start now compiles
  as pasted (verified on net8.0 and net10.0)

Structure:
- README reordered around the reader's path: Getting started keeps the
  class example only; delegates and interfaces move to Defining methods;
  Errors, Asynchronous methods and cancellation, and Sessions and context
  are top-level sections; new Security and Versioning and support
  sections; the benchmark section opens with a summary table and its
  history and chart pipeline move out of the reader's way
- the upgrade list is grouped by impact: build breaks, wire changes,
  server behaviour
- the raw-connection samples listen on loopback and state what a raw
  connection does not have (auth, middleware, lenient JSON)
- the AspNetCore README gains install, targets, a services-and-lifetime
  section, an async section, the per-endpoint MapJsonRpc overload and a
  scope column in the options table
- docs/serializers.md: MaxDepth in the contract, full byte signatures,
  the core/serializer split as two lists instead of a paired table, the
  thread-safety text split for users and custom-reader authors, and the
  1.x appendix reduced to serializer-specific items with a link to the
  canonical upgrade list
- one product spelling (JSON-RPC.Net), one name per concept, stale
  footer and CodePlex references removed

render.py --check still passes; every published benchmark figure is
unchanged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant