Repository navigation
fix(query): drop the development warning about a cache key shard registered twice - #275
Merged
Merged
Conversation
…stered twice The development build warned whenever `queryKey()` met a shard name it had registered before. A name comes again without any mistake: Vite runs a module again on a hot update and makes its keys anew, and a spec makes a key per test, so the specs of query printed `Cache key shard "test" is already registered` 36 times on every run. The check cannot tell such a key from a second builder that shares a cache by mistake. Two builders with one name still share one cache.
dangreen
added a commit
that referenced
this pull request
Sep 30, 2026
…docs #275 removes the warning from the development build of `@nano_kit/query`.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #275 +/- ##
==========================================
- Coverage 85.79% 85.77% -0.02%
==========================================
Files 166 166
Lines 3766 3761 -5
Branches 871 869 -2
==========================================
- Hits 3231 3226 -5
- Misses 358 359 +1
+ Partials 177 176 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merged
dangreen
added a commit
that referenced
this pull request
Oct 4, 2026
…docs #275 removes the warning from the development build of `@nano_kit/query`.
dangreen
added a commit
that referenced
this pull request
Oct 21, 2026
* docs: document the changes since 1.2.0 and add the DevTools page The site, the package READMEs and the DOCS.md of the agent skills now describe the code on main instead of the 1.2.0 release: - tasks attached to the signals they fill: `task($signal, ...)` and `waitTasks($signal)` replace the tasks pool, and `hydratable()` is the whole SSR setting of a query client - `resolved` hands falsy values through and attaches its promise as a task - the `SignalsMap` and `IndexedSignalsMap` classes replace the map functions - the operators return plain values for static operands, `pick` and the `text` tag are new, `concat` is gone - `latest`, `child`, `toHtmlAttribute`, and `escapeHtml` in the SSR adapter example - a DevTools page in the Store section with the development builds and their warnings - the pager labels follow the pages added between the sections, and stale samples in the agera, kida and store READMEs are fixed The benchmark and bundle size numbers come from the comparison page branch, measured on 2026-09-27. * docs: drop the warning about a shard registered twice from the query docs #275 removes the warning from the development build of `@nano_kit/query`. * docs: describe where a dependency lives in nested contexts and `provideAs`, and re-measure the bundles with DI Core Concepts gets the Aliases and Nested Contexts sections: a dependency that is not provided lives in the deepest context that provides something it reads, otherwise in the top one, and every context below shares it. The React, Preact and Svelte integration pages say how their providers nest, and the kida README gets the same two sections. The weather example with DI and the rick-and-morty SSR examples are measured again with the new DI, the other rows stay as they are. * docs: describe signal and `null` values of `format()` messages, `relativetime()` over a moment and the revalidation of a request in flight The intl API page shows that the formatter of a `format()` message reads a signal or an accessor passed as the value and formats `null` as a missing value, and the `relativetime()` section is rewritten for a moment as the input: the unit picked by the distance between `largestUnit` and `smallestUnit`, the readings of zero, `relativeTo` and the 30-day month. Message Access in Core Concepts links the signal values, and Revalidating Cache in the query docs says that a revalidation restarts a request in flight. The skill docs are generated again. * docs: re-measure the bundles with `@nano_kit/query` after the fix of a revalidation in flight The fix adds 13 B to the query client. The weather rows with Nano Kit and the rick-and-morty rows with Nano Kit, client and SSR, are measured again with the same recipe: only the chunk with the query client differs from the last measurement, by those 13 B, and the other rows stay as they are. * docs: re-measure the example bundles at the 2.0.0 release
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.
Why
The development build of
@nano_kit/querywarned wheneverqueryKey()met a shard name it had registered before. A name comes again without any mistake: Vite runs a module again on a hot update and makes its keys anew, and a spec makes a key per test. The specs of query printedCache key shard "test" is already registered: two builders with one name share one cache36 times on every run. The check cannot tell such a key from a second builder that shares a cache by mistake.What
queryKey()is removed, with its spec incache.spec.ts.nullstays.Size
Nothing changes in production: the check was behind
import.meta.env.DEV,dist/index.production.jsof query builds byte for byte the same, and every size-limit entry of query measures it. The development build loses 208 B raw.Notes
--reporter=defaultthe specs of query print 36 of them on main and none with this change.tscand the unit tests of query pass, 165 of them, and so does the pre-pushpnpm test.