Migrating from 0.4 to 0.5
0.5.0 prunes @elastic/isomer-sdk's public API to what a pack or a host calls, and changes where the build lives. Most removed names were internal plumbing: the function that takes or returns one is still exported, so a TypeScript utility type over it replaces an import. Where the 0.4 type took type arguments, pass them to the function with an instantiation expression (TypeScript 4.7 or later), as in typeof renderHTMLWithDispatcher<MyNode>; without them the recipe falls back to PrimitiveNode and the default context, and a callback typed for your own node no longer fits. Nothing below changes a Composition, a primitive's schema, or rendered output.
dist/is nowlib/. ESM for bundlers is underlib/esm, reached through themoduleandimportexport conditions; CommonJS is underlib/cjs, and Node loads it for bothrequireandimportthrough thenodecondition, whichmodulesits ahead of. Declarations sit beside the CommonJS. Import the entries (@elastic/isomer-sdk,@elastic/isomer-sdk/html, and so on); a deep import intodist/no longer resolves. An esbuild build for Node that states its ownconditionsaddsmoduleto keep the ESM; see Package facts.- New
./schemaentry. It holds what a pack's schemas need and reaches zod alone, so a schema module loads where React and a DOM cannot:z,requiredString,unresolvedBodyNodeSchema,assetUrl,navigationHref,ASSET_URL_RULE,NAVIGATION_HREF_RULE, and the typesPrimitiveNode,ActionEventRef,PrimitiveCatalogEntry, andPrimitiveExample. The root entry still exports all of them. @elastic/isomer-studiodepends on the SDK and runtime at its own version instead of peering them. A pack that installed either only to satisfy the Studio's peers can drop it; the Studio still resolves the SDK from the project when the project has it (How the config loads).
| 0.4 name | In 0.5 |
|---|---|
BODY_NODE_SURFACES |
SURFACE_NAMES; it was a deprecated alias |
ALL_NAMED_COLORS |
namedColorSchema.options |
NamedColorPalette |
Dropped. Write Partial<Record<NamedColor, string>> |
STRUCTURED_VALUE_FORMATS |
Dropped as internal; the StructuredValueFormat type stays |
isStructuredValue |
Dropped as internal. Test typeof value === 'object', or parse with structuredValueSchema |
rawDisplayValue |
Dropped. A DisplayValue is a string or a StructuredValue; read .raw from the object form |
renderThemeSchema |
Dropped as internal; the RenderTheme type stays |
BodyNodeBase |
Pick<PrimitiveNode, 'id' \| 'surfaces'> |
NormalizedPrimitiveExample<MyNode> |
ReturnType<typeof primitiveExamples<typeof myPrimitive>>[number], whose node is that primitive's node type; or write { name?: string; description?: string; node: MyNode } |
OPTIONAL_SURFACES, OptionalSurface |
Dropped as internal. Slack is the only optional surface; a pack declares it in surfaces |
ThemeTokenPath |
Dropped; it was string |
CapabilitySources |
Parameters<typeof describeCapabilities>[1] |
ComposedPacks |
ReturnType<typeof composePacks> |
PackStyleAdapter |
NonNullable<PrimitivePackInput['styleAdapter']>. A pack styled with Distillate declares distillery instead (Style adapters) |
FormatDisplayValueOptions |
NonNullable<Parameters<typeof formatDisplayValue>[1]> |
LayoutRect |
LayoutBox extends it; use Pick<LayoutBox, 'x' \| 'y' \| 'width' \| 'height'> |
PayloadMeasurement |
HTMLRenderResult['measurement'], from ./html |
PrimitiveDispatcherOptions |
NonNullable<Parameters<typeof createPrimitiveDispatcher>[1]> |
CompositionSchemaOptions |
Dropped as internal: it configured buildCompositionSchema, which no entry exports. getCompositionSchemaForDefinitions builds the schema |
CompositionValidatorOptions |
NonNullable<Parameters<typeof createCompositionValidator>[1]> |
UrlSchemaOptions |
NonNullable<Parameters<typeof assetUrl>[0]> |
| 0.4 name | In 0.5 |
|---|---|
HTMLDispatcherRenderOptions<MyNode, MyCollector, MyContext> |
Parameters<typeof renderHTMLWithDispatcher<MyNode, MyCollector, MyContext>>[1]; the collector and context default as before |
HTMLEnhancementScope |
Dropped as internal. An adapter's collectViewStyles and getScriptText still receive it; read it as Parameters<NonNullable<HTMLStyleAdapter['getScriptText']>>[2] |
ReactContentDispatcher<MyNode, MyContext> (both entries) |
Parameters<typeof renderCompositionContent<MyNode, MyContext>>[1]. Any object with renderReact, such as a PrimitiveDispatcher, satisfies it |
ReactContentOptions (both entries) |
NonNullable<Parameters<typeof renderCompositionContent>[3]> |
The individual Block Kit types are no longer exported. SlackBlock, the union every slack renderer returns, stays, with SlackRichTextBlockElement, SlackRichTextInline, SlackRichTextSection, SlackRichTextText, SlackTableCell, and SlackTagColor. Narrow the union by its type:
import type { SlackBlock } from '@elastic/isomer-sdk/slack';
type SlackSectionBlock = Extract<SlackBlock, { type: 'section' }>;
type SlackSectionAccessory = NonNullable<SlackSectionBlock['accessory']>;
That covers SlackActionsBlock, SlackContainerBlock, SlackContextBlock, SlackDividerBlock, SlackHeaderBlock, SlackImageBlock, SlackRichTextBlock, SlackSectionBlock, SlackTableBlock, and SlackVideoBlock; their element and object types (SlackActionElement, SlackButtonElement, SlackCheckboxesElement, SlackContainerChildBlock, SlackFileReference, SlackHeaderLevel, SlackImageElement, SlackMrkdwnTextObject, SlackMultiStaticSelectElement, SlackOptionGroup, SlackOptionObject, SlackOverflowElement, SlackPlainTextObject, SlackRadioButtonsElement, SlackRawTextElement, SlackRichTextLink, SlackRichTextList, SlackRichTextPreformatted, SlackRichTextQuote, SlackRichTextStyle, SlackRichTextTag, SlackSectionAccessory, SlackStaticSelectElement, SlackTableColumnSetting, SlackTextObject) are indexed from those the same way.
| 0.4 name | In 0.5 |
|---|---|
SlackLinkOptions |
Pick<SlackEnvelopeOptions, 'baseUrl'>; SlackEnvelopeOptions still extends it |
createSlackAssetCollector |
Dropped as internal. renderSlackEnvelope makes the collector and returns its requests as SlackEnvelopeResult.assets |
isSlackReachableImageUrl |
Dropped as internal; the envelope applies it to every image |
strike |
Dropped. Write `~${escapeMrkdwn(text)}~` |
| 0.4 name | In 0.5 |
|---|---|
SplitAuthoredMarkdownOptions |
NonNullable<Parameters<typeof splitAuthoredMarkdown>[1]> |
| 0.4 name | In 0.5 |
|---|---|
AuthoredSpec |
ReturnType<typeof readAuthoredSpec> |
AuthoredChildField |
AuthoredSpec['children'][number], with AuthoredSpec as above |
AuthoredTextField |
AuthoredSpec['text'][number] |
AuthoredNodesField |
NonNullable<AuthoredSpec['nodes']>[number] |
AuthorComponent, PrimitiveComponentMap |
Dropped as internal. Each component is a property of the JsxShim that buildJsxShim returns, such as JsxShim['Composition'] |
AUTHORING_PROFILE_IDS |
Dropped. The AuthoringProfileId type stays: 'general' \| 'registered-view-router' \| 'compose-from-primitives' |
| 0.4 name | In 0.5 |
|---|---|
PrimitiveConformanceCase |
Pick<Row, 'name' \| 'run'>, where Row is ReturnType<typeof primitiveConformanceRows>[number], a case and an example in one |
PrimitiveConformanceExample |
Parameters<Row['run']>[0], the example a case's run receives |
PackRegistrationOptions |
Parameters<typeof assertPackRegistrationComplete>[0] |
@elastic/charts74.@elastic/isomer-charts-elasticpeers^74.0.0instead of^73.5.0, so a host on 73.x upgrades@elastic/chartsbefore the engine (Elastic Charts engine).- Node 22.13.0 or later for
@elastic/isomer-image-takumi,@elastic/isomer-primitives-charts, and@elastic/isomer-charts-elastic; each declares it inengines.
- Root.
FrameSizing(Frame.sizing:fixedorcontent),FrameEstimateViewport, andSnapshotHeightOptionsfor content-sized snapshot frames (Frame).PackInputBudget, the limits a pack declares ininputBudget.PackDistillery,DistilleryCollector, andDistilleryHandlefor a pack styled with Distillate, each generic over the handle type.StyledRenderContext<THandle>typesresolveClassNameby the styling engine's handle, so an adapter or live context written for Distillate drops itsas unknown as StyleHandle[]cast; the parameter defaults toStyleHandle, so existing code compiles unchanged.layoutWidthOf,withLayoutWidth,contextWith, andstyleScopeOffor the width a node is laid out in and the context a container hands a child. ./html.collectHTMLStyles, the style pass for a surface that draws its own markup;createDistillateStyleAdapterandDistilleryCollectors, the adapter the runtime builds from its packs'distilleryfields; its context'sresolveClassNametakes the distilleries' own handle, so its type isHTMLStyleAdapter<PrimitiveNode, DistilleryCollectors<THandle>, StyledRenderContext<THandle>>, withTHandleinferred fromPackDistillery<THandle>andDistilleryHandleby default../slack.slackLimitProblemsandunmodeledSlackBlockTypes, to check a payload againstSLACK_LIMITS(Checking a Slack payload).clampMrkdwn, which clampsmrkdwnwithout cutting a link, mention, or entity, andclampEscapedMrkdwn, which escapes plain text and fits it to a limit however much escaping grows it, without the entity a clamp afterescapeMrkdwncan cut or the overflow a clamp before it can leave../author.checkCompositionandCompositionCheck, which parse, validate, and apply a frame's body rule to model output in one call;describePropsandPropDescriptorfor props tables;PrintCompositionRoot, therootprintCompositionJsxprints as<Composition>props../testing.customChecksOfandCustomChecksOptions, every custom check reachable from a schema.
The API reference describes each in full.