Compatibility policy
This policy applies from sfn-diagram 2.0.0 on (#523). Upgrading from 1.x? See Migrating to 2.0.
sfn-diagram follows semantic versioning. A breaking change to anything covered below ships only in a major release, with the exceptions listed under Output unions and Runtime support.
Covered by semver
Section titled “Covered by semver”- The exported functions, classes, constants and types of
sfn-diagram,sfn-diagram/html,sfn-diagram/aws,sfn-diagram/cfn,sfn-diagram/terraform,sfn-diagram/png,sfn-diagram/elementandsfn-diagram/element/auto. - The
sfn-diagram/package.jsonandsfn-diagram/config.schema.jsonexport paths. - Documented CLI flags, exit codes and config-file keys.
- Documented
data-*attributes on rendered output (data-state-id,data-edge-id) and documented CSS classes. - Marker ids in standalone SVG output (
generateSvg,generateExecution,generateDiff):<idPrefix>arrowhead-<type>for the edge typesnormal,error,choice,defaultandretry, when you passidPrefix(''for barearrowhead-<type>). - The
<sfn-diagram>element’s documented attributes and properties, and itssfn-errorevent. - Documented environment variables:
SFN_DIAGRAM_PNG_FONT_DIRS,SFN_DIAGRAM_PNG_FONT_FAMILY,SFN_DIAGRAM_PNG_LOAD_SYSTEM_FONTSandSFN_DIAGRAM_GITLAB_TOKEN. - Warning codes that sfn-diagram passes to
process.emitWarning(prefixedSFN_DIAGRAM_), which you can filter on with Node’s--disable-warning.
Not covered
Section titled “Not covered”- Rendered geometry: node positions and sizes. A layout fix may move pixels in a patch release. Snapshotting exact SVG output is your call.
sfn-diagram/ci, which is marked@experimental. Its supported consumers are the GitHub Action and thesfn-diagram comment gitlabsubcommand; pin an exact version if you build on it directly.- The layout engine types (
LayoutEngineInput,LayoutEngineOutputand the types they use), marked@experimentaluntil pluggable layout engines ship (#545). No render function accepts an engine yet. - The interactive viewer’s embedded JSON blobs (
#sfn-state-data,#sfn-relayout-modeland the others), the contents ofViewerUpdate.relayoutModel(typedunknown: pass it through unchanged), and any DOM not listed above as a hook. - The message text of warnings and errors. The warning codes are covered.
- The default marker-id prefix (a hash of the rendered output, which changes whenever
the output does), the numbered
arrowhead-override-<n>variants, the marker ids of the interactive viewer’s collapsed view (<idPrefix>collapsed-arrowhead-<type>today), and the<sfn-diagram>element’s marker ids (sfn-el<n>-arrowhead-<type>, numbered in creation order).
Output unions may grow in a minor
Section titled “Output unions may grow in a minor”Adding a member to a union that sfn-diagram returns is not a breaking change. That
applies to ExecutionStateStatus, TimelineEntryStatus, LintCode, EdgeType and
NodeType. If you switch on one, give the switch a default: branch:
import type { ExecutionStateStatus } from 'sfn-diagram';
function label(status: ExecutionStateStatus): string { switch (status) { case 'succeeded': return 'OK'; case 'failed': return 'Failed'; default: return status; }}Runtime support
Section titled “Runtime support”An end-of-life Node line may be dropped in a minor release, as an exception to the
promise above. When that happens,
engines.node rises and the changelog says so. See Runtime support
for what each entry point needs today.
Deprecations
Section titled “Deprecations”An API is marked @deprecated in at least one minor release before a major release
removes it, and the removal is listed in that major’s migration guide
(Migrating to 2.0 for 2.0).
Other packages
Section titled “Other packages”The GitHub Action, sfn-diagram-react and the VS Code extension have their own
versions and changelogs.