Skip to content

Releases: rush-cms/sdk

v2.0.0 - Native i18n and TipTap Support

12 Jan 02:11

Choose a tag to compare

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, and LocaleSwitcher component
  • Automatic headers - Accept-Language header 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 - ContentRenderer automatically 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 locales
  • Navigation.items.collection_id → use Navigation.items.collection.id
  • Entry.categories now separate from Entry.tags
  • Entry.data.content type: Block[] | TipTapContent

React Components

  • RushCMSProvider automatically includes LocaleProvider
  • All hooks now require LocaleProvider in component tree
  • Hooks accept optional locale parameter for per-request override

📚 Documentation

🧪 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