
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-state-basis
Advanced tools
Runtime state profiler for React that detects redundant state, update chains, and infinite loops by tracking when state updates happen.
Basis tracks when state updates (never what) to catch architectural debt that standard tools miss, while keeping your data private.
npm i react-state-basis
Add the plugin to your vite.config.ts. The Babel plugin auto-labels your hooks—you continue importing from react as normal.
import { basis } from 'react-state-basis/vite';
export default defineConfig({
plugins: [
react({
babel: { plugins: [['react-state-basis/plugin']] }
}),
basis()
]
});
import { BasisProvider } from 'react-state-basis';
root.render(
<BasisProvider
debug={true}
showHUD={true} // Set to false for console-only forensics
>
<App />
</BasisProvider>
);
Drop this pattern into any component. Basis will identify the rhythm of the debt within ~100ms.
const [a, setA] = useState(0);
const [b, setB] = useState(0);
useEffect(() => {
setB(a + 1); // ⚡ BASIS: "Double Render Detected"
}, [a]);
return <button onClick={() => setA(a + 1)}>Pulse Basis</button>;
Click the button. You should see this in your console:
⚡ BASIS | DOUBLE RENDER
📍 Location: YourComponent.tsx
Issue: effect_L5 triggers b in a separate frame.
Fix: Derive b during the render phase (remove effect) or wrap in useMemo.
showHUD={false} on the provider.// @basis-ignore at the top of any file to disable instrumentation. Recommended for:
The optional HUD shows your State Basis Matrix in real-time. Purple pulses ($\Omega$) are Context anchors; Red pulses (!) are redundant shadows.
Note: While the HUD visualizes real-time updates, the Architectural Health Report (Console) provides the deep topological analysis.
Basis uses Graph Theory, Signal Processing, and Linear Algebra to identify architectural violations that static linters miss:
useEffect triggers a state update immediately after a render, forcing the browser to paint twice.isLoading + isSuccess).Check your entire app's state architecture by running window.printBasisReport() in the console.
Verify engine efficiency and heap stability in real-time via window.getBasisMetrics().
Basis is verified against industry-standard codebases to ensure high-fidelity detection:
Wrap your store with basisLogger to give Basis visibility into external
store updates. Store signals appear as Σ in the HUD and health report.
import { create } from 'zustand';
import { basisLogger } from 'react-state-basis/zustand';
export const useStore = create(
basisLogger((set) => ({
theme: 'light',
toggleTheme: () => set((state) => ({
theme: state.theme === 'light' ? 'dark' : 'light'
})),
}), 'MyStore')
);
This enables detection of Store Mirroring, Store Sync Leaks, and Global Event Fragmentation across React and Zustand state simultaneously.
Planned: XState, React Qery, Redux Toolkit. Community PRs welcome.
Development: <1ms overhead per update cycle, zero heap growth
Production: ~0.01ms per hook (monitoring disabled, ~2-3KB bundle)
Privacy: Only tracks update timing, never state values
Basis is built on heuristics inspired by Signal Processing, Linear Algebra, and Graph Theory. To understand the underlying math, visit the Full Wiki.
Each era of Basis answers a different architectural question:
✓ v0.4.x - The Correlation Era - Are these states moving together?
✓ v0.5.x - The Decomposition Era - Is this local state just a copy of Context?
→ v0.6.x - The Graph Era - Which bug should I fix first for maximum impact?
v0.7.x - The Information Era - Does this state carry real information, or is it derivative?
v0.8.x - The Manifold Era - How many hooks does your component actually need?
Built by LP • MIT License
FAQs
Runtime state profiler for React that detects redundant state, update chains, and infinite loops by tracking when state updates happen.
The npm package react-state-basis receives a total of 38 weekly downloads. As such, react-state-basis popularity was classified as not popular.
We found that react-state-basis demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.