|
2 | 2 |
|
3 | 3 | All notable changes to `@devwizard/laravel-localizer-react` will be documented in this file. |
4 | 4 |
|
5 | | -## v0.0.4 - 2025-11-09 |
| 5 | +## v1.0.0 - 2025-11-09 |
6 | 6 |
|
7 | | -@beta |
| 7 | +### 🎉 Initial Stable Release |
8 | 8 |
|
9 | | -## v0.0.1 - 2025-11-09 |
| 9 | +This is the first stable release of Laravel Localizer React, providing seamless integration between Laravel translations and React applications. |
10 | 10 |
|
11 | | -### 🎉 Initial Beta Release |
| 11 | +### ✨ Features |
12 | 12 |
|
13 | | -- **useTranslation Hook**: React hook for accessing Laravel translations |
14 | | - |
15 | | - - `__()` - Main translation function with replacements and fallback |
16 | | - - `trans()` - Alias for `__()` |
17 | | - - `lang()` - Alias for `__()` |
| 13 | +#### useLocalizer Hook |
| 14 | + |
| 15 | +A powerful React hook for accessing Laravel translations with full TypeScript support: |
| 16 | + |
| 17 | +- **Translation Functions** |
| 18 | + - `__()` - Main translation function with placeholder replacement and fallback support |
| 19 | + - `trans()` - Alias for `__()` (Laravel compatibility) |
| 20 | + - `lang()` - Alias for `__()` (Laravel compatibility) |
18 | 21 | - `has()` - Check if translation key exists |
19 | | - - `choice()` - Pluralization support |
20 | | - - `locale` - Current locale code |
21 | | - - `dir` - Text direction (ltr/rtl) |
22 | | - - `availableLocales` - Available locales with metadata |
| 22 | + - `choice()` - Pluralization support with replacement variables |
| 23 | + |
| 24 | +- **Locale Information** |
| 25 | + - `locale` - Current locale code (e.g., 'en', 'fr') |
| 26 | + - `dir` - Text direction ('ltr' or 'rtl') |
| 27 | + - `availableLocales` - Available locales with metadata (label, flag, direction) |
23 | 28 | - `translations` - All translations for current locale |
24 | | - |
25 | | -- **Vite Plugin**: Automatic TypeScript generation |
26 | | - |
27 | | - - Watches `lang/**` directory for changes |
28 | | - - Debounced regeneration (300ms) |
29 | | - - Runs `php artisan localizer:generate --all` automatically |
30 | | - - Zero configuration required |
31 | | - |
32 | | -- **TypeScript Support**: Full type safety |
33 | | - |
34 | | - - Comprehensive interfaces for all types |
35 | | - - IntelliSense support in IDEs |
36 | | - - Strict mode compatible |
37 | | - |
38 | | -- **Inertia.js Integration**: Seamless integration with Inertia.js |
39 | | - |
40 | | - - Works with both Inertia v1 and v2 |
41 | | - - Supports React 18 and 19 |
42 | | - - Automatic page props detection |
43 | | - |
44 | | - |
45 | | -### 📚 Documentation |
46 | | - |
47 | | -- Comprehensive README with usage examples |
48 | | -- API documentation with TypeScript interfaces |
49 | | -- Migration guide from v1 to v2 |
50 | 29 |
|
51 | | -### 🧪 Testing |
| 30 | +#### Placeholder Replacement |
| 31 | + |
| 32 | +- Supports both `:placeholder` and `{placeholder}` formats |
| 33 | +- Multiple placeholders in single string |
| 34 | +- Numeric and string replacements |
| 35 | +- Nested placeholder support |
| 36 | + |
| 37 | +#### Pluralization |
| 38 | + |
| 39 | +- Laravel-compatible pluralization format |
| 40 | +- Support for zero, one, and many forms |
| 41 | +- Placeholder replacement in pluralized strings |
| 42 | +- Custom count-based rules |
| 43 | + |
| 44 | +#### Vite Plugin |
| 45 | + |
| 46 | +Automatic TypeScript generation with hot module replacement: |
| 47 | + |
| 48 | +- Watches language files for changes |
| 49 | +- Non-blocking command execution |
| 50 | +- Configurable watch patterns |
| 51 | +- Debug logging option |
| 52 | +- Integrates with Laravel Artisan commands |
| 53 | + |
| 54 | +#### Inertia.js Integration |
| 55 | + |
| 56 | +Seamless integration with Inertia.js: |
| 57 | + |
| 58 | +- Automatic locale detection from page props |
| 59 | +- Reactive locale updates |
| 60 | +- Shared locale data |
| 61 | +- RTL support via page props |
| 62 | + |
| 63 | +### 🎯 TypeScript Support |
52 | 64 |
|
53 | | -- Jest configuration |
54 | | -- Comprehensive test suite with 100% coverage |
55 | | -- Testing Library for React components |
56 | | -- ESM module support |
| 65 | +- Full type definitions |
| 66 | +- IntelliSense support in IDEs |
| 67 | +- Type-safe placeholder replacements |
| 68 | +- Strict mode compatible |
| 69 | +- Exported types for custom implementations |
57 | 70 |
|
58 | | -### 🛠️ Development Tools |
| 71 | +### 🧪 Testing |
59 | 72 |
|
60 | | -- ESLint configuration with TypeScript and React rules |
61 | | -- Prettier for code formatting |
62 | | -- tsup for building and bundling |
63 | | -- GitHub Actions for CI/CD |
| 73 | +- Comprehensive test suite with Jest |
| 74 | +- React Testing Library integration |
| 75 | +- 100% code coverage |
| 76 | +- Mock Inertia.js integration |
| 77 | +- Example test patterns |
64 | 78 |
|
65 | 79 | ### 📦 Package Configuration |
66 | 80 |
|
67 | | -- ESM-only distribution |
| 81 | +- ESM-only distribution (modern bundlers) |
68 | 82 | - Tree-shakeable exports |
69 | | -- Proper package.json exports field |
70 | | -- Peer dependencies: React 18+, Inertia v1/v2, Vite 5+ |
| 83 | +- Separate entry points for hook and Vite plugin |
| 84 | +- Proper peer dependencies |
| 85 | +- Side-effect free |
| 86 | + |
| 87 | +### 🔧 Build System |
| 88 | + |
| 89 | +- Built with tsup for optimal bundling |
| 90 | +- Source maps for debugging |
| 91 | +- Minified production builds |
| 92 | +- Declaration files included |
| 93 | + |
| 94 | +### � Documentation |
| 95 | + |
| 96 | +- Complete README with examples |
| 97 | +- API reference |
| 98 | +- Setup guide |
| 99 | +- Integration examples |
| 100 | +- TypeScript usage patterns |
| 101 | + |
| 102 | +### 🔗 Dependencies |
| 103 | + |
| 104 | +- React 18 or 19 (peer dependency) |
| 105 | +- Inertia.js v1 or v2 (peer dependency) |
| 106 | +- Vite 5+ (peer dependency for plugin) |
| 107 | +- `minimatch` for pattern matching in Vite plugin |
| 108 | + |
| 109 | +### ⚡ Performance |
| 110 | + |
| 111 | +- Memoized translation lookups |
| 112 | +- Cached locale data |
| 113 | +- Optimized re-renders |
| 114 | +- Lazy evaluation |
| 115 | + |
| 116 | +### 🎨 Developer Experience |
| 117 | + |
| 118 | +- Hot module replacement in development |
| 119 | +- Automatic regeneration on file changes |
| 120 | +- Clear error messages |
| 121 | +- Debug mode for troubleshooting |
| 122 | + |
| 123 | +### 📝 Requirements |
| 124 | + |
| 125 | +- Node.js 16+ |
| 126 | +- React 18+ |
| 127 | +- Inertia.js v1 or v2 |
| 128 | +- Laravel Localizer backend package |
| 129 | + |
0 commit comments