Skip to content

chore(client): migrate Moorhen 0.23.1 → 1.0.0-alpha.3 - #46

Merged
martinemnoble1 merged 1 commit into
mainfrom
feat/moorhen-1.0
Jun 19, 2026
Merged

chore(client): migrate Moorhen 0.23.1 → 1.0.0-alpha.3#46
martinemnoble1 merged 1 commit into
mainfrom
feat/moorhen-1.0

Conversation

@martinemnoble1

Copy link
Copy Markdown
Owner

Migrates the embedded Moorhen viewer from 0.23.1-alpha.0 to 1.0.0-alpha.3-dev.g065becee (same build used in the ccp4i2 upgrade).

What broke in 1.0 (and the fix)

  • No package root entry — 1.0 ships an exports map with no . key, so from "moorhen" no longer resolves. Imports now come from moorhen/react-lib (store.ts, moorhen-shim.ts, InspectDrawer.tsx, InspectPage.tsx).
  • MoorhenInstanceProvider requires a menuSystem — per-instance state moved into a React context. Pass a memoised new MoorhenMenuSystem(). We keep wiring the provider directly (not MoorhenProvider) because we manage our own Redux store.
  • moorhen/types/* blocked under bundler resolution — the exports map has no ./types/* key. Added a tsconfig paths alias to the physical (deprecated-but-shipped) .d.ts files. Type-only; the bundler is unaffected.
  • Swapped the vendored tgz; public/ asset layout (MoorhenAssets/wasm) is unchanged.

Validation

  • npx tsc --noEmit clean
  • vite build clean (1133 modules)
  • ✅ Headless-Chrome mount of /projects/:id/inspect: Moorhen 1.0 viewer renders — default menu tree, WebGL viewport, and our extraSidePanels populated from the live API — zero page/console errors, no InstanceProvider/menuSystem throw.

🤖 Generated with Claude Code

1.0 dropped the package root entry (no `.` in the `exports` map) and moved
per-instance state into a React context. Embedder-facing changes:

- Imports come from the `moorhen/react-lib` entry (bare `from "moorhen"` no
  longer resolves): store.ts, moorhen-shim.ts, InspectDrawer.tsx, InspectPage.tsx.
- `<MoorhenInstanceProvider>` now REQUIRES a `menuSystem` prop — pass a memoised
  `new MoorhenMenuSystem()` (we manage our own store, so we wire the provider
  directly rather than via MoorhenProvider, which would create a 2nd store).
- tsconfig: under `bundler` resolution the `exports` map has no `./types/*` key,
  so add a `paths` alias pointing `moorhen/types/*` at the physical (deprecated
  but still-shipped) .d.ts files. Type-only, so the bundler is unaffected.
- Swap the vendored tgz; public/ asset layout is unchanged (MoorhenAssets/wasm).

Validated: `tsc --noEmit` + `vite build` both green, and a headless-Chrome mount
of /projects/:id/inspect renders the Moorhen 1.0 viewer (menu tree + WebGL +
our extraSidePanels populated from the API) with zero page/console errors —
no InstanceProvider/menuSystem throw.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@martinemnoble1
martinemnoble1 merged commit acd112e into main Jun 19, 2026
4 checks passed
@martinemnoble1
martinemnoble1 deleted the feat/moorhen-1.0 branch June 19, 2026 11:48
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