Skip to content

FoldKit 0.167 compatibility

This migration covers both 0.166 and 0.167 because the compatibility branch started at 0.165.0. Main subsequently shipped 0.166 support; release integration preserves that work and its shared dataset explorer. All five workspaces use FoldKit 0.167.0, Effect 4.0.0, and the Vite plugin 0.27 line. The FoldKit Oxlint plugin is upgraded to 0.15.3. Release preparation upgrades Astro from 7.1.1 to 7.2.8 for the AVIF-processing and base-path security fixes.

Application changes

Previous APICurrent API
Subscription.animationFrameSubscription.animationFrameEntry
Subscription.persistentSubscription.persistentEntry
Port.subscriptionPort.subscriptionEntry
Subscription.fromMediaQueryDom.streamFromMediaQuery
Subscription.fromEventDom.streamFromEvent
Subscription.keyBindingsDom.streamFromKeyBindings
Subscription.lift({ toChildModel })Subscription.lift({ read })

The lift reader returns Option.some(child) for an always-present child or the existing Option for an optional child. ManagedResource.lift also uses the read field. Entry factories still belong inside Subscription.make. The toMessage and toParentMessage callbacks retain their names.

Astro ownership and build identity

Use integrations: [foldkit()]. The plugin generates the build identity and bundles FoldKit dependencies across Astro’s named environments. The promo app no longer needs its custom prerender bundling plugin.

The integration permits an absent legacy import.meta.env.FOLDKIT_BUILD_ID override so FoldKit can use its compiled identity. Existing explicit server.buildId and FOLDKIT_BUILD_ID overrides remain supported. Blank server.buildId options fail, and an unconfigured renderer outside a coordinated Vite build still fails with MissingBuildId. Independently built client and server artifacts require the same unique public deployment ID.

The upstream plugin still supplies a legacy development override while serving locally. Production build tests reject that stamp and check the shared generated identity in the prerendered HTML, client bundle, and server bundle.

Astro retains document and asset ownership. definePage, resolvePageDocument, lazyApp, and the navigation bridge retain their public contracts. FoldKit’s standalone Server.renderDocument, ssr.build, and @foldkit/node are not required by the Astro integration.

Viz and downloadable examples

The package peer range is >=0.167.0 <0.168.0. FoldKit and Effect remain optional for pure geometry consumers; foldkit/cartesian uses the host’s render-scoped builder. No fetching or lifecycle runtime is introduced into Viz.

Promo ZIP and StackBlitz projects, including comparison and the dataset explorer, use the same FoldKit and Vite-plugin versions. Their client-only Vite builds retain index.html; the new template-free build contract applies to FoldKit’s standalone SSR/SSG pipeline.

Qualification

  • Run bun run check, bun typecheck, and bun run test for all five workspaces.
  • Build both apps, Storybook, and TypeDoc.
  • Check packed imports in Node and Bun, optional Viz peers, and standalone line, histogram, and scatter downloads.
  • Verify automatic and explicit IDs in SSG HTML, browser and server artifacts, request SSR, and existing island lifecycle tests.
  • Exercise hydrated pages in a browser before claiming browser acceptance.

Local results

The compatibility slice passed lint/format checking, all four workspace typechecks, and 388 tests: Astro 77, Viz 168, promo 37, and web 106. Automatic and explicit build IDs passed the integration checks; all three downloadable projects installed, typechecked, and built outside the workspace.

Both production apps, Storybook, and TypeDoc built successfully. TypeDoc reports 11 missing-reference warnings, and Storybook reports its large-chunk warning; these builds are not warning-free.

Firefox production-preview checks verified language and title updates on both request-rendered and prerendered greeting pages, Stateflow step/play through eight transitions with outbound emissions, and promo line controls updating the generated settings. This is focused browser smoke coverage, not a full accessibility or cross-browser qualification. Publication remains separate.

Upstream: 0.166 release, 0.167 release, Vite plugin changelog.