@octanejs/aria 0.0.37 → 0.0.38

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 +3 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octanejs/aria",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -51,7 +51,7 @@
51
51
  "clsx": "^2.1.1"
52
52
  },
53
53
  "peerDependencies": {
54
- "octane": "0.1.43"
54
+ "octane": "0.1.44"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@tsrx/react": "^0.2.58",
@@ -62,7 +62,7 @@
62
62
  "react-dom": "^19.2.7",
63
63
  "react-stately": "3.48.0",
64
64
  "vitest": "^4.1.10",
65
- "octane": "0.1.43"
65
+ "octane": "0.1.44"
66
66
  },
67
67
  "scripts": {
68
68
  "test": "vitest run"
package/src/internal.ts CHANGED
@@ -9,22 +9,9 @@
9
9
  // const slot = restSlot(args) ?? S('useHover');
10
10
  // (Same pattern as the other @octanejs bindings; see packages/floating-ui.)
11
11
 
12
- // Derive a stable, distinct sub-slot from a wrapper's slot, namespaced per hook.
13
- // Memoized: subSlot runs on EVERY hook call every render, and the naive form
14
- // pays a string concat + global symbol-registry lookup each time. The cache is
15
- // keyed by the slot symbol itself; the minted value is byte-identical to the
16
- // uncached Symbol.for result, so identity is preserved across HMR re-evals and
17
- // the per-package copies of this helper. Key universe is bounded: slots are
18
- // per-call-site module constants (never minted per render).
19
- const subSlotCache = new Map<symbol, Map<string, symbol>>();
20
- export function subSlot(slot: symbol | undefined, tag: string): symbol | undefined {
21
- if (slot === undefined) return undefined;
22
- let byTag = subSlotCache.get(slot);
23
- if (byTag === undefined) subSlotCache.set(slot, (byTag = new Map()));
24
- let sym = byTag.get(tag);
25
- if (sym === undefined) byTag.set(tag, (sym = Symbol.for((slot.description ?? '') + ':' + tag)));
26
- return sym;
27
- }
12
+ import { subSlot } from 'octane';
13
+
14
+ export { subSlot };
28
15
 
29
16
  // Split the compiler-injected trailing slot off a hook's args. Needed when a
30
17
  // public hook takes optional user args, so the slot can't be located positionally.