Conversation
Cover query key generation, meta data lookup (incl. dynamic models and name conflicts), ghost chain resolution, invalidation/reset filters, hashing, query context, render(), reset(), query options, transform dependencies and error propagation. The former queries.test.ts tested metaData.ts and is renamed accordingly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the ./polytype entry point, getPrototypeListOf(Object.prototype) returns [] instead of [null], so incomplete meta data (only name or only getId) was dropped and getMetaData() returned undefined. Meta data of multiple parent classes was never merged either, as the lookup stopped after the first parent branch. The lookup now walks all parent classes depth-first and merges their meta data: the class itself wins over its parents, earlier parents (including their ancestors) win over later ones. Co-Authored-By: Claude Opus 5.5 <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
queries,resolveGhostChain,invalidate,reset,withEachGhost,hash,context,types,polytype), and extendmetaData,asGhostandmakeGhosttests (render(), reset(), generated query keys, query options, transform dependencies, error boundary). 25 → 115 tests.queries.test.tsactually testedmetaData.ts, so it's renamed tometaData.test.ts, andqueries.test.tsnow tests query key generation../polytypeentry point,getMetaData()returnedundefinedfor every model with incomplete meta data (onlynameor onlygetId). The reason is thatgetPrototypeListOf(Object.prototype)returns[]instead of[null]. Meta data of multiple parent classes was also never merged, because the lookup stopped after the first parent branch.Meta data precedence (new)
The lookup walks all parent classes depth-first and merges what it finds:
Single inheritance without polytype behaves as before.
Not addressed
forwardQueryContext()throws away the result ofghostFnContext.bind(...)and callsfn()directly. It only works when called synchronously inside an active query context. The tests cover only that case.Test plan
pnpm testinpackages/react-ghostmaker(tsc, lint, build, vitest, licenses) passes locally🤖 Generated with Claude Code