@reticlehq/react 2.14.0 → 3.2.0

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.
@@ -1,13 +1,9 @@
1
1
  /**
2
2
  * Find the app's state stores WITHOUT the app registering them.
3
3
  *
4
- * `registerStore` is the highest-value line in a Reticle install and the one most likely never to be
5
- * written: `init` can only offer a commented suggestion, because the argument it would need
6
- * (which client, which store instance) is knowable only by reading the source. Measured on real
7
- * apps, that suggestion mostly stays a comment — the install reports every step green,
8
- * `hasCapabilities` stays false, and `reticle_state` is empty forever. The agent doing the install
9
- * then spends a handful of turns being told to go finish the file, which is most of what makes
10
- * onboarding long.
4
+ * `init` can only offer a commented `registerStore` suggestion, because the argument it would need
5
+ * (which client, which store instance) is knowable only by reading the source. While that suggestion
6
+ * stays a comment, `hasCapabilities` is false and `reticle_state` is empty.
11
7
  *
12
8
  * The observation that removes the whole step: every context-based state library already hands its
13
9
  * store to React as a prop. `<Provider store>` renders `ReactReduxContext.Provider value={{store}}`,
@@ -17,8 +13,7 @@
17
13
  * WHAT THIS CANNOT FIND, deliberately: module-scope stores (Zustand, Valtio, MobX singletons, Jotai
18
14
  * atoms). They are never passed through a provider, so nothing in the tree points at them and only
19
15
  * the app can hand them over. Those still need `registerStore`, and the capability report must keep
20
- * saying so — an auto-discovery that quietly covered 60% of apps while reading as though it covered
21
- * all of them would be a worse failure than the manual step it replaced.
16
+ * saying so.
22
17
  *
23
18
  * A store the app registered itself ALWAYS wins. This never overwrites a name that is already taken.
24
19
  */
@@ -1,13 +1,9 @@
1
1
  /**
2
2
  * Find the app's state stores WITHOUT the app registering them.
3
3
  *
4
- * `registerStore` is the highest-value line in a Reticle install and the one most likely never to be
5
- * written: `init` can only offer a commented suggestion, because the argument it would need
6
- * (which client, which store instance) is knowable only by reading the source. Measured on real
7
- * apps, that suggestion mostly stays a comment — the install reports every step green,
8
- * `hasCapabilities` stays false, and `reticle_state` is empty forever. The agent doing the install
9
- * then spends a handful of turns being told to go finish the file, which is most of what makes
10
- * onboarding long.
4
+ * `init` can only offer a commented `registerStore` suggestion, because the argument it would need
5
+ * (which client, which store instance) is knowable only by reading the source. While that suggestion
6
+ * stays a comment, `hasCapabilities` is false and `reticle_state` is empty.
11
7
  *
12
8
  * The observation that removes the whole step: every context-based state library already hands its
13
9
  * store to React as a prop. `<Provider store>` renders `ReactReduxContext.Provider value={{store}}`,
@@ -17,8 +13,7 @@
17
13
  * WHAT THIS CANNOT FIND, deliberately: module-scope stores (Zustand, Valtio, MobX singletons, Jotai
18
14
  * atoms). They are never passed through a provider, so nothing in the tree points at them and only
19
15
  * the app can hand them over. Those still need `registerStore`, and the capability report must keep
20
- * saying so — an auto-discovery that quietly covered 60% of apps while reading as though it covered
21
- * all of them would be a worse failure than the manual step it replaced.
16
+ * saying so.
22
17
  *
23
18
  * A store the app registered itself ALWAYS wins. This never overwrites a name that is already taken.
24
19
  */
@@ -10,7 +10,7 @@
10
10
  * It works because the thing it reads is React's, not Reticle's: React stamps `__reactFiber$…` on
11
11
  * every host element regardless of what instrumentation is present. This is the same hook
12
12
  * react-devtools-mcp uses, which is exactly the tool the zero-install tier exists to reach parity
13
- * with — reusing our own algorithm rather than adopting theirs.
13
+ * with — reusing Reticle's own algorithm rather than adopting theirs.
14
14
  *
15
15
  * What it CANNOT recover is the SDK-exclusive surface, and that limit is honest and load-bearing: no
16
16
  * custom signals (the app never emitted them), no registered store by name (`registerStore` was never
@@ -10,7 +10,7 @@
10
10
  * It works because the thing it reads is React's, not Reticle's: React stamps `__reactFiber$…` on
11
11
  * every host element regardless of what instrumentation is present. This is the same hook
12
12
  * react-devtools-mcp uses, which is exactly the tool the zero-install tier exists to reach parity
13
- * with — reusing our own algorithm rather than adopting theirs.
13
+ * with — reusing Reticle's own algorithm rather than adopting theirs.
14
14
  *
15
15
  * What it CANNOT recover is the SDK-exclusive surface, and that limit is honest and load-bearing: no
16
16
  * custom signals (the app never emitted them), no registered store by name (`registerStore` was never
package/dist/index.d.ts CHANGED
@@ -31,13 +31,11 @@ export declare function hasHoverHandlers(el: Element): boolean;
31
31
  /**
32
32
  * Wire up React support: the adapter for `reticle.inspect`, and the render meter.
33
33
  *
34
- * The meter used to be an export nobody called. `docs/usage.md` advertises
35
- * `reticle_state({ store: "__reticle_renders", path: "commits" })` for React commit counts, and the
36
- * store was never registered on any app — measured on two independent ones, `stores` listed only the
37
- * app's own. An agent asking for render counts got silence, indistinguishable from an idle page.
38
- *
39
- * It belongs here because this is the one function an app calls to say "I am React". Requiring a
40
- * second, separately-imported call for a documented capability is how a feature ships dead.
34
+ * The meter is installed HERE, not left as a separate export: `docs/usage.md` advertises
35
+ * `reticle_state({ store: "__reticle_renders", path: "commits" })` for React commit counts, and this
36
+ * is the one function an app calls to say "I am React". Requiring a second, separately-imported call
37
+ * for a documented capability is how a feature ships dead — an agent asking for render counts gets
38
+ * silence, indistinguishable from an idle page.
41
39
  */
42
40
  export declare function install(): void;
43
41
  export { installRenderMeter, resetRenderMeter, getRenderStats, type RenderStats, } from './render-meter.js';
package/dist/index.js CHANGED
@@ -132,10 +132,10 @@ export function identify(el) {
132
132
  stack.push(name);
133
133
  }
134
134
  // `identify()` is on the ACT path as well as the inspect path, so one null fiber anywhere in
135
- // this walk used to take out reticle_act / reticle_act_and_wait / reticle_inspect for the whole
136
- // app: the read-only tools kept working, so the agent could see the app perfectly and could not
137
- // touch it. The throw also pre-empted the React 19 attribute fallback below, which would have
138
- // produced the source anyway.
135
+ // this walk takes out reticle_act / reticle_act_and_wait / reticle_inspect for the whole app —
136
+ // the read-only tools keep working, so the agent can see the app perfectly and cannot touch it.
137
+ // A throw here would also pre-empt the React 19 attribute fallback below, which produces the
138
+ // source anyway.
139
139
  const debugSource = fiber._debugSource;
140
140
  if (source === undefined && debugSource !== undefined && debugSource !== null) {
141
141
  source = { file: relativeToRoot(debugSource.fileName), line: debugSource.lineNumber };
@@ -282,13 +282,11 @@ let installed = false;
282
282
  /**
283
283
  * Wire up React support: the adapter for `reticle.inspect`, and the render meter.
284
284
  *
285
- * The meter used to be an export nobody called. `docs/usage.md` advertises
286
- * `reticle_state({ store: "__reticle_renders", path: "commits" })` for React commit counts, and the
287
- * store was never registered on any app — measured on two independent ones, `stores` listed only the
288
- * app's own. An agent asking for render counts got silence, indistinguishable from an idle page.
289
- *
290
- * It belongs here because this is the one function an app calls to say "I am React". Requiring a
291
- * second, separately-imported call for a documented capability is how a feature ships dead.
285
+ * The meter is installed HERE, not left as a separate export: `docs/usage.md` advertises
286
+ * `reticle_state({ store: "__reticle_renders", path: "commits" })` for React commit counts, and this
287
+ * is the one function an app calls to say "I am React". Requiring a second, separately-imported call
288
+ * for a documented capability is how a feature ships dead — an agent asking for render counts gets
289
+ * silence, indistinguishable from an idle page.
292
290
  */
293
291
  export function install() {
294
292
  if (installed)
@@ -303,7 +301,7 @@ export { buildErrorBoundaryData, reticleOnCaughtError, } from './error-boundary.
303
301
  export { buildHydrationErrorData, isHydrationMismatch, reticleOnRecoverableError, } from './hydration-error.js';
304
302
  export { createCommitAggregator } from './commit-aggregator.js';
305
303
  // Zero-install component read: a self-contained fiber walker that runs INSIDE a page over CDP, for a
306
- // page that never installed the SDK. react-devtools-mcp parity, reusing our own algorithm.
304
+ // page that never installed the SDK. react-devtools-mcp parity, reusing Reticle's own algorithm.
307
305
  export { readComponentAt, buildReaderExpression, parseComponentRead, } from './cdp-reader.js';
308
306
  // This package IS the React kit: one install gives an app dev the full browser-side surface
309
307
  // (the `reticle` instance + all sensing) plus this React adapter. Re-exporting the sensor here is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/react",
3
- "version": "2.14.0",
3
+ "version": "3.2.0",
4
4
  "description": "Reticle React adapter — maps a DOM ref to its component stack and source file via the fiber tree.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,8 +17,8 @@
17
17
  "./package.json": "./package.json"
18
18
  },
19
19
  "dependencies": {
20
- "@reticlehq/browser": "2.14.0",
21
- "@reticlehq/core": "2.14.0"
20
+ "@reticlehq/browser": "3.2.0",
21
+ "@reticlehq/core": "3.2.0"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=18"
@@ -35,7 +35,7 @@
35
35
  "repository": {
36
36
  "type": "git",
37
37
  "url": "git+https://github.com/reticlehq/reticle.git",
38
- "directory": "packages/react"
38
+ "directory": "adapters/framework/react"
39
39
  },
40
40
  "homepage": "https://github.com/reticlehq/reticle#readme",
41
41
  "bugs": "https://github.com/reticlehq/reticle/issues",
@@ -58,7 +58,7 @@
58
58
  "node": ">=20.0.0"
59
59
  },
60
60
  "scripts": {
61
- "build": "tsc -b",
61
+ "build": "tsc -b && node ../../../scripts/alias-dist.mjs",
62
62
  "typecheck": "tsc -b",
63
63
  "lint": "eslint src",
64
64
  "test:unit": "vitest run src --passWithNoTests",