Dependencies
Some widgets rely on third-party libraries that GolemUI deliberately doesn’t bundle — typically because the choice of library is opinionated. The Markdown widget needs a markdown parser; you might want to add others. These come in through formConfig.dependencies.
The dependency contract
Section titled “The dependency contract”import { Dependencies } from '@golemui/gui-shared';
const formConfig: { dependencies?: Dependencies } = { dependencies: { markdown: { parse: (md: string) => snarkdown(md), }, },};Each widget that uses a dependency reads it from formConfig.dependencies at render time. If the widget needs a dependency you haven’t provided, it renders gracefully (e.g. the Markdown widget shows the editor but leaves the preview blank).
Available dependency keys
Section titled “Available dependency keys”| Key | Used by | Shape |
|---|---|---|
markdown | Markdown, Markdown Text | { parse: (md: string) => string } |
See also
Section titled “See also”- Widgets Reference / Markdown — example with snarkdown.