|
1 | 1 | # @inlang/paraglide-js |
2 | 2 |
|
| 3 | +## 2.6.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- 7791be7: Upgraded the [inlang SDK](https://github.com/opral/inlang-sdk) to [Lix](https://lix.dev/) v0.5 🎉 |
| 8 | + |
| 9 | + ## Highlights |
| 10 | + |
| 11 | + ### Writing directly to Lix state |
| 12 | + |
| 13 | + State is now written straight into Lix instead of the SDK’s private in-memory SQLite snapshot. Every bundle, message, and variant change becomes a first-class Lix commit, unlocking: |
| 14 | + |
| 15 | + - history and branching, |
| 16 | + - writer-key aware workflows, |
| 17 | + - change proposals and subscriptions, and |
| 18 | + - a single source of truth for downstream tools. |
| 19 | + |
| 20 | + ### Per-file filesystem sync |
| 21 | + |
| 22 | + Any inlang-based tooling that opens a project from disk (IDE extensions, CLIs, custom apps) used to patch the entire locale tree whenever a single message changed. That behaviour is at the heart of [opral/inlang-sherlock#173](https://github.com/opral/inlang-sherlock/issues/173) where editing one key in `en.json` would re-export every other locale file, destroying manual formatting or reintroducing stale content. |
| 23 | + |
| 24 | + Thanks to Lix v0.5’s observable state and writer-key APIs we can now react to per-commit metadata and suppress our own writes. When `happy_elephant` in `en.json` is updated, the SDK marks only `en.json` as dirty, leaving `de.json` and friends untouched. Drift is still possible if another tool rewrites `en.json`, yet the blast radius falls from “the whole project just changed” to “only the file you touched,” making reviews and merges manageable across all inlang integrations. |
| 25 | + |
| 26 | +### Patch Changes |
| 27 | + |
| 28 | +- Updated dependencies [7791be7] |
| 29 | + - @inlang/sdk@3.0.0 |
| 30 | + |
3 | 31 | ## 2.5.0 |
4 | 32 |
|
5 | 33 | - 72d1c53: Ensure the CLI honours allowJs flags defined in extended or referenced tsconfig files instead of prompting unnecessarily. |
|
15 | 43 | The issue occurred because these functions converted locales to lowercase, while the comparison logic inside `assertIsLocale` and `isLocale` wasn't case-sensitive. |
16 | 44 |
|
17 | 45 | List of changes: |
| 46 | + |
18 | 47 | - Ensured locale comparisons in `assertIsLocale()` and `isLocale()` are fully case-insensitive. |
19 | 48 | - Made `assertIsLocale()` return the canonical-cased locale from `locales` instead of the raw input. |
20 | 49 | - Added new test coverage for case-insensitive behavior in `assertIsLocale()` and `isLocale()`. |
|
73 | 102 | This change introduces a new `extractLocaleFromRequestAsync` function that supports asynchronous custom server strategies, enabling use cases like fetching user locale preferences from databases. |
74 | 103 |
|
75 | 104 | ## What's Changed |
| 105 | + |
76 | 106 | - **New Function**: Added `extractLocaleFromRequestAsync` that supports async custom server strategies |
77 | 107 | - **Middleware Update**: Server middleware now uses the async version to support async custom strategies |
78 | 108 | - **Breaking Change**: The synchronous `extractLocaleFromRequest` no longer supports custom server strategies |
|
141 | 171 | ``` |
142 | 172 |
|
143 | 173 | **Migration**: |
| 174 | + |
144 | 175 | - If you want the previous behavior (subdomain sharing), explicitly set `cookieDomain` in your configuration: |
145 | 176 |
|
146 | 177 | ```diff |
|
158 | 189 | - 4255bd5: Provide functions for getting the preferred language on server and client. |
159 | 190 |
|
160 | 191 | This defines two new functions for getting the preferred language: |
| 192 | + |
161 | 193 | - `extractLocaleFromHeader`: Extracts the locale from the accept-language header on the server. |
162 | 194 | - `extractLocaleFromNavigator`: Extracts the locale from the navigator.languages array on the client. |
163 | 195 |
|
|
169 | 201 | This introduces a new way to define custom locale resolution strategies alongside built-in strategies. Custom strategies provide a cleaner, more composable approach compared to overwriting `getLocale()` and `setLocale()` functions directly. |
170 | 202 |
|
171 | 203 | **New APIs:** |
| 204 | + |
172 | 205 | - `defineCustomClientStrategy()`: Define custom strategies for client-side locale resolution |
173 | 206 | - `defineCustomServerStrategy()`: Define custom strategies for server-side locale resolution |
174 | 207 |
|
175 | 208 | **Key features:** |
| 209 | + |
176 | 210 | - Custom strategies must follow the pattern `custom-<name>` where `<name>` contains only alphanumeric characters |
177 | 211 | - Can be combined with built-in strategies in the strategy array |
178 | 212 | - Respect strategy order for fallback handling |
|
295 | 329 | - 698b9a9: add `cookieMaxAge` option to compiler and runtime |
296 | 330 |
|
297 | 331 | Closes https://github.com/opral/inlang-paraglide-js/issues/483 |
| 332 | +
|
298 | 333 | - Introduced `cookieMaxAge` option to `CompilerOptions`, allowing configuration of cookie expiration time. |
299 | 334 | - Adjusted tests to verify `max-age` in cookies. |
300 | 335 |
|
@@ -1013,6 +1048,7 @@ await compile({ |
1013 | 1048 | - 14d80b3: Removed the "Which tech-stack are you using?" prompt from the `init` command as it was not providing any real value. All it did was link you to the appropriate documentation. |
1014 | 1049 |
|
1015 | 1050 | From now on we rely on the docuemntation site to guide people to the correct documenation for their framework. |
| 1051 | +
|
1016 | 1052 | - SvelteKit: https://inlang.com/m/dxnzrydw/paraglide-sveltekit-i18n |
1017 | 1053 | - NextJs: https://inlang.com/m/osslbuzt/paraglide-next-i18n |
1018 | 1054 | - Astro: https://inlang.com/m/iljlwzfs/paraglide-astro-i18n |
|
0 commit comments