Skip to content

Export the gutter defaults from @nimblebrain/synapse/host (0.39.0) - #137

Merged
mgoldsborough merged 1 commit into
mainfrom
gutter-host
Nov 1, 2026
Merged

mgoldsborough merged 1 commit into
mainfrom
gutter-host

Conversation

@mgoldsborough

Copy link
Copy Markdown
Contributor

What

Exports GUTTER_DEFAULT, GUTTER_NARROW_DEFAULT and GUTTER_NARROW_BREAKPOINT from @nimblebrain/synapse/host as well as /ui. Version goes to 0.39.0 (minor, additive).

  • The three constants move from src/ui/tokens.ts into src/theme-defaults.ts. That module has no React dependency and already holds the token contract's defaults, which src/connect.ts and src/host/theme.ts share. src/ui/tokens.ts imports GUTTER_DEFAULT for tokens.gutter and re-exports all three, so /ui's public API does not change. AppFrame still imports them from ../tokens.js.
  • src/host/index.ts re-exports them. Its header comment now says a host may import them to match the kit's breakpoint and values.
  • README: adds the missing /host row to the export table. Docs: appframe.mdx and tokens.mdx say the constants come from /ui and also, without React, from /host.
  • CHANGELOG ## [0.39.0]. The 0.38.0 entry is already released (v0.38.0 is tagged and published), so it stays as written, and 0.39.0 records the correction: 0.38.0 said a host could test its values against these constants, but only /ui exported them, and that entry imports React.
  • package.json, package-lock.json and python/nimblebrain_synapse/__init__.py (__client_version__) are set to 0.39.0.

Why

0.38.0's CHANGELOG says "A host that supplies its own values can test them against these." A host without React could not do that, because /ui's index re-exports React components. /host is the React-free cross-host client, so that is where the constants go. This PR adds no new subpath.

Build checks

React in dist/host/: none. After npm run build I followed every relative import from dist/host/index.{js,cjs,d.ts,d.cts}, transitively: 6 runtime chunks, detect-*.d.{ts,cts}, and theme-defaults-*.d.{ts,cts}. grep -il react across that set matches no file, and none of those files has a bare (package) import. @modelcontextprotocol shows up only in a doc comment in detect-*.d.ts ("This layer intentionally has ZERO dependency on @modelcontextprotocol/*"). No file in the set imports it.

IIFEs. src/host/iife.ts is unchanged.

  • dist/connect.iife.global.js is byte-identical to the build from main.
  • dist/synapse-ui.iife.global.js is unchanged in content but differs in bytes. Both builds have 3139 tokens, and the only differences are a consistent one-to-one renaming of minified identifiers, the re-mangling the kit's guide describes when a module in the bundle gains exports. The gutter constants do not appear in it (tree-shaken). The vendored copy python/nimblebrain_synapse/_assets/synapse-ui.iife.js is re-copied from the build, as the guide requires. The constants sit at the end of theme-defaults.ts. Placed among the existing exports, they also changed the connect IIFE's bytes.

Test

  • npm run ci (lint, typecheck, build, size, test): passes, 39 files, 660 tests.
  • uv run pytest in python/: 30 passed.
  • src/__tests__/ui/layouts.test.tsx: the existing test that the three constants are exported from /ui still passes. A new test checks the same values from /host.

Out of scope

  • A /tokens subpath. Not added, because it would be a new permanent export surface for three constants.
  • Changing the NimbleBrain host to import these. That is a separate PR, after this version is published.
  • /host's type output and @modelcontextprotocol/*: no file imports it (see above), so nothing to change here.

@mgoldsborough

Copy link
Copy Markdown
Contributor Author

QA Review: PR #137

Scope: 12 files, +57/−17 · prepared review worktree; creation and dependency installation skipped as requested · reviewed: ec38e73 · CI: pending
Round: 1
Risk: LOW
Why this exists: Let hosts without React import the kit’s gutter defaults through the existing /host entry.

Critical (must fix)

None.

Fix in-PR

None.

Suggestions

None.

What Looks Good

  • ADDITIVE contract change: /host gains three exports while /ui retains the same constants and values.
  • Constants share one definition in a module with no imports; AppFrame retains its existing consumption path.
  • The new test checks all three host exports. Version metadata, documentation, and the vendored asset are updated together.
  • Independent token comparison of the old and new vendored IIFEs confirmed only consistent, one-to-one identifier renaming.

Body claims

  • Confirmed the constant relocation, preserved /ui exports, unchanged host IIFE entry, and aligned 0.39.0 version fields.
  • Supplied CI reports lint, typecheck, build, docs, both Node test jobs, and Python checks passing in the latest snapshot; browser conformance remains pending. The passing build includes size, asset freshness, and client-version checks.
  • Build-output dependency traversal, connect-IIFE byte identity, and exact test totals were not independently reproduced: build artifacts are absent, and this review must not write to the tree. No suite was rerun.
machine record
{
  "kind": "review",
  "pr": 137,
  "round": 1,
  "reviewed": "ec38e7346443e45f887a7a793e5f8d98f5bae361",
  "delta_base": null,
  "ci": "pending",
  "risk": "LOW",
  "stop_gate": "n/a",
  "verdict": "No findings; eligible for qa-reviewed once CI is green.",
  "label": "eligible-on-green",
  "findings": []
}

Reviewer: Codex (pr-loop round 1).

@mgoldsborough mgoldsborough added the qa-reviewed QA review completed with no critical issues label Oct 31, 2026
@mgoldsborough
mgoldsborough merged commit 2ecc2d3 into main Nov 1, 2026
8 checks passed
@mgoldsborough
mgoldsborough deleted the gutter-host branch November 1, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qa-reviewed QA review completed with no critical issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant