Skip to content

Pin FoldKit 0.156.0 and migrate the two changed APIs - #3

Merged
birbprophet merged 3 commits into
mainfrom
chore/foldkit-0.156.0
Aug 30, 2026
Merged

birbprophet merged 3 commits into
mainfrom
chore/foldkit-0.156.0

Conversation

@birbprophet

Copy link
Copy Markdown
Owner

Why

FoldKit 0.156.0 is the current release. This library, storybook-renderer-foldkit, and astro-renderer-foldkit need to sit on one runtime version, because FoldKit's render frame is module-local and a view built by a second instance of the library renders nothing. That is the same reason overrides.foldkit exists here, so the override and the dependency move together.

Two APIs this library uses changed in the release, so the bump is not only version numbers. Both changes are mechanical and confined to six files.

Scope

package.json moves dependencies.foldkit and overrides.foldkit from 0.153.0 to 0.156.0, devDependencies.@foldkit/vite-plugin from 0.19.0 to 0.20.0, and devDependencies.@foldkit/oxlint-plugin from 0.8.0 to 0.11.0. It also retargets the storybook-renderer-foldkit git dependency from 8aa6d28 to a1624e3, the head of that repository's own FoldKit 0.156.0 branch. That retarget is load-bearing rather than tidiness. Left at the old commit the git dependency pulls its own foldkit@0.152.0 into the tree, and foldkit@0.156.0 is now the only foldkit version in bun.lock.

h.OnClickFocus was removed from foldkit/html. Its behavior moved onto OnClick's new optional second parameter, ClickOptions, which carries focusSelector. Five call sites move from h.OnClickFocus(selector, message) to h.OnClick(message, { focusSelector: selector }), with the argument order flipping. They are in src/application/filters-advanced-menu.ts, src/application/share-project-menu.ts, src/base/dropdown.ts, and src/internal/context-menu-primitives.ts.

Mount.define and Mount.defineStream stopped currying. Each now takes one config object, define(name, { messages, execute }), and execute receives the live element as a named field rather than a positional parameter. Two definitions move, ScrollCalendarToFirstEvent in src/internal/calendar-runtime.ts and ObserveTextEditor in src/internal/text-editor-runtime.ts. The text editor diff is large only because the body re-indents. Its listeners, acquireRelease pairing, and cleanup are unchanged.

README.md moves the tooling pin line from foldkit 0.153 to foldkit 0.156. The same line claimed pnpm workspaces and a pnpm-workspace.yaml, which no longer exist in this repository, so it now names bun workspaces and the commands CI actually runs.

The first commit is a separate, revertable slice. vp check was already red on the base commit over three oxfmt nits, and one of them wanted the overrides block moved below peerDependencies in the very file this bump edits. vp check --fix resolves them, and keeping it out of the bump commit leaves the bump a pure version-and-API diff.

Tradeoffs

The base is base/main-local, not main. Local main is twelve commits ahead of origin/main and unpushed, and those twelve commits are where foldkit@0.153.0, @foldkit/vite-plugin, @foldkit/oxlint-plugin, and the bun migration were introduced. base/main-local is that exact local main tip, 03806ed, pushed under a name that is not the default branch. Targeting main would have made this a fourteen-commit pull request carrying twelve commits of unrelated component and packaging work under a dependency-bump title. Push local main and retarget this with gh pr edit --base main when you are ready, then delete base/main-local.

Unlike its two sibling repositories, this one has no single compatibility-boundary file, so the bump could not be confined to one module by design. 620 files under src/ import FoldKit, 618 of them from foldkit/html. That is the risk this change ran into and got lucky on. Only six files touch the two APIs that moved. A release that changes HtmlBuilder itself would land on every component port at once, and it would be worth introducing a boundary before that happens.

Blast Radius

Consumers install this library by commit, so nothing moves until a consumer retargets its SHA. Within the library, the five OnClickFocus sites are menu and dropdown items whose click both dispatches a message and returns focus to the trigger, so the affected surface is dropdown, context menu, share-project menu, and the advanced filters menu. The two Mount definitions drive calendar initial scroll and the rich text editor's input and selection observation.

One risk this gate does not cover. The type checker proves the new call shapes are correct and every test still passes, but focusSelector timing and mount lifecycle are DOM-level behaviors that this package's suite does not drive. If 0.156.0 changed when focus is applied relative to dispatch, that would not surface here.

Verification

Ran bun install, vp check, and vp test, first at the base commit and then after the bump, so a bump-caused failure was distinguishable from a pre-existing one. The final gate was then re-run independently against the pushed commit.

Baseline at 03806ed: vp test exit 0 with 531 test files and 611 tests passing, and vp check exit 1. That failure was pre-existing and cosmetic. Oxfmt flagged README.md, package.json, and tests/catalog.test.ts, and because vp check stops at the format stage, lint and typecheck never ran. vp check --no-fmt recovered the real baseline and passed clean over 1890 files, which is what makes the post-bump errors attributable to the bump.

After the bump and before any fix, vp check exit 1 with 57 errors. They reduced to the two API changes above, not 57 separate problems. Every TS18046 in the text editor was cascade from the broken defineStream shape and cleared once the definition was right.

Final state on this branch: bun install exit 0, vp check exit 0 over 1904 formatted and 1890 linted and typechecked files, vp test exit 0 with 531 test files and 611 tests passing. The test counts match the baseline exactly, so nothing was skipped, deleted, or suppressed to reach green. No as or any cast and no lint-rule relaxation was used.

https://claude.ai/code/session_01BF1v1wNNipspj3CZuBS2ae

These three files were already failing `vp check` on main; the formatter
bails before lint and type check, so the gate was red before any dependency
change. Fixing them in their own commit keeps the FoldKit bump that follows
a pure version-number diff.

Claude-Session: https://claude.ai/code/session_01BF1v1wNNipspj3CZuBS2ae
…dency

foldkit and its override move together so tsc keeps seeing one HtmlBuilder,
@foldkit/vite-plugin goes to 0.20.0, and @foldkit/oxlint-plugin to 0.11.0.
storybook-renderer-foldkit retargets to a1624e35, the tip of that repo's own
chore/foldkit-0.156.0 branch. Left at the old SHA the git dependency drags
foldkit 0.152.0 back into the tree; the lockfile now resolves a single
foldkit@0.156.0.

Two FoldKit APIs changed under this bump. h.OnClickFocus(selector, message) is
gone, and the focus behaviour now rides on h.OnClick's optional ClickOptions as
{ focusSelector }. Mount.define and Mount.defineStream no longer curry a
name-and-schemas call over an execute function; each takes one config object of
{ args?, messages, execute }, and execute receives the live element as a named
field. Five call sites and two mount definitions across six files are the whole
affected surface.

The README's tooling pins now read foldkit 0.156, and its install line names bun
instead of pnpm. Commit 9b0beeb dropped the pnpm lockfile and workspace file
that line still pointed at.

Claude-Session: https://claude.ai/code/session_01BF1v1wNNipspj3CZuBS2ae
@birbprophet
birbprophet changed the base branch from base/main-local to main August 30, 2026 23:26
@birbprophet
birbprophet merged commit 304164d into main Aug 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant