Skip to content

docs: cover SSR, immutable graphs and stable callbacks - #15

Merged
bwin merged 3 commits into
devfrom
docs/ssr-immutability-callbacks
Nov 3, 2026
Merged

bwin merged 3 commits into
devfrom
docs/ssr-immutability-callbacks

Conversation

@bwin

@bwin bwin commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Summary

Addresses the documentation gaps in CONFIRMED-FINDINGS.md item 10.

  • docs/getting-started.md: documents that non-empty graphs server-render only a plotHeight-tall "Preparing diagram..." placeholder at container width, empty graphs render "No flow data", and layout runs after hydration. formatAmount/getLabel still run during SSR, so they must avoid browser-only APIs.
  • docs/api.md: the graph row now requires immutable inputs and a new reference on change, and explains that in-place mutations are not re-resolved (geometry/labels can stay stale while tooltips and click callbacks see mutated objects).
  • docs/api.md: the formatAmount and getLabel rows now ask for stable callbacks, explain that a new identity rebuilds labels and restarts layout, and link to the stable-callbacks guide plus the correct getting-started section.
  • docs/api.md: adds a server-rendering section linking to the placeholder/resize guidance.
  • docs/customization.md: removes the old server/browser-identical claim and makes the callback example stable: module-level formatAmount/getLabel, explicit 'en-US' locale, and stable prop references.

Verification

  • npm run format — passed
  • npm run format:check — passed
  • npm run typecheck — passed
  • npm run lint — passed
  • Link/anchor check: 94/94 relative links and anchors valid across the 15 Markdown files.
  • SSR harness: non-empty graph emits only the plotHeight placeholder (no <svg>); empty graph emits "No flow data"; callbacks run during SSR and a window-using formatter throws.
  • Documentation callback pattern typechecked against the public package types.

Notes

Docs-only; no source, tests, dependencies or lockfile changes. No CHANGELOG entry because this is documentation clarification only.

@bwin
bwin merged commit 4fbce48 into dev Nov 3, 2026
2 checks passed
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