Skip to content

docs(readme): consolidate doc links into Guide - #45

Merged
Chris Anderson (codemonkeychris) merged 1 commit into
mainfrom
docs/readme-consolidate-links
Apr 19, 2026
Merged

Chris Anderson (codemonkeychris) merged 1 commit into
mainfrom
docs/readme-consolidate-links

Conversation

@codemonkeychris

Copy link
Copy Markdown
Collaborator

Summary

  • Collapse the individual README doc links (pitch, getting started, architecture, WinUI proposals, state/hooks, reconciliation, native differ) into a single docs/guide/ entry — the guide already covers this material.
  • Remove the stale src/Reactor/Docs/ tree (Architecture, GettingStarted, and four specs) that was superseded by docs/guide/ and docs/specs/.

Test plan

  • README renders with the condensed doc table
  • No remaining links in the repo point to src/Reactor/Docs/

🤖 Generated with Claude Code

Replace individual links (pitch, getting started, architecture, WinUI
proposals, state/hooks, reconciliation, native differ) with a single
Guide entry. Remove stale src/Reactor/Docs tree that duplicated the
guide content.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@codemonkeychris
Chris Anderson (codemonkeychris) merged commit b19189b into main Apr 19, 2026
3 checks passed
@codemonkeychris
Chris Anderson (codemonkeychris) deleted the docs/readme-consolidate-links branch April 19, 2026 22:46
Alexandre Zollinger Chohfi (azchohfi) added a commit that referenced this pull request Jun 26, 2026
Every component re-render re-runs every hook, so per-render hook
allocations multiply by cells x hooks on data-grid workloads
(StocksGrid). This eliminates the hot-path allocations in the hooks
bookkeeping layer while preserving the rules of hooks (same call
order/count/types every render) and observable semantics.

RenderContext.cs:
- #42 ValueHookState Lock is now lazy/nullable (allocated only when
  threadSafe:true); saves N rows x M hooks of unused Lock objects.
- #43 UseState setter cached on the hook slot (built once, not a new
  display-class + Action<T> every render).
- #44 UseReducer<T> updater and UseReducer<TState,TAction> dispatch
  delegates cached on the hook; dispatch reads the latest reducer from
  state (matches React semantics).
- #45/#46/#48 UseEffect/UseMemo/UseCallback gain arity 1-3 deps
  overloads that compare deps without boxing and allocate the deps
  array only when deps actually change; params overloads kept as
  fallback and now assign Dependencies directly (no extra ToArray).
  UseCallback no longer allocates a ()=>callback wrapper.
- #50 _hooks list pre-sized to new(8) to avoid mount realloc churn.
- #51 ContextHooks uses a struct enumerator (no heap enumerator per
  render); still implements IEnumerable for existing .ToList() callers.
- #52 UseCommand/UseCommand<T> use an inline memo slot instead of a
  per-render factory closure capturing 7 vars.
- #53 UsePersisted setter cached on the hook slot.
- #56 new internal UseDisposableEffect(IDisposable) mount-once helper
  with a stable teardown (no 2 lambdas per render).

Hooks/:
- #47 UseMemoCells/ByKey/ByIndex early full-reuse: return the prior
  children array and skip snapshot/dict allocation on a full cache hit.
- #59 UseMemoCellsByKey computes each key once per item into a buffer
  instead of invoking the key selector twice.
- #55 UseElementFocus caches the requestFocus closure and DispatcherQueue
  in refs instead of allocating + a COM call every render.
- #57 UseResource uses an Interlocked counter id (not Guid.NewGuid) and
  skips the deps-hash rebuild when deps are unchanged; #56 disposes via
  UseDisposableEffect.
- #56 UseMutation/UseInfiniteResource dispose via UseDisposableEffect.

PanelAttachedHooks.cs:
- #60 ApplyRelativePanelAttachedProps reuses a thread-static name-map
  dictionary (with a reentrancy guard for nested RelativePanels) instead
  of allocating one per reconcile.

Tests: tests/Reactor.Tests/HookAllocationPerfTests.cs (25 tests) cover
cached-delegate identity across renders, deps short-circuit (params +
arity), threadSafe Lock still allocated + correct under concurrent
writes (null when not requested), and UseMemoCells/ByKey/ByIndex
cache-hit returning the same prior children array.

The two committed skills/reactor.api.txt copies are regenerated to add
the new public arity overloads (UseDisposableEffect stays internal).

Closes #659

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant