Skip to content

docs: clarify runtime semantics#60

Merged
saraeloop merged 1 commit intomainfrom
docs/callback-lifecycle-semantics
May 6, 2026
Merged

docs: clarify runtime semantics#60
saraeloop merged 1 commit intomainfrom
docs/callback-lifecycle-semantics

Conversation

@saraeloop
Copy link
Copy Markdown
Member

Summary

Clarifies Prism’s current runtime semantics in the README and docs.

This is a docs-only change that makes callback, invalidation, surface lifecycle, paintOnce(), and error behavior explicit before the technical preview announcement.

Changes

Updated:

  • README.md
  • apps/docs/content/docs/explanation/canvas-runtime.mdx
  • apps/docs/content/docs/explanation/invalidation.mdx
  • apps/docs/content/docs/explanation/register-surface.mdx
  • apps/docs/content/docs/explanation/canvas-surface.mdx
  • apps/docs/content/docs/explanation/paint-once.mdx
  • apps/docs/content/docs/reference/api.mdx

Covered

  • onPaint() and onUpdate() are additive callbacks.
  • Manual vs automatic invalidation.
  • Repeated registerSurface() behavior for the same element/runtime.
  • Wrong-runtime surface behavior.
  • Surface disposal after runtime.destroy().
  • Disposed surface behavior.
  • paintOnce() behavior:
    • works without start()
    • concurrent waiters resolve from the same pass
    • calls inside onPaint() wait for the next pass
    • pending waiters reject on destroy or paint handler errors
  • Prism does not expose a general event system or unsubscribe API today.

Verification

Passed:

  • pnpm --filter @prism/docs build
  • pnpm lint
  • pnpm typecheck
  • pnpm test

Notes

  • Documentation-only change.
  • No runtime behavior changed.
  • No public API changed.

Document Prism's current runtime contract more explicitly.

What changed:

- Clarify that onPaint() and onUpdate() are additive callbacks.

- Document manual vs automatic invalidation.

- Document repeated registerSurface() behavior for the same element/runtime.

- Document wrong-runtime surface behavior.

- Clarify that runtime.destroy() disposes registered surfaces.

- Document disposed surface behavior.

- Clarify paintOnce() behavior without start(), concurrent waiters,

  inside-paint calls, and pending waiter rejection.

- Document that Prism does not expose a general event system or unsubscribe API today.

Verification:

- pnpm --filter @prism/docs build

- pnpm lint

- pnpm typecheck

- pnpm test
@saraeloop saraeloop self-assigned this May 6, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
prism-docs Ready Ready Preview, Comment May 6, 2026 6:53pm

@saraeloop saraeloop merged commit 842e260 into main May 6, 2026
10 checks passed
@saraeloop saraeloop deleted the docs/callback-lifecycle-semantics branch May 6, 2026 18:54
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