refactor(i18n)!: consume the shared runtime from @stream-io/i18n - #3284
Open
oliverlaz wants to merge 2 commits into
Open
refactor(i18n)!: consume the shared runtime from @stream-io/i18n#3284oliverlaz wants to merge 2 commits into
oliverlaz wants to merge 2 commits into
Conversation
BREAKING CHANGE: requires `@stream-io/i18n` and `stream-chat@^10.0.0-rc.10`. Retargets every `stream-chat/i18n` import to `@stream-io/i18n`, which is where the shared runtime now lives. The API is unchanged; only the specifier moves. `languageNameDefaults` / `LanguageNameCatalog` come from `stream-chat`'s root barrel instead β they enumerate the languages the Chat API can auto-translate a message into, so they stayed with Chat rather than moving to the generic package. `TranslationContext` and `useStreami18n` are now built on the shared bindings in `@stream-io/i18n/react`, so this SDK and the React Native one no longer carry two copies of the same context plumbing and store subscription. What stays here is what is genuinely this SDK's: the catalog-typed `t`, the notification translation topic, and supplying a context *default* rather than throwing, which is what lets a primitive render outside `<Chat>`. `@stream-io/i18n` is a regular dependency, not a peer: an integrator never imports it β they import the `Streami18n` this package subclasses and re-exports. Also fixes `yarn types`, which silently checked nothing. It ran `tsc` with no `--project`, picking up the root solution file (`"files": []`), and exited 0 even with a deliberate error in `src/`. It is now `tsc -p tsconfig.lib.json --noEmit` and is wired into CI, which previously typechecked only the build scripts.
oliverlaz
requested review from
MartinCupela,
isekovanic,
jdimovska and
szuperaz
September 10, 2026 13:04
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the βοΈ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
BREAKING CHANGE: adds `@stream-io/state-store` as a dependency. `stream-chat` no longer re-exports `StateStore`, so the 22 modules that imported it from there now take it from the package that defines it. No behaviour change β the store instances are the same objects, only the import specifier moves. A single shared declaration matters here: TypeScript compares classes with `protected` members nominally, so two copies would not be assignable to one another and `useStateStore` would stop typechecking against stores handed over by `stream-chat` or `@stream-io/i18n`.
MartinCupela
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retargets every
stream-chat/i18nimport to@stream-io/i18n, where the shared runtime now lives. The API is unchanged β only the specifier moves.@stream-io/i18n@1.0.0andstream-chat@10.0.0-rc.10are not on npm yet, soyarn.lockcannot be regenerated and is deliberately left untouched in this PR. Everything else is reviewable now. Locally this was verified against packed tarballs of both.What changed
stream-chat/i18nimport β@stream-io/i18n(5 files plus the codegen script).languageNameDefaults/LanguageNameCatalognow come fromstream-chat's root barrel β they enumerate the languages the Chat API can auto-translate a message into, so they stayed with Chat.TranslationContextanduseStreami18nare built on the shared bindings in@stream-io/i18n/react, so this SDK and React Native stop carrying two copies of the same context plumbing and store subscription.What stays this SDK's own: the catalog-typed
t, the notification translation topic, and supplying a context default rather than throwing β which is what lets a primitive render outside<Chat>(React Native throws instead, which is why the shared factory takes that as an option).@stream-io/i18nis a regular dependency, not a peer: an integrator never imports it β they import theStreami18nthis package subclasses and re-exports.Also fixes:
yarn typeschecked nothingIt ran
tscwith no--project, so it picked up the root solution file ("files": []) and exited 0 even with a deliberate type error insrc/. It is nowtsc -p tsconfig.lib.json --noEmit, verified to fail on a planted error, and added to CI β which previously typechecked only the build scripts, so a library type error could reachmaster.CLAUDE.md/AGENTS.mdupdated accordingly (they documented the trap rather than fixing it).Verification
yarn types(the real one),yarn lint, and 2,769 tests all pass against locally-linked builds of@stream-io/i18nandstream-chat. Also verified end-to-end in the Vite example: switching language at runtime updates copy, plurals, placeholders, aria-labels and dates βTue, 2 AugβDi., 2. Aug.,08/02/2022β02.08.2022β with no reload.Merge order
After js-toolkit#51 and stream-chat-js#1861, then rerun
yarn installto commit a real lockfile.