CodeVetter · Repo Unpack · Extension points
pmndrs/valtio
Extensions primarily compose exported functions rather than register plugins. Utility barrels and separate package entrypoints define the public surface, while unstable internal APIs permit deeper runtime customization. Application actions, computed getters, persistence subscriptions, and external history packages provide higher-level composition. Website navigation and MDX plugin arrays offer separate documentation extension points.
- New vanilla helpers plug into src/vanilla/utils.ts, React helpers into src/react/utils.ts, and their combined exports reach valtio/utils through src/utils.ts.
- unstable_replaceInternalFunction supports wrappers around objectIs, newProxy, canProxy, createSnapshot, and createHandler; unstable_getInternalStates exposes the runtime maps, sets, and version holder.
- unstable_enableOp accepts true, false, or a custom operation factory; subscribe exposes generated operation tuples, and nested listeners prefix paths for integrations consuming mutation records.
- deepClone and unstable_deepProxy accept a getRefSet provider, allowing caller-controlled identities to bypass reconstruction; unstable_deepProxy rebuilds descriptors and prototypes before wrapping ordinary containers.
- Application actions and computed getters are natural composition points: todo actions directly mutate proxies, while class/getter examples derive values without a reducer registry; persistence can attach through subscribe.
- Undo/redo extends state through external valtio-history's proxyWithHistory wrapper; derive documentation points to external derive-valtio and recommends migration to valtio-reactive rather than adding a built-in derive implementation.
- Documentation files provide frontmatter titles/metadata, prepareDoc builds links, getDocsMap indexes navigation by each final slug segment, and getDocsNav explicitly chooses sidebar entries; equal final segments therefore share the same map key.
- Website content transforms plug into bundleMDX's remark/rehype arrays and esbuild loaders; remarkCodeSandboxURLUpdater accepts configurable query parameters. Library packaging separately extends through Rollup's entry aliases and config-* selection.