@rari/use-cache
v0.15.1
Published
Native 'use cache' directive transform addon for rari
Maintainers
Readme
@rari/use-cache
Native
"use cache"directive transform and runtime for rari
High-performance "use cache" support for React Server Components, powered by a Rust NAPI addon.
Installation
Usually installed automatically with rari. To install directly:
npm install @rari/use-cacheEnable caching in your rari Vite config:
import rari from 'rari/vite'
import { defineConfig } from 'vite'
export default defineConfig({
plugins: [
rari({
experimental: {
useCache: true,
},
}),
],
})What This Does
- Transforms
"use cache"directives at build time via a native Rust addon - Provides cache runtime helpers (
cacheLife,cacheTag, revalidation APIs) - Ships platform-specific optional dependencies for macOS, Linux, and Windows
You typically don't need to import this package in app code. rari loads the transform when experimental.useCache (or experimental.useCacheRemote) is enabled.
Links
- Documentation: rari.build/docs
- GitHub: github.com/rari-build/rari
- Discord: Join our community
License
MIT License - see LICENSE for details.
