Releases: aromalanil/react-rhino
Release list
v3.0.3
This is a non-breaking patch release focused on optimizing the library for AI tools and discoverability.
Improvements
- LSP & Copilot Enhancements: Added robust JSDoc comments with code examples to all exported hooks (
useRhinoState, etc.) andRhinoProviderfor instant, in-editor context. - AI Web Crawler Support: Introduced
llms.txtandllms-full.txtdocumentation files tailored perfectly for consumption by LLMs and semantic search tools. - Metadata Optimization: Updated
package.jsondescriptions and keywords for better natural language discoverability (e.g., "lightweight global state alternative").
(Note: The new docs folder is excluded via .npmignore so the package bundle size remains featherweight!)
v3.0.2
This is a minor patch to improve JSDoc support and impove module resolution.
- Removed
tsupin favor of a puretscdual-build setup (ESM/CJS). - Extracted
RhinoStoreinterface to a dedicatedtypes.tsfile to ensure JSDoc comments are preserved in generated.d.tsfiles. - Added consistent JSDoc documentation to
createRhinoStore - Simplified
package.jsonbuild scripts and updatedrequiretype exports to point to/dist/cjs/index.d.ts.
v3.0.1
This is a minor patch to improve compatibility and fix module resolution.
- Fixed strict ESM support: Resolved "module not found" errors in strict Native ESM environments (like Vite and Next.js SSR).
- Added CommonJS support: Automatically includes a
.cjsfallback for older environments and tools like Jest. - Build improvements: Switched to
tsupfor cleaner bundling and added a properexportsmap topackage.json.
Version 3.0.0
React Rhino v3 is here! This release is a major architectural rewrite from the ground up, designed to fix "Provider Hell", introduce flawless TypeScript inference, and utilize modern React 18 APIs - all while remaining incredibly lightweight (still ~700 bytes minzipped).
🌟 What's Better in v3?
- Goodbye Provider Hell: In v2, Rhino generated a new deeply nested React Context for every single key in your store. In v3,
RhinoProvideruses a single, unified React Context to inject the store, keeping your React DevTools tree clean and shallow. - Modern
useSyncExternalStoreArchitecture: While v2 prevented re-renders using isolated contexts, v3 achieves this via a heavily optimized Pub/Sub model powered by React 18's nativeuseSyncExternalStore. The central React Context never triggers re-renders; instead, components surgically subscribe only to the exact keys they need. - Flawless TypeScript Inference: In v2, TypeScript support required manually passing generics (e.g.,
useRhinoState<boolean>("myKey")), and keys were unchecked strings. In v3, the newcreateRhinoStorefactory automatically infers all keys and types from your store object. You now get strict type checking and perfect IDE autocompletion out-of-the-box!
⚠️ Breaking Changes
This is a major version, so there are a few breaking API changes:
createRhinoStorereplacesstoreprop: TheRhinoProviderno longer accepts astoreprop. Instead, you initialize your store usingcreateRhinoStore, which automatically generates a custom provider and your strictly typed hooks.- Removal of Global Hooks: Legacy global hooks (
useRhinoState,useRhinoValue,useSetRhinoState) imported directly fromreact-rhinohave been removed. You must now use the custom hooks exported by yourcreateRhinoStorefile. - Clean-up: Removed legacy, undocumented exports like
CombineProvidersandcreateGlobalState.
📖 Migration Guide
Upgrading from v2? It's quick and easy! Check out the v3 Migration Guide to see how to update your store initialization and hook imports.
Built with ❤️ for developers who love clean code.
Version 2.1.0
Changelogs
- Refactored
initialStatestostore
Version 2.0.0
Changelogs
- Removed
createRhinoStatefunction RhinoProvidercan be directly imported from the packageinitialStatesis passed as a prop toRhinoProvider- All hooks can be directly imported from the package
Version 1.2
- Made RootProvider creation more readable.
Version 1.1
- Moved react & @types/react to dev-dependencies
Version 1.0
Introducing the all-new state management library for React.