@octanejs/mcp-server 0.2.26 → 0.2.27
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.
- package/package.json +1 -1
- package/skills/react-divergences.md +34 -0
- package/src/index.js +4 -0
package/package.json
CHANGED
|
@@ -32,6 +32,40 @@ recompute after every render.
|
|
|
32
32
|
(`[state, update, getState]`) that reads the latest scheduled hook-cell value.
|
|
33
33
|
Ordinary two-item destructures keep the allocation-free React shape.
|
|
34
34
|
|
|
35
|
+
## Strong mode reads render snapshots
|
|
36
|
+
|
|
37
|
+
In a module with `"use strong"` or application-wide Strong enabled, reading a
|
|
38
|
+
`useRef` object's `current` while rendering is a compiler error
|
|
39
|
+
(`OCTANE_STRONG_RENDER_REF_READ`). Calling a known third-tuple state getter
|
|
40
|
+
while rendering is also an error (`OCTANE_STRONG_RENDER_STATE_GETTER_CALL`): it
|
|
41
|
+
can read scheduled state that differs from the render snapshot. Reading a
|
|
42
|
+
reassigned module-scope `let` or `var` during render is an error too
|
|
43
|
+
(`OCTANE_STRONG_RENDER_MODULE_STATE_READ`), since the variable can change
|
|
44
|
+
without a witnessed render input. Pass the ref directly to a `ref` prop and
|
|
45
|
+
render from the state tuple's first member. Move changing module values into
|
|
46
|
+
state or context, or pass an immutable snapshot as a prop. Read the ref or call
|
|
47
|
+
the getter in an event, effect, or deferred callback.
|
|
48
|
+
Compatibility modules keep their existing behavior.
|
|
49
|
+
|
|
50
|
+
Reading unshadowed `window`, `document`, `localStorage`, `sessionStorage`,
|
|
51
|
+
`navigator`, `location`, or `matchMedia` while rendering reports
|
|
52
|
+
`OCTANE_STRONG_RENDER_AMBIENT_READ`. This includes `typeof` guards, constant
|
|
53
|
+
browser handle aliases, and `globalThis` property reads except known standard
|
|
54
|
+
language builtins. Computed `globalThis` properties whose names are unknown also
|
|
55
|
+
report the error. Local shadowing, scalar module snapshots, the `globalThis`
|
|
56
|
+
object itself, and standard language builtins such as `globalThis.JSON` remain valid.
|
|
57
|
+
The analysis does not generally prove aliases obtained through defaults,
|
|
58
|
+
returned values, containers, arbitrary deeper properties, or imports. Those
|
|
59
|
+
values still have to satisfy the render-snapshot contract.
|
|
60
|
+
|
|
61
|
+
Use `useSyncExternalStore` with a server snapshot for changing browser state;
|
|
62
|
+
browser reads inside its snapshot callbacks remain legal. Events, effects,
|
|
63
|
+
deferred callbacks, and lazy `useState` or `useReducer` initializers may also
|
|
64
|
+
read browser state. Lazy initialization still runs during server rendering:
|
|
65
|
+
guard unavailable browser APIs there and ensure server and client initial
|
|
66
|
+
output agrees. A guard in an ordinary render calculation still reads ambient
|
|
67
|
+
state and is rejected.
|
|
68
|
+
|
|
35
69
|
## Controlled inputs match React — on native events
|
|
36
70
|
|
|
37
71
|
Controlled `value`/`checked` follow React's semantics exactly: the prop drives
|
package/src/index.js
CHANGED
|
@@ -110,6 +110,10 @@ export const BENCHMARK_SUITES = [
|
|
|
110
110
|
'universal-template-events',
|
|
111
111
|
'universal-native-hover',
|
|
112
112
|
'universal-owner-drafts',
|
|
113
|
+
'universal-hook-slot',
|
|
114
|
+
'universal-draft-lookup',
|
|
115
|
+
'scoped-descriptor-shapes',
|
|
116
|
+
'memo-wrapper-shapes',
|
|
113
117
|
'universal-external-store',
|
|
114
118
|
'lynx-render',
|
|
115
119
|
'lynx-table',
|