chore(client): migrate Moorhen 0.23.1 → 1.0.0-alpha.3 - #46
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrates the embedded Moorhen viewer from
0.23.1-alpha.0to1.0.0-alpha.3-dev.g065becee(same build used in the ccp4i2 upgrade).What broke in 1.0 (and the fix)
exportsmap with no.key, sofrom "moorhen"no longer resolves. Imports now come frommoorhen/react-lib(store.ts, moorhen-shim.ts, InspectDrawer.tsx, InspectPage.tsx).MoorhenInstanceProviderrequires amenuSystem— per-instance state moved into a React context. Pass a memoisednew MoorhenMenuSystem(). We keep wiring the provider directly (notMoorhenProvider) because we manage our own Redux store.moorhen/types/*blocked underbundlerresolution — theexportsmap has no./types/*key. Added a tsconfigpathsalias to the physical (deprecated-but-shipped).d.tsfiles. Type-only; the bundler is unaffected.public/asset layout (MoorhenAssets/wasm) is unchanged.Validation
npx tsc --noEmitcleanvite buildclean (1133 modules)/projects/:id/inspect: Moorhen 1.0 viewer renders — default menu tree, WebGL viewport, and ourextraSidePanelspopulated from the live API — zero page/console errors, no InstanceProvider/menuSystem throw.🤖 Generated with Claude Code