Releases: rush-cms/sdk
Releases · rush-cms/sdk
v2.0.0 - Native i18n and TipTap Support
Rush CMS SDK v2.0.0
A major release introducing native internationalization and TipTap Content Editor support! 🎉
✨ What's New
Native i18n Support
- 10+ locales - English, Portuguese (Brazil), Spanish, French, German, Italian, Japanese, Korean, Chinese (Simplified & Traditional)
- Locale management -
LocaleProvider,useLocale()hook, andLocaleSwitchercomponent - Automatic headers -
Accept-Languageheader sent with all API requests - Type-safe - Full TypeScript support for all locales
- Flexible - Global context with per-request override support
TipTap Content Editor Support
- Modern content format - Structured JSON instead of HTML
- Auto-detection -
ContentRendererautomatically detects Block[] vs TipTap format - Full node support - Paragraphs, headings, lists, tables, code blocks, blockquotes, and more
- Inline formatting - Bold, italic, underline, strike, links, highlights, subscript, superscript
- Custom blocks - YouTube embeds and image galleries
- Backward compatible - Existing BlockEditor content continues to work
📦 Packages Updated
@rushcms/types→ 2.0.0@rushcms/client→ 2.0.0@rushcms/react→ 2.0.0@rushcms/cli→ 2.0.0
🚨 Breaking Changes
API Response Structure
getEntry()now returns only the requested locale instead of all localesNavigation.items.collection_id→ useNavigation.items.collection.idEntry.categoriesnow separate fromEntry.tagsEntry.data.contenttype:Block[] | TipTapContent
React Components
RushCMSProviderautomatically includesLocaleProvider- All hooks now require
LocaleProviderin component tree - Hooks accept optional
localeparameter for per-request override
📚 Documentation
- CHANGELOG.md - Complete changelog with all changes
- MIGRATION-GUIDE.md - Step-by-step migration from v1.x
- README-I18N.md - Complete i18n guide (400+ lines)
- README-TIPTAP.md - Complete TipTap guide (600+ lines)
🧪 Testing
38+ comprehensive tests covering:
- Locale management and switching
- Accept-Language headers
- TipTap content rendering
- Content format detection
- React component behavior
📥 Installation
npm install @rushcms/types@2.0.0 @rushcms/client@2.0.0 @rushcms/react@2.0.0🚀 Quick Start
i18n Setup
import { RushCMSClient } from '@rushcms/client'
import { RushCMSProvider, LocaleSwitcher } from '@rushcms/react'
const client = new RushCMSClient({
baseUrl: 'https://api.rushcms.com',
apiToken: 'your-token',
siteSlug: 'your-site',
locale: {
default: 'pt_BR',
fallback: 'en'
}
})
function App() {
return (
<RushCMSProvider
client={client}
defaultLocale="pt_BR"
availableLocales={['en', 'pt_BR', 'es']}
>
<LocaleSwitcher />
<YourApp />
</RushCMSProvider>
)
}TipTap Rendering
import { ContentRenderer } from '@rushcms/react'
function Article({ entry }) {
return (
<article>
<h1>{entry.title}</h1>
{/* Automatically handles both Block[] and TipTap formats */}
<ContentRenderer content={entry.data.content} />
</article>
)
}🤝 Contributing
Contributions are welcome! Please read our contributing guidelines.
📄 License
MIT
Full Changelog: https://github.com/rush-cms/sdk/blob/main/CHANGELOG.md