Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CI=true EXPO_NO_TELEMETRY=1 pnpm export:android
CI=true EXPO_NO_TELEMETRY=1 pnpm export:ios
```

`check:dependencies` verifies the public SDK registry versions and lockfile integrity, rejects local SDK links and source aliases, and checks that app dependencies, imports, and asset paths resolve inside the checkout. It needs access to public npm. The Node tests protect dependency boundaries, refresh-result classification, and the installed SDK's late-resource and cache-write behavior. Expo's `typecheck` and Android/iOS exports are separate from native device testing.
`check:dependencies` verifies the public SDK registry versions and lockfile integrity, rejects local SDK links and source aliases, and checks that app dependencies, imports, and asset paths resolve inside the checkout. It needs access to public npm. The Node tests protect dependency boundaries, refresh-result classification against the installed SDK's update results (including removed and renamed languages), synchronous setup and its native-initialization order, and the installed SDK's late-resource and default-store cache-write behavior. Expo's `typecheck` and Android/iOS exports are separate from native device testing.

## Browser tests

Expand All @@ -35,15 +35,15 @@ The TypeScript suites live in `tests/browser/`. Playwright starts and stops Vite

Use `pnpm exec playwright test --project=browser --grep "ngx"` for a focused run. The root `pnpm typecheck` also checks the tests and runner configuration.

The browser suite uses the installed SDK and native translation engines. Request interception supplies deterministic manifests and locale records. It covers bundled startup, OTA rendering, locale changes, Main/vip persistence, staging request parameters and mode switches, interpolation, cardinal plurals, failed-request cache restoration, partial updates, unchanged content with a failed locale, reading-state retention, duplicate refresh guards, and the fixed interpolation date. Angular-specific checks include native MessageFormat, late application writes, and restoring bundled copy after OTA removal.
The browser suite uses the installed SDK and native translation engines. Request interception supplies deterministic manifests and locale records. It covers bundled startup, OTA rendering, checks limited to the shown language and its fallback, locale changes that download without a manifest request, Main/vip persistence, staging request parameters and mode switches, interpolation, cardinal plurals, failed-request cache restoration, partial updates, unchanged content with a failed locale, reading-state retention, duplicate refresh guards, and the fixed interpolation date. Angular-specific checks include native MessageFormat, late application writes, and restoring bundled copy after OTA removal.

The parity suite blocks hosted requests and compares React with both Angular adapters on English/German library, Discover, Saved, settings, both chapters, and completion screens. It checks rendered text, selected styles, and geometry within one CSS pixel at 1440x1050 and 390x844. The interaction suite additionally checks 320px widths, 150% German text, all five bundled languages, direct reader links, and scroll retention. Review screenshots as well. These checks do not prove native, Safari, or Firefox behavior.

## Sharing assets and status logic

The apps share example-owned catalogs, story state, reading CSS, fonts, and brand assets under `examples/shared/`. No app imports another app's source. Web, Angular, and Expo share stable story IDs and the pure session reducer; covers are SVG in the browser and native SVG views in Expo. Keep those relative paths aligned. Web builds and Expo exports copy both font license notices into their output; Angular copies them through its asset configuration. `angular-shared` converts bundled interpolation and plurals into native MessageFormat syntax; its private workspace manifest resolves Angular decorators and the exact public core SDK. Its tsconfig extends the repository base and enables Angular legacy decorators. `examples/shared/refresh.ts` contains only application-owned check status text and result classification. Expo's Metro configuration explicitly watches that shared source folder. These are example assets and UI helpers; the SDK implementation comes entirely from npm.
The apps share example-owned catalogs, story state, reading CSS, fonts, and brand assets under `examples/shared/`. No app imports another app's source. Web, Angular, and Expo share stable story IDs and the pure session reducer; covers are SVG in the browser and native SVG views in Expo. Keep those relative paths aligned. Web builds and Expo exports copy both font license notices into their output; Angular copies them through its asset configuration. `angular-shared` converts bundled interpolation and plurals into native MessageFormat syntax; its private workspace manifest resolves Angular decorators; it imports no SDK package, because `@rerune/core` is internal since 1.9.0. Its tsconfig extends the repository base and enables Angular legacy decorators. `examples/shared/refresh.ts` contains only application-owned check status text and result classification. Expo's Metro configuration explicitly watches that shared source folder. These are example assets and UI helpers; the SDK implementation comes entirely from npm.

Keep asynchronous `ReRune.setup(otaOptions, i18nOptions)` and one `ReRuneProvider` for React/React Native. Keep engine-specific `ReRune.provide(otaOptions, nativeOptions)` for Angular, with separate plugin providers in their native order. Do not add SDK transport, response normalization, runtime shims, or framework abstractions to these apps.
Keep one synchronous `ReRune.setup(otaOptions, i18nOptions)` call at module scope and one `ReRuneProvider` for React/React Native, without a translation loading gate (Expo's first screen waits only for its fonts and the remembered-language read); Expo keeps its setup in its own module because React Native setup starts the cache restore and update check at once. Keep engine-specific `ReRune.setup(otaOptions, nativeOptions)` in the Angular root providers, with separate plugin providers in their native order. Use the SDK's default cache stores, and import SDK APIs and types from the framework packages, not `@rerune/core`. Do not add SDK transport, response normalization, runtime shims, or framework abstractions to these apps.

Angular's native build cache is disabled in both apps. CI-mode production builds were verified. Cache-enabled LMDB operation remains unverified. The existing MessageFormat CommonJS and Angular/Vite development-tool peer warnings do not establish a runtime failure.

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ReRune examples

A standalone consumer repository for trying ReRune OTA translations in React, React Native, and Angular. Clone this repository and install its npm dependencies; no other ReRune repository is needed. Each app consumes the public **1.8.0** npm packages and preserves its translation engine's normal rendering APIs.
A standalone consumer repository for trying ReRune OTA translations in React, React Native, and Angular. Clone this repository and install its npm dependencies; no other ReRune repository is needed. Each app consumes the public **1.9.0** npm packages and preserves its translation engine's normal rendering APIs.

## Choose an app

Expand Down Expand Up @@ -34,32 +34,32 @@ The commands above work without a `.env` file, ReRune account, project creation,

After installation, the apps can display bundled copy when the OTA service is unreachable. Live updates need internet access. Each app guide describes optional overrides for your own publishable read ID; console logging defaults to `off`. Expo also needs an SDK 54-compatible client or native development build, as described in its guide.

## Integration in 1.8.0
## Integration in 1.9.0

React and React Native await `ReRune.setup(otaOptions, i18nOptions)` and render one `ReRuneProvider`. Native resources and language configuration stay in i18next. Angular uses `ReRune.provide(otaOptions, nativeOptions)` to compose its root engine provider, preserving native loaders and plugins.
React and React Native call `ReRune.setup(otaOptions, i18nOptions)` once at module scope. It returns the client synchronously, and the app renders one `ReRuneProvider` at once, without a translation loading screen. Native resources and language configuration stay in i18next. React web setup reads no storage and sends no requests; `ReRuneProvider` starts the cache restore and the startup check after its first commit. React Native setup starts both right away, so Expo creates its client in its own module. Angular uses `ReRune.setup(otaOptions, nativeOptions)` in its root providers, where it returns `EnvironmentProviders` and composes the root engine provider, preserving native loaders and plugins. In 1.8.0 the Angular call was named `ReRune.provide(...)`.

Since 1.5.1, React and React Native can create an isolated i18next instance from the supplied native options. Apps with plugins can still pass their own instance. Angular keeps its existing combined provider API. Each app guide compares **Before ReRune**, **After ReRune**, and **Removing ReRune**, using the same native configuration and translation calls.
Since 1.5.1, React and React Native can create an isolated i18next instance from the supplied native options. Apps with plugins can still pass their own instance. No app imports `@rerune/core`, which 1.9.0 makes an internal package; APIs and types come from each framework package. The Expo app installs AsyncStorage itself, because 1.9.0 requires it as a peer dependency. Each app guide compares **Before ReRune**, **After ReRune**, and **Removing ReRune**, using the same native configuration and translation calls.

## What to try

ReRune includes My library, Discover with genre filters, Saved stories, and three stories with two chapters each. Finish a story or restart it. English, German, Spanish, Italian, and Portuguese are bundled; additional SDK locales appear when advertised.

Reading settings contains the Main/`vip` edition switch, an SDK staging-mode switch, a fixed date interpolation example, and cardinal plurals under the logical key `plural_sample`. Staging mode previews enabled draft translations when project staging is enabled and keeps its cache separate from published content. Refresh from the library, reader, or settings. Angular's adapter diagnostics remain available through `?tools=1`.

Bookmarks, progress, filters, tabs, and scroll stay in the app session through language and live-text changes. SDK translation data and the edition selection are cached persistently. Each app also remembers the language picked in its language picker, System default included, under `rerune-example-language` (browser `localStorage`, or AsyncStorage in Expo) and starts in it next time; the app does this, not the SDK. With nothing saved, or when storage fails, an app starts in English. The date in settings is a fixed example, not a synchronization timestamp. Refresh feedback distinguishes changed, unchanged, partially updated, and failed checks; partial results name the updated locales.
Bookmarks, progress, filters, tabs, and scroll stay in the app session through language and live-text changes. SDK translation data and the edition selection are cached persistently. Each app also remembers the language picked in its language picker, System default included, under `rerune-example-language` (browser `localStorage`, or AsyncStorage in Expo) and starts in it next time; the app does this, not the SDK. With nothing saved, or when storage fails, an app starts in English. The date in settings is a fixed example, not a synchronization timestamp. Refresh feedback distinguishes changed, unchanged, partially updated, and failed checks; partial results name the languages whose text changed. A removed or renamed language also counts as a change.

SDK **1.8.0** serves OTA from `https://cdn.rerune.io/api/ota/<publishId>/manifest.json`, with the publish ID in the URL path and no identity header. It applies a locale version only when every remote value is compatible with the placeholders, plurals, and formats the app ships; otherwise the previous copy stays in use. Staging previews and hosted cardinal plurals with an omitted offset or explicit numeric `offset: 0` are unchanged. The examples consume the published packages and unchanged OTA payloads.
SDK **1.9.0** serves OTA from `https://cdn.rerune.io/api/ota/<publishId>/manifest.json`, with the publish ID in the URL path and no identity header. It applies a locale version only when every remote value is compatible with the placeholders, plurals, and formats the app ships; otherwise the previous copy stays in use. Staging previews and hosted cardinal plurals with an omitted offset or explicit numeric `offset: 0` are unchanged. The examples consume the published packages and unchanged OTA payloads.

## Boundaries

- Reactive translation consumers update. Previously saved strings, static pages, and prerendered output need recalculation or rebuilding.
- Updates are asynchronous checks while the app runs, not push delivery or OS background work. All manifest languages are considered; a failed language can retain older copy.
- Updates are asynchronous checks while the app runs: at startup, on refresh, every 24 hours, and when the app returns to the foreground. They are not push delivery or OS background work. A check covers the shown language and its fallback languages; another published language loads from the cache or downloads when the app shows it, without a manifest request. A failed language can retain older copy.
- Variants select among delivered project resources. They are not access controls.
- OTA supports plain text, declared interpolation, and one cardinal plural. A bundled engine's MessageFormat support does not expand OTA grammar.
- Built-in caches retain updates in session memory if persistence fails. Read the chosen app's guide for cache behavior.
- If persistence fails, an update still applies for the current session; a restart starts from the last successful write. The React and Expo apps now use the SDK's default cache keys, so a browser or device that ran their 1.8.0 build downloads translations once more and starts at the Main edition. Read the chosen app's guide for cache behavior.

## Packages and documentation

[ReRune](https://rerune.io) · [Developer guide](https://rerune.io/developer-localization-platform) · [Core](https://www.npmjs.com/package/@rerune/core) · [React](https://www.npmjs.com/package/@rerune/react) · [React Native](https://www.npmjs.com/package/@rerune/react-native) · [Angular](https://www.npmjs.com/package/@rerune/angular)
[ReRune](https://rerune.io) · [Developer guide](https://rerune.io/developer-localization-platform) · [React](https://www.npmjs.com/package/@rerune/react) · [React Native](https://www.npmjs.com/package/@rerune/react-native) · [Angular](https://www.npmjs.com/package/@rerune/angular)

For checks, CI, screenshots, and shared-asset maintenance, see [Contributing](CONTRIBUTING.md). Code and vector artwork use the [MIT notice](LICENSE). Instrument Sans and Lora include their SIL Open Font License notices in [the shared font directory](examples/shared/fonts/).
Loading
Loading