|
| 1 | +--- |
| 2 | +outline: deep |
| 3 | +--- |
| 4 | + |
| 5 | +# Migrating to 0.9 |
| 6 | + |
| 7 | +0.9 removes the compatibility shims that were deprecated across the 0.7 series. Each removed export has a drop-in replacement that has shipped alongside it since 0.7, so migrating is a matter of updating import paths and a handful of call sites. This page covers the changes between 0.8.x and 0.9. |
| 8 | + |
| 9 | +## `devframe/adapters/cli` is removed |
| 10 | + |
| 11 | +The CLI adapter was renamed to `cac` in 0.7. The `devframe/adapters/cli` entry — `createCli`, `CreateCliOptions`, and `CliHandle` — is now gone. Import from `devframe/adapters/cac` instead: |
| 12 | + |
| 13 | +| 0.8.x | 0.9 | |
| 14 | +|-------|-----| |
| 15 | +| `import { createCli } from 'devframe/adapters/cli'` | `import { createCac } from 'devframe/adapters/cac'` | |
| 16 | +| `CreateCliOptions` | `CreateCacOptions` | |
| 17 | +| `CliHandle` | `CacHandle` | |
| 18 | + |
| 19 | +```ts |
| 20 | +// 0.8.x |
| 21 | +import { createCli } from 'devframe/adapters/cli' |
| 22 | + |
| 23 | +await createCli(devframe).parse() |
| 24 | +``` |
| 25 | + |
| 26 | +```ts |
| 27 | +// 0.9 |
| 28 | +import { createCac } from 'devframe/adapters/cac' |
| 29 | + |
| 30 | +await createCac(devframe).parse() |
| 31 | +``` |
| 32 | + |
| 33 | +The typed-flag helpers `defineCliFlags` and `parseCliFlags` live on `devframe/adapters/cac` too. See [CLI (cac)](/adapters/cac) for the full adapter reference. |
| 34 | + |
| 35 | +## `devframe/recipes/open-helpers` is removed |
| 36 | + |
| 37 | +The recipe was renamed to `common-rpc-functions` in 0.7.16. Import `commonRpcFunctions` from `devframe/recipes/common-rpc-functions`: |
| 38 | + |
| 39 | +```ts |
| 40 | +// 0.8.x |
| 41 | +import { openHelpers } from 'devframe/recipes/open-helpers' |
| 42 | +``` |
| 43 | + |
| 44 | +```ts |
| 45 | +// 0.9 |
| 46 | +import { commonRpcFunctions } from 'devframe/recipes/common-rpc-functions' |
| 47 | +``` |
| 48 | + |
| 49 | +The `openInEditor` and `openInFinder` members are unchanged. See [Common RPC functions](/helpers/common-rpc-functions) for the full reference. |
| 50 | + |
| 51 | +## RPC dump re-exports move to `devframe/rpc/dump` |
| 52 | + |
| 53 | +The static-dump helpers and types are served from the dedicated `devframe/rpc/dump` entry; the aliases that re-exported them from the top-level `devframe/rpc` barrel are removed. Import them from `devframe/rpc/dump`: |
| 54 | + |
| 55 | +```ts |
| 56 | +// 0.8.x |
| 57 | +import { createClientFromDump, dumpFunctions } from 'devframe/rpc' |
| 58 | + |
| 59 | +// 0.9 |
| 60 | +import { createClientFromDump, dumpFunctions } from 'devframe/rpc/dump' |
| 61 | +``` |
| 62 | + |
| 63 | +This applies to every dump export — `collectStaticRpcDump`, `createClientFromDump`, `dumpFunctions`, `getDefinitionsWithDumps`, `reviveDumpError`, `serializeDumpError`, and the `StaticRpcDump*` types. |
| 64 | + |
| 65 | +## `@devframes/hub` json-render shims are removed |
| 66 | + |
| 67 | +json-render moved out of the hub into the opt-in [`@devframes/json-render`](./json-render) integration in 0.7. The hub-local compatibility shims are now removed: the `defineJsonRenderSpec` helper, the `ctx.createJsonRenderer` factory, the `DevframeViewJsonRender` dock type, and the `JsonRenderSpec` / `JsonRenderElement` / `JsonRenderer` types. |
| 68 | + |
| 69 | +| 0.8.x (`@devframes/hub`) | 0.9 (`@devframes/json-render`) | |
| 70 | +|---|---| |
| 71 | +| `defineJsonRenderSpec(spec)` | Pass the spec directly to `createJsonRenderView(ctx, { id, spec })` | |
| 72 | +| `ctx.createJsonRenderer(spec)` | `createJsonRenderView(ctx, { id, spec })` (from `@devframes/json-render/node`) | |
| 73 | +| `JsonRenderSpec` | `DevframeJsonRenderSpec` | |
| 74 | +| `JsonRenderElement` | element shape of `DevframeJsonRenderSpec` | |
| 75 | +| `JsonRenderer` | `JsonRenderView` | |
| 76 | +| `DevframeViewJsonRender` | `DevframeJsonRenderDockEntry` (from `@devframes/json-render/hub`) | |
| 77 | + |
| 78 | +```ts |
| 79 | +// 0.8.x |
| 80 | +import { defineJsonRenderSpec } from '@devframes/hub' |
| 81 | + |
| 82 | +const spec = defineJsonRenderSpec({ root: 'panel', elements: { /* ... */ } }) |
| 83 | +const renderer = ctx.createJsonRenderer(spec) |
| 84 | +``` |
| 85 | + |
| 86 | +```ts |
| 87 | +// 0.9 |
| 88 | +import { createJsonRenderView } from '@devframes/json-render/node' |
| 89 | + |
| 90 | +const view = createJsonRenderView(ctx, { |
| 91 | + id: 'panel', |
| 92 | + spec: { root: 'panel', elements: { /* ... */ } }, |
| 93 | +}) |
| 94 | +``` |
| 95 | + |
| 96 | +`createJsonRenderView` returns a view carrying a serializable `ref` (a shared-state key or an inline spec). Project it onto a hub dock with `toJsonRenderDockEntry` from `@devframes/json-render/hub`, which contributes the `'json-render'` dock type to the hub's open dock union. A dock entry now carries that serializable `view` ref rather than a live renderer handle — a client reads `entry.view.stateKey` (or `entry.view.spec`) to render it. |
| 97 | + |
| 98 | +See [JSON-Render](./json-render) for the full integration reference. |
0 commit comments