@flyos/design-system-board
v1.0.2
Published
FlyOS design system — structured Tool x Perspective canvas board with an optional Yjs CRDT model. Deliberately NOT part of the design-system bundle or its Native Federation singleton: it carries the Yjs stack, which only board-using apps should pay for.
Maintainers
Readme
@flyos/design-system-board
FlyCanvasBoardComponent (<fly-canvas-board>) — the structured-grid /
matrix collaborative board (Tool × Perspective), extracted out of
@flyos/design-system so the core design system doesn't carry the yjs
dependency.
This package is deliberately NOT a Native Federation shared singleton —
unlike @flyos/design-system, it is not registered in the shell's
federation.config.js shared block. Only the apps that actually use the
canvas board pull it in.
yjs is an optional peer dependency, not a bundled one
yjs is declared under peerDependencies (with peerDependenciesMeta.yjs.optional
= true), never under dependencies. This is load-bearing, not cosmetic: a
Y.Doc is only interoperable with other Y.Doc instances created from the
same module instance of yjs — Yjs relies on instanceof checks and
module-level shared state internally. If this package bundled its own copy of
yjs, any host that also uses yjs (e.g. through yjs-bridge or another
Yjs-backed feature) would end up with two separate yjs module instances,
and cross-instance Y.Doc/Y.applyUpdate operations would silently fail or
throw. Keeping yjs a peer dependency guarantees a single yjs instance
across the whole federation, resolved once by the host application.
Only import canvasBoardFromSnapshot / canvasBoardToSnapshot /
applyCanvasBoardOp (the optional canvas-board-model.ts surface) if your
host already depends on yjs for realtime collaboration through the
yjs-bridge sidecar. FlyCanvasBoardComponent itself never imports yjs —
it is a pure data-contract renderer (bind a FlyCanvasBoardSnapshot, react to
typed FlyCanvasBoardOps via (op)).
