Skip to content

build(deps)!: make shared vis packages and regl peer dependencies - #326

Merged
lanesawyer merged 1 commit into
mainfrom
lane/peer-dependencies
Nov 4, 2026
Merged

lanesawyer merged 1 commit into
mainfrom
lane/peer-dependencies

Conversation

@lanesawyer

@lanesawyer lanesawyer commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

What

Make @alleninstitute/vis-core, @alleninstitute/vis-geometry, and regl peer dependencies of the packages that build on them, so consumers end up with a single shared copy instead of mismatched duplicates. Follow-up to the discussion in #320.

Why

workspace:* publishes as an exact version, so each package currently pins its own copy of the shared packages. For example, the latest vis-dzi on npm depends on vis-core@0.0.6 and vis-geometry@0.0.8, while the latest vis-omezarr depends on vis-core@0.1.5 and vis-geometry@0.1.1. An app using both installs two copies of each.

#320 hit this with CartesianPlane, but the same problem affects anything that crosses package boundaries:

  • VisZarrError extends VisError: with two copies of core, e instanceof VisError silently fails
  • Classes with #private fields (SharedPriorityCache, PriorityCache, RenderServer, WorkerPool) that the consumer builds and passes into omezarr, dzi, or scatterbrain
  • regl: the consumer owns the context. Scatterbrain was pinned to 2.1.0 while everything else used 2.1.1, which is why the scatterbrain demo needed a @ts-expect-error

How

Dependencies

  • core: vis-geometry and regl moved to peerDependencies
  • dzi, omezarr, scatterbrain: vis-core, vis-geometry, and regl moved to peerDependencies
  • Internal peers use workspace:^, which publishes as a caret range (e.g. ^0.1.5). Since a 0.x minor bump is our breaking change, that accepts patch releases only. regl uses ^2.1.0.
  • Each peer is also a devDependency (workspace:* / regl@2.1.1) so the workspace still links locally
  • Removed the now-unneeded @ts-expect-error in site/src/examples/scatterbrain/demo.tsx

Packed manifest for omezarr, checked with pnpm pack:

"dependencies": { "zarrita": "0.6.1", "zod": "4.4.3" },
"peerDependencies": { "@alleninstitute/vis-core": "^0.1.5", "@alleninstitute/vis-geometry": "^0.1.1", "regl": "^2.1.0" }

Tooling

  • Replaced .npmrc (save-exact=true) with saveExact: true in pnpm-workspace.yaml
  • Added [bump] breaking_always_bump_major = false to cliff.toml. Without it, git-cliff's default would release this breaking commit as 1.0.0 for every package. With it, the next releases come out as core 0.2.0, omezarr 0.3.0, scatterbrain 0.2.0, and dzi 0.1.0.

Docs

  • Package install pages now include the peer dependencies in the npm/pnpm/yarn commands
  • New "Peer Dependencies" sections in getting-started/using-packages.md (for consumers) and developers/dependencies.md (the rule for what should be a peer, and how to widen ranges)
  • Removed the obsolete GitHub Packages auth page; the packages are public on npmjs
  • README: fixed the registry description, the 0.0.x versioning note, the missing vis-scatterbrain entry, and the dead docs/*.md links

Breaking change

Consumers must install @alleninstitute/vis-core, @alleninstitute/vis-geometry, and regl alongside the packages that depend on them. npm 7+ and pnpm install peers automatically; Yarn does not. The commit is marked ! / BREAKING CHANGE so it appears in each package's changelog.

PR Checklist

  • Is your PR title following our conventional commit naming recommendations?
  • Have you filled in the PR Description Template?
  • Is your branch up to date with the latest in main?
  • Do the CI checks pass successfully?
  • Have you smoke tested the example applications?
  • Did you check that the changes meet accessibility standards?
  • Have you tested the application on these browsers?
    • Chrome (Fully supported)
    • Firefox (Major bug fixes supported)
    • Safari (Major bug fixes supported)

Locally: pnpm build, pnpm typecheck, pnpm test, and pnpm fmt:check pass. The examples were built but not smoke tested in a browser.

🤖 Generated with Claude Code

- Move vis-core, vis-geometry, and regl to peerDependencies (workspace:^)
  in core, dzi, omezarr, and scatterbrain, keeping them as devDependencies
  for local linking
- Align regl to 2.1.1 across the workspace and drop the now-unneeded
  @ts-expect-error in the scatterbrain demo
- Replace .npmrc with saveExact in pnpm-workspace.yaml
- Configure git-cliff so breaking changes bump the 0.x minor version
  instead of jumping to 1.0.0
- Document peer dependency installs and policy; remove the obsolete
  GitHub Packages auth page and fix stale README/docs references

BREAKING CHANGE: consumers must install @alleninstitute/vis-core,
@alleninstitute/vis-geometry, and regl alongside the packages that
depend on them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lanesawyer
lanesawyer marked this pull request as ready for review November 4, 2026 22:17
@lanesawyer
lanesawyer requested a review from a team as a code owner November 4, 2026 22:17
@lanesawyer
lanesawyer merged commit 20d0315 into main Nov 4, 2026
5 checks passed
@lanesawyer
lanesawyer deleted the lane/peer-dependencies branch November 4, 2026 22:18
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.

2 participants