Fix TS2742 typecheck failure in deck3DConfigStore#1080
Merged
Conversation
reactive<OrbitViewState>() structurally unwraps the deck.gl type, dragging in @deck.gl/core's internal (non-exported) transitions/transition type and tripping TS2742 on the store's inferred public type, which made `make typecheck` red on main. Type the reactive viewState with a local, portable Deck3DViewState interface covering the fields actually used (target, zoom, rotationX, rotationOrbit). OrbitViewState is retained as the updateViewState() parameter type — it is referenced by its public name there, not structurally expanded, so the deck.gl onViewStateChange callback still passes through unchanged. No runtime behavior change. Co-Authored-By: Claude Opus 4.8 <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.
Summary
Closes #1079.
make typecheck(vue-tsc --noEmit -p tsconfig.app.json) has been failing onmain:Root cause
viewStatewas declared asreactive<OrbitViewState>(...)and returned from the Pinia setup store.reactive()unwraps its generic structurally (UnwrapNestedRefs<OrbitViewState>), and that expansion pulls in@deck.gl/core's internal, non-exportedtransitions/transitiontype. TypeScript then can't name the store's inferred public type portably → TS2742 (reported at thedefineStorecall on L6).make buildwas unaffected (it runsvite build/ esbuild only, novue-tsc), so this never blocked deploys — but it kept the typecheck gate red and masked real regressions.Change (
web-client/src/stores/deck3DConfigStore.ts)Deck3DViewStateinterface covering the fields actually used (target,zoom,rotationX,rotationOrbit) and typed the reactiveviewStatewith it instead ofOrbitViewState.OrbitViewStateas theupdateViewState(vs)parameter type — there it's referenced by its public name, not structurally expanded, so the deck.glonViewStateChangecallback indeck3DPlotUtils.tsstill passes through unchanged.Purely type-level; no runtime behavior change (the
reactive()generic is erased at runtime and the object initializer is identical).Verification
make typecheck→ exits 0; the whole project (including the deck.gl consumersdeck3DPlotUtils.tsandSrDeck3DCfg.vue) typechecks.🤖 Generated with Claude Code