@octanejs/tanstack-query 0.1.41 → 0.1.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/internal.ts +2 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/tanstack-query",
3
- "version": "0.1.41",
3
+ "version": "0.1.43",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -40,7 +40,7 @@
40
40
  "@tanstack/query-core": "^5.101.3"
41
41
  },
42
42
  "peerDependencies": {
43
- "octane": "0.1.42"
43
+ "octane": "0.1.44"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@tanstack/react-query": "^5.101.3",
@@ -49,7 +49,7 @@
49
49
  "react": "^19.2.7",
50
50
  "react-dom": "^19.2.7",
51
51
  "vitest": "^4.1.10",
52
- "octane": "0.1.42"
52
+ "octane": "0.1.44"
53
53
  },
54
54
  "scripts": {
55
55
  "test": "vitest run"
package/src/internal.ts CHANGED
@@ -1,25 +1,8 @@
1
1
  // Shared internals for the binding hooks.
2
2
  import { shouldThrowError } from '@tanstack/query-core';
3
- import { use, useRef } from 'octane';
3
+ import { subSlot, use, useRef } from 'octane';
4
4
 
5
- // Derive a stable, distinct sub-slot from a wrapper's compiler-injected slot, so
6
- // a hook composing multiple base hooks gives each one its own identity. Tags are
7
- // namespaced per hook (e.g. ':oq:obs', ':ms:cb') to avoid cross-hook collisions.
8
- // Memoized: subSlot runs on EVERY hook call every render, and the naive form
9
- // pays a string concat + global symbol-registry lookup each time. The cache is
10
- // keyed by the slot symbol itself; the minted value is byte-identical to the
11
- // uncached Symbol.for result, so identity is preserved across HMR re-evals and
12
- // the per-package copies of this helper. Key universe is bounded: slots are
13
- // per-call-site module constants (never minted per render).
14
- const subSlotCache = new Map<symbol, Map<string, symbol>>();
15
- export function subSlot(slot: symbol | undefined, tag: string): symbol | undefined {
16
- if (slot === undefined) return undefined;
17
- let byTag = subSlotCache.get(slot);
18
- if (byTag === undefined) subSlotCache.set(slot, (byTag = new Map()));
19
- let sym = byTag.get(tag);
20
- if (sym === undefined) byTag.set(tag, (sym = Symbol.for((slot.description ?? '') + ':' + tag)));
21
- return sym;
22
- }
5
+ export { subSlot };
23
6
 
24
7
  // Split the compiler-injected trailing slot off a hook's runtime args, returning
25
8
  // the user args (everything before it) and the slot.