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
49 changes: 37 additions & 12 deletions ai-docs/ai-migration-v14-v15.md

Large diffs are not rendered by default.

6 changes: 1 addition & 5 deletions ai-docs/i18n-v15-key-map.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$comment": "Migration table: natural-language translation key (v14) -> namespaced key (v15). Hand-reviewed; nothing regenerates it. Integrators who passed translationsForLanguage/registerTranslation dictionaries keyed on the old strings should use this to rename their keys. Where one v14 key became several v15 keys, `key` is the first and `also` lists the rest: copy the translation to each. See ai-docs/i18n-v15-migration.md.",
"count": 661,
"count": 660,
"keys": {
"aria/Active": {
"key": "a11y.accessibleLabel.active.ariaLabel",
Expand Down Expand Up @@ -2020,10 +2020,6 @@
"key": "messageComposer.geolocationPreview.sharedLocation.title",
"prose": true
},
"Attach files": {
"key": "messageComposer.icons.attachFiles.text",
"prose": true
},
"aria/Cancel Reply": {
"key": "messageComposer.quotedMessagePreview.cancelReply.ariaLabel",
"prose": true
Expand Down
4 changes: 2 additions & 2 deletions ai-docs/i18n-v15-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ imported and copied into `Streami18n` at construction, so they shipped even if y

## Renaming your keys

Every old key that v15 still has maps to a new key ([some were removed](#keys-removed-without-a-replacement)). A few now feed two: their entry lists the second under `also`, and the translation goes on both. The full table (661 rows, covering the `aiComponents.*` keys of `stream-chat-react/ai-components` except the attachment's `Image`, which the plugin README maps) is
Every old key that v15 still has maps to a new key ([some were removed](#keys-removed-without-a-replacement)). A few now feed two: their entry lists the second under `also`, and the translation goes on both. The full table (660 rows, covering the `aiComponents.*` keys of `stream-chat-react/ai-components` except the attachment's `Image`, which the plugin README maps) is
[`i18n-v15-key-map.json`](https://github.com/GetStream/stream-chat-react/blob/master/ai-docs/i18n-v15-key-map.json):

```json
Expand Down Expand Up @@ -107,7 +107,7 @@ nothing catches a stale one there. The extra plural categories some languages us
These v14 keys (from `src/i18n/en.json` at `v14.10.0`, plural suffixes folded) have no entry in the key map. A `t()` call on one of them no longer compiles (`TS2769`), and a dictionary entry for one never matches. Copy you still need is app-owned now: give it a key of your own through `asDynamicKey`, with the English inline, and keep its translations in your dictionaries ([Calling `t` in your own components](#calling-t-in-your-own-components)).

```text
{{ imageCount }} more | {{ user }} is typing... | {{ users }} and {{ user }} are typing... | {{ users }} and more are typing... | +{{ imageCount }} | Allow comments | Allow option suggestion | aria/Collapse sidebar | aria/Expand sidebar | aria/Unblock User | Attachment | Channel members | Close emoji picker | Commands matching | Connection failure, reconnecting now... | Create | Delete for me | Download attachment {{ name }} | Drag your files here to add to your post | Emoji matching | End | End vote | Error connecting to chat, refresh the page to try again. | Error removing members | Error uploading file | Error uploading image | Failed to delete the message | Failed to load channels | Failed to load more channels | Failed to mark channel as read | File is too large: {{ size }}, maximum upload size is {{ limit }} | Image | Link | live | Manage members | Maximum number of votes (from 2 to 10) | mention/Channel | mention/Here | Menu | Messages have been marked unread. | Missing permissions to upload the attachment | network error | New | No chats here yet… | Nobody will be able to vote in this poll anymore. | Ok | Open emoji picker | People matching | Remove | Remove {{ count }} members | Remove channel members | Removed {{ count }} members | Reply to Message | Searching... | searchResultsCount | Select a thread to continue the conversation | Shared live location | Slow Mode ON | Submit | Thread reply | Upload type: "{{ type }}" is not allowed | You've reached the maximum number of files
{{ imageCount }} more | {{ user }} is typing... | {{ users }} and {{ user }} are typing... | {{ users }} and more are typing... | +{{ imageCount }} | Allow comments | Allow option suggestion | aria/Collapse sidebar | aria/Expand sidebar | aria/Unblock User | Attach files | Attachment | Channel members | Close emoji picker | Commands matching | Connection failure, reconnecting now... | Create | Delete for me | Download attachment {{ name }} | Drag your files here to add to your post | Emoji matching | End | End vote | Error connecting to chat, refresh the page to try again. | Error removing members | Error uploading file | Error uploading image | Failed to delete the message | Failed to load channels | Failed to load more channels | Failed to mark channel as read | File is too large: {{ size }}, maximum upload size is {{ limit }} | Image | Link | live | Manage members | Maximum number of votes (from 2 to 10) | mention/Channel | mention/Here | Menu | Messages have been marked unread. | Missing permissions to upload the attachment | network error | New | No chats here yet… | Nobody will be able to vote in this poll anymore. | Ok | Open emoji picker | People matching | Remove | Remove {{ count }} members | Remove channel members | Removed {{ count }} members | Reply to Message | Searching... | searchResultsCount | Select a thread to continue the conversation | Shared live location | Slow Mode ON | Submit | Thread reply | Upload type: "{{ type }}" is not allowed | You've reached the maximum number of files
```

```tsx
Expand Down
75 changes: 74 additions & 1 deletion ai-docs/v15-breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ yarn api-surface check --doc ai-docs/v15-breaking-changes.md --diff diff.json

## Index

96 entries.
98 entries.

| ID | Title | Group |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
Expand Down Expand Up @@ -163,6 +163,8 @@ yarn api-surface check --doc ai-docs/v15-breaking-changes.md --diff diff.json
| [BC-093](#bc-093) | `MessageContextValue.onMentionsClickMessage` / `onMentionsHoverMessage` and `useMentionsHandler`'s handlers are `undefined` without a handler | Messages and message lists |
| [BC-094](#bc-094) | `mentionsMarkdownPlugin` and `createMentionPluginAndDisplayTextSet` take mention entities only | Messages and message lists |
| [BC-095](#bc-095) | `disableQuotedMessages` is removed from `MessageProps`, `MessageListProps` and `useMessagePermissions` | Messages and message lists |
| [BC-097](#bc-097) | channel detail views render no close button outside a modal without `onClose`; `ChannelDetail` calls `onLayoutChange` | Chat, ChatView and layout |
| [BC-101](#bc-101) | `Root`, `Header`, `UploadIcon`, `BinIcon`, `PauseIcon`, `PlayIcon` unexported; `@stream-io/transliterate` dropped; `CustomChannelData` typed for apps; `DefaultChannelData` holds only `name` and `image` | Package and runtime |
| [BC-102](#bc-102) | `initialMessage` is removed from `MessageProps` and `MessageContextValue`; `useIsRenderedAsThreadParent()` tells the thread's parent message apart | Messages and message lists |

## Package and runtime
Expand Down Expand Up @@ -246,6 +248,77 @@ export const DayDivider = ({ message }: { message: LocalMessage }) => {
};
```

<a id="bc-101"></a>

### BC-101: `Root`, `Header`, `UploadIcon`, `BinIcon`, `PauseIcon` and `PlayIcon` are no longer exported; `@stream-io/transliterate` is no longer a dependency; `CustomChannelData` is typed for apps and `DefaultChannelData` holds only `name` and `image`

- Status: confirmed
- Area: package / exports / types
- User impact:
- compile error (`TS2305`) on importing `Root` or `Header` from `stream-chat-react`, and `undefined` in plain JS. They are the parts of `Alert`, exported under generic names; `Alert.Root`, `Alert.Header` and `Alert.Actions` are unchanged.
- compile error (`TS2305`) on importing `UploadIcon`, `BinIcon`, `PauseIcon` or `PlayIcon`. No SDK component rendered them in v14 or v15.
- install: `@stream-io/transliterate` is no longer installed with this package. No SDK code imported it in v14 or v15; an app that imports it without declaring it gets a module-not-found error.
- types: `channel.data.custom.name` and `.image` are typed `string | undefined` in every app that imports `stream-chat-react`. v14 and earlier v15 release candidates declared the merge of `DefaultChannelData` into `CustomChannelData` in a file `tsc` did not emit, so apps saw `CustomChannelData` without those fields. An app that augments `CustomChannelData` with `name` or `image` under another type gets no error with `skipLibCheck: true` (its own type wins), and `TS2430` inside `stream-chat`'s `custom_types.d.ts` without it.
- types: `DefaultChannelData` loses `subtitle` and `team`. No SDK code read them; `team` is a top-level channel field in `stream-chat` v10 (`channel.data.team`), not custom data. Code that reads `DefaultChannelData['team']`, or relies on `extends DefaultChannelData` to type `custom.subtitle` / `custom.team`, gets `TS2339`.
- Old API:
- `Root`, `Header` (`src/components/Dialog/components/Alert.tsx`), re-exported from the package root through `Dialog/components/index.ts`
- `UploadIcon`, `BinIcon`, `PauseIcon`, `PlayIcon` (`src/components/MessageComposer/icons.tsx`), re-exported through `MessageComposer/index.ts`
- `optionalDependencies['@stream-io/transliterate']: ^1.5.5`
- `DefaultChannelData`: `image`, `name`, `subtitle`, `team` (all `string | undefined`)
- `src/@types/stream-chat-custom-data.d.ts`, a declaration-only file that `tsc` never copies to `dist/types`
- Replacement:
- `Root` / `Header`: `Alert.Root` / `Alert.Header`, the same components.
- The icons: copy the SVG into the app, or use the v15 icon set: `IconPlus` or `IconAttachment` for `UploadIcon`, `IconDelete` for `BinIcon`, `IconPauseFill` for `PauseIcon`, `IconPlayFill` for `PlayIcon`. They follow the v15 design, not the v14 shapes, and take `BaseIconProps`.
- `@stream-io/transliterate`: add it to the app's own dependencies if the app imports it. Mention search in `stream-chat` takes a `transliterate` function on its mentions middleware.
- `CustomChannelData`: delete an app's own `name?: string` / `image?: string` declarations, which are now redundant, and keep the augmentation for the app's other fields. Rename a field the app declares as `name` or `image` with another type. Declare `subtitle?: string` / `team?: string` on `CustomChannelData` if the app stores them under `custom`; read the channel's team from `channel.data.team`.
- Evidence:
- `release-v14:src/components/Dialog/components/Alert.tsx:6`, `:25` `export const Root` / `export const Header`; `master:src/components/Dialog/components/Alert.tsx` declares both without `export` and exports them as `Alert.Root` / `Alert.Header`, like `Prompt` and `Viewer`
- `release-v14:src/components/MessageComposer/icons.tsx:3`, `:30`, `:36`, `:47`; `release-v14:src/components/MessageComposer/index.ts:19` `export * from './icons'`; no other reference in `src` or `examples` on either branch
- `release-v14:package.json:122` `"@stream-io/transliterate": "^1.5.5"`; no import in `src` on either branch
- `release-v14:src/@types/stream-chat-custom-data.d.ts:19` `interface CustomChannelData extends DefaultChannelData {}`; `release-v14:tsconfig.lib.json` emits declarations from `.ts` sources only, so `dist/types/@types` does not exist. `master:src/types/defaultDataInterfaces.ts` declares `DefaultChannelData` with `image` and `name` only, declares the merge and ships as `dist/types/types/defaultDataInterfaces.d.ts`, re-exported from `dist/types/index.d.ts`
- commit: REACT-1306
- Docs impact:
- `02-state/01-state-and-entities/06-data-conventions.md` (the `CustomChannelData` augmentation sample), `08-release-guides/01-upgrade-to-v15.md`
- Example needed: yes

Before (v14):

```tsx
import { Header, Root } from 'stream-chat-react';

declare module 'stream-chat' {
interface CustomChannelData {
image?: string;
name?: string;
priority?: number;
}
}

export const DeleteWarning = () => (
<Root>
<Header title='Delete channel?' />
</Root>
);
```

After (v15):

```tsx
import { Alert } from 'stream-chat-react';

declare module 'stream-chat' {
interface CustomChannelData {
priority?: number;
}
}

export const DeleteWarning = () => (
<Alert.Root>
<Alert.Header title='Delete channel?' />
</Alert.Root>
);
```

## Contexts and customization

<a id="bc-003"></a>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import type { DefaultAttachmentData, DefaultChannelData } from 'stream-chat-react';
import type { DefaultAttachmentData } from 'stream-chat-react';

declare module 'stream-chat' {
interface CustomAttachmentData extends DefaultAttachmentData {
image?: string;
name?: string;
url?: string;
}

interface CustomChannelData extends DefaultChannelData {
image?: string;
}
}
1 change: 0 additions & 1 deletion examples/vite/src/i18n/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,6 @@ export const deTranslations = {
'messageComposer.geolocationPreview.removeLocationAttachment.ariaLabel':
'Standortanhang entfernen',
'messageComposer.geolocationPreview.sharedLocation.title': 'Geteilter Standort',
'messageComposer.icons.attachFiles.text': 'Dateien anhängen',
'messageComposer.quotedMessagePreview.cancelReply.ariaLabel': 'Antwort abbrechen',
'messageComposer.quotedMessagePreview.files.label_one': '{{ count }} Datei',
'messageComposer.quotedMessagePreview.files.label_other': '{{ count }} Dateien',
Expand Down
1 change: 0 additions & 1 deletion examples/vite/src/i18n/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ export const itTranslations = {
'messageComposer.geolocationPreview.removeLocationAttachment.ariaLabel':
'Rimuovi l’allegato di posizione',
'messageComposer.geolocationPreview.sharedLocation.title': 'Posizione condivisa',
'messageComposer.icons.attachFiles.text': 'Allega file',
'messageComposer.quotedMessagePreview.cancelReply.ariaLabel': 'Annulla risposta',
'messageComposer.quotedMessagePreview.files.label_one': '{{ count }} file',
'messageComposer.quotedMessagePreview.files.label_other': '{{ count }} file',
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@
"use-sync-external-store": "^1.7.0",
"zod": "^4.2.0"
},
"optionalDependencies": {
"@stream-io/transliterate": "^1.5.5"
},
"peerDependencies": {
"@a2ui/react": "~0.15.0",
"@a2ui/web_core": "~0.15.0",
Expand Down
39 changes: 0 additions & 39 deletions src/@types/stream-chat-custom-data.d.ts

This file was deleted.

18 changes: 0 additions & 18 deletions src/components/Attachment/icons.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
import React from 'react';
import type { IconProps } from '../../types/types';

export const DownloadIcon = ({ className }: IconProps) => (
<svg
className={className}
data-testid='download'
fill='none'
height='24'
viewBox='0 0 24 24'
width='24'
xmlns='http://www.w3.org/2000/svg'
>
<path
d='M19.35 10.04C18.67 6.59 15.64 4 12 4C9.11 4 6.6 5.64 5.35 8.04C2.34 8.36 0 10.91 0 14C0 17.31 2.69 20 6 20H19C21.76 20 24 17.76 24 15C24 12.36 21.95 10.22 19.35 10.04ZM19 18H6C3.79 18 2 16.21 2 14C2 11.95 3.53 10.24 5.56 10.03L6.63 9.92L7.13 8.97C8.08 7.14 9.94 6 12 6C14.62 6 16.88 7.86 17.39 10.43L17.69 11.93L19.22 12.04C20.78 12.14 22 13.45 22 15C22 16.65 20.65 18 19 18ZM13.45 10H10.55V13H8L12 17L16 13H13.45V10Z'
fill='black'
/>
</svg>
);

export const ExternalLinkIcon = () => (
<svg fill='currentColor' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg'>
Expand Down
1 change: 0 additions & 1 deletion src/components/Channel/__tests__/Channel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import type { ChannelProps } from '../Channel';
import { convertDateToTimestamp } from '../../../mock-builders';

vi.mock('../../Loading', () => ({
LoadingChannel: vi.fn(() => <div>Loading channel</div>),
LoadingErrorIndicator: vi.fn(() => <div />),
LoadingIndicator: vi.fn(() => <div>loading</div>),
}));
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dialog/components/Alert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import clsx from 'clsx';
import { useModalContext } from '../../../context';
import { useAriaIdentifiers } from '../../../a11y/hooks/useAriaIdentifiers';

export const Root = forwardRef<HTMLDivElement, ComponentProps<'div'>>(function AlertRoot(
const Root = forwardRef<HTMLDivElement, ComponentProps<'div'>>(function AlertRoot(
{ children, className, ...props }: ComponentProps<'div'>,
ref,
) {
Expand All @@ -22,7 +22,7 @@ export type AlertHeaderProps = ComponentProps<'div'> & {
titleId?: string;
};

export const Header = forwardRef<HTMLDivElement, AlertHeaderProps>(function AlertHeader(
const Header = forwardRef<HTMLDivElement, AlertHeaderProps>(function AlertHeader(
{ children, className, description, descriptionId, Icon, title, titleId, ...props },
ref,
) {
Expand Down
Loading
Loading