﻿---
title: Migrating from 0.4 to 0.5
description: 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:...
url: https://docs-v3-preview.elastic.dev/isomer/sdk/migrating
---

# 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.

## The build

- **`dist/` is now `lib/`.** ESM for bundlers is under `lib/esm`, reached through the `module` and `import` export conditions; CommonJS is under `lib/cjs`, and Node loads it for both `require` and `import` through the `node` condition, which `module` sits ahead of. Declarations sit beside the CommonJS. Import the entries (`@elastic/isomer-sdk`, `@elastic/isomer-sdk/html`, and so on); a deep import into `dist/` no longer resolves. An esbuild build for Node that states its own `conditions` adds `module` to keep the ESM; see [Package facts](/isomer/sdk#package-facts).
- **New `./schema` entry.** 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 types `PrimitiveNode`, `ActionEventRef`, `PrimitiveCatalogEntry`, and `PrimitiveExample`. The root entry still exports all of them.
- **`@elastic/isomer-studio` depends 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](/isomer/studio/config#how-the-config-loads)).


## Removed from the root entry


| 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](/isomer/sdk/rendering#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]>`                                                                                                                                    |


## Removed from `./html` and `./react`


| 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]>`                                                                                                          |


## Removed from `./slack`

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`:
```ts
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)}~``                                                                              |


## Removed from `./markdown`


| 0.4 name                       | In 0.5                                                     |
|--------------------------------|------------------------------------------------------------|
| `SplitAuthoredMarkdownOptions` | `NonNullable<Parameters<typeof splitAuthoredMarkdown>[1]>` |


## Removed from `./author`


| 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'`               |


## Removed from `./testing`


| 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]`                                                                           |


## Requirements

- **`@elastic/charts` 74.** `@elastic/isomer-charts-elastic` peers `^74.0.0` instead of `^73.5.0`, so a host on 73.x upgrades `@elastic/charts` before the engine ([Elastic Charts engine](https://docs-v3-preview.elastic.dev/isomer/charts-elastic)).
- **Node 22.13.0 or later** for `@elastic/isomer-image-takumi`, `@elastic/isomer-primitives-charts`, and `@elastic/isomer-charts-elastic`; each declares it in `engines`.


## What arrived

- **Root.** `FrameSizing` (`Frame.sizing`: `fixed` or `content`), `FrameEstimateViewport`, and `SnapshotHeightOptions` for content-sized snapshot frames ([Frame](https://docs-v3-preview.elastic.dev/isomer/sdk/frame)). `PackInputBudget`, the limits a pack declares in `inputBudget`. `PackDistillery`, `DistilleryCollector`, and `DistilleryHandle` for a pack styled with Distillate, each generic over the handle type. `StyledRenderContext<THandle>` types `resolveClassName` by the styling engine's handle, so an adapter or live context written for Distillate drops its `as unknown as StyleHandle[]` cast; the parameter defaults to `StyleHandle`, so existing code compiles unchanged. `layoutWidthOf`, `withLayoutWidth`, `contextWith`, and `styleScopeOf` for 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; `createDistillateStyleAdapter` and `DistilleryCollectors`, the adapter the runtime builds from its packs' `distillery` fields; its context's `resolveClassName` takes the distilleries' own handle, so its type is `HTMLStyleAdapter<PrimitiveNode, DistilleryCollectors<THandle>, StyledRenderContext<THandle>>`, with `THandle` inferred from `PackDistillery<THandle>` and `DistilleryHandle` by default.
- **`./slack`.** `slackLimitProblems` and `unmodeledSlackBlockTypes`, to check a payload against `SLACK_LIMITS` ([Checking a Slack payload](/isomer/sdk/rendering#checking-a-slack-payload)). `clampMrkdwn`, which clamps `mrkdwn` without cutting a link, mention, or entity, and `clampEscapedMrkdwn`, which escapes plain text and fits it to a limit however much escaping grows it, without the entity a clamp after `escapeMrkdwn` can cut or the overflow a clamp before it can leave.
- **`./author`.** `checkComposition` and `CompositionCheck`, which parse, validate, and apply a frame's body rule to model output in one call; `describeProps` and `PropDescriptor` for props tables; `PrintCompositionRoot`, the `root` `printCompositionJsx` prints as `<Composition>` props.
- **`./testing`.** `customChecksOf` and `CustomChecksOptions`, every custom check reachable from a schema.

The [API reference](https://docs-v3-preview.elastic.dev/isomer/sdk/api) describes each in full.