Skip to content

Commit 8e3e506

Browse files
authored
docs: add notes about new build pipeline to migration guide (#2443)
1. Adds a section about the new build pipeline to the v12 migration guide 2. Fixes a couple of typos
1 parent aeb87ff commit 8e3e506

File tree

1 file changed

+42
-23
lines changed

1 file changed

+42
-23
lines changed

docusaurus/docs/React/release-guides/upgrade-to-v12.mdx

Lines changed: 42 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ The `Avatar` styles are applied through CSS from the version 12 upwards. Therefo
2929
5. As a consequence of the `Avatar` props changes, the `TypingIndicator` prop `avatarSize` have been removed as well.
3030

3131
:::important
32-
**Action required**<br/>
33-
1 Migrate CSS applied to `.str-chat__avatar--${shape}` or re-apply the class through `Avatar` `className` prop.<br/>
34-
2 Migrate CSS applied to `.str-chat__avatar-image--loaded` to `.str-chat__avatar-image` class.<br/>
35-
3 If needed, apply custom styles to newly added classes based on the component that renders the `Avatar`.<br/>
32+
**Action required**
33+
1\. Migrate CSS applied to `.str-chat__avatar--${shape}` or re-apply the class through `Avatar` `className` prop.
34+
2\. Migrate CSS applied to `.str-chat__avatar-image--loaded` to `.str-chat__avatar-image` class.
35+
3\. If needed, apply custom styles to newly added classes based on the component that renders the `Avatar`.
3636
:::
3737

3838
## Removal of deprecated components
@@ -42,7 +42,7 @@ The `Avatar` styles are applied through CSS from the version 12 upwards. Therefo
4242
The attachment rendering functions were replaced with their component equivalents:
4343

4444
:::important
45-
**Action required**<br/>
45+
**Action required**
4646
Replace the render functions in your custom components with container components alternatives.
4747
:::
4848

@@ -61,7 +61,7 @@ Replace the render functions in your custom components with container components
6161
Until now, it was possible to import two stylesheets as follows:
6262

6363
```
64-
import 'stream-chat-react/dist/css/v2/index.css';
64+
import 'stream-chat-react/dist/css/v1/index.css';
6565
```
6666

6767
The legacy stylesheet has been removed from the SDK bundle, and therefore it is only possible to import one stylesheet from now on:
@@ -71,7 +71,7 @@ import 'stream-chat-react/dist/css/v2/index.css';
7171
```
7272

7373
:::important
74-
**Action required**<br/>
74+
**Action required**
7575
Make sure you are importing the default styles correctly as `import 'stream-chat-react/dist/css/v2/index.css';`
7676
:::
7777

@@ -80,7 +80,7 @@ Make sure you are importing the default styles correctly as `import 'stream-chat
8080
With the version 10 of `stream-chat-react` new stylesheet has been introduced. The stylesheet used previously became a legacy stylesheet. Legacy stylesheet had often times CSS classes and SDK components, that were not supported with the new stylesheet. Now, the legacy stylesheet and corresponding CSS classes and SDK component are being removed.
8181

8282
:::caution
83-
These changes will impact you only, if you have imported the CSS as one of the following (you have used the legacy styles):
83+
These changes will impact you only if you have imported the CSS as one of the following (you have used the legacy styles):
8484

8585
```
8686
import 'stream-chat-react/css/index.css';
@@ -97,8 +97,8 @@ import '@stream-io/stream-chat-css/dist/css/index.css';
9797
Supporting two stylesheet lead to introduction of a flag `themeVersion` into the `ChatContext`. This flag is no more necessary and has been removed from the context value.
9898

9999
:::important
100-
**Action required**<br/>
101-
Make sure you are not using `themeVersion in your custom components.
100+
**Action required**
101+
Make sure you are not using `themeVersion` in your custom components.
102102
:::
103103

104104
### Removal of styles related Chat props
@@ -114,17 +114,17 @@ Also associated parts of code were removed:
114114
- `useCustomStyles` hook
115115

116116
:::important
117-
**Action required**<br/>
118-
1 The styles applied through `customStyles` should be applied through custom CSS.
119-
2 Theme (not only dark theme) can be through `Chat` prop `theme` instead of `darkMode`
117+
**Action required**
118+
1\. The styles applied through `customStyles` should be applied through custom CSS.
119+
2\. Theme (not only dark theme) can be through `Chat` prop `theme` instead of `darkMode`
120120
:::
121121

122122
### Removal from ComponentContext
123123

124124
- `AutocompleteSuggestionHeader` - the up-to-date SDK markup does not count with a header in the `ChatAutoComplete` suggestion list
125125

126126
:::important
127-
**Action required**<br/>
127+
**Action required**
128128
Make sure you are passing these custom components to the `Channel` component.
129129
:::
130130

@@ -133,10 +133,10 @@ Make sure you are passing these custom components to the `Channel` component.
133133
The following components are not available anymore as they were related to legacy stylesheet and are not used by the latest SDK components.
134134

135135
:::important
136-
**Action required**<br/>
137-
1 Remove imports of these components from `stream-chat-react` in your custom components.<br/>
138-
2 If importing `SendIconV2` rename it to `SendIcon`.<br/>
139-
3 Remove the listed classes if used in your CSS.
136+
**Action required**
137+
1\. Remove imports of these components from `stream-chat-react` in your custom components.
138+
2\. If importing `SendIconV2` rename it to `SendIcon`.
139+
3\. Remove the listed classes if used in your CSS.
140140
:::
141141

142142
| Component | Details | Removed CSS classes |
@@ -161,7 +161,7 @@ The following components are not available anymore as they were related to legac
161161
The `FileIcon` component does not accept argument `version` anymore. This parameter used to determine the file icon set. There were two sets - version `'1'` and `'2'`. The icons of version `'1'` have been rendered with legacy stylesheets in the SDK components. The icons displayed under the version `'1'` have been removed now.
162162

163163
:::important
164-
**Action required**<br/>
164+
**Action required**
165165
Remove prop `version` if the `FileIcon` is used in your custom components.
166166
:::
167167

@@ -170,7 +170,7 @@ Remove prop `version` if the `FileIcon` is used in your custom components.
170170
We have removed classes that were used in the legacy CSS stylesheet only and thus are redundant. We recommend to use classes that were already available previously and are used by the SDK stylesheet:
171171

172172
:::important
173-
**Action required**<br/>
173+
**Action required**
174174
Replace the removed classes with their alternatives in the custom CSS.
175175
:::
176176

@@ -222,7 +222,7 @@ Replace the removed classes with their alternatives in the custom CSS.
222222
Migration to non-legacy styles leads to rendering of markup with the following classes:
223223

224224
:::important
225-
**Action required**<br/>
225+
**Action required**
226226
Verify your app layout is not broken and adjust the CSS if necessary.
227227
:::
228228

@@ -233,7 +233,7 @@ Verify your app layout is not broken and adjust the CSS if necessary.
233233
### Removed types
234234

235235
:::important
236-
**Action required**<br/>
236+
**Action required**
237237
Import type alternatives if necessary.
238238
:::
239239

@@ -246,6 +246,25 @@ Import type alternatives if necessary.
246246
The `TypingIndicator` component does not render avatars as it used to with legacy stylesheet. Therefore, its prop `Avatar` has been removed.
247247

248248
:::important
249-
**Action optional**<br/>
249+
**Action optional**
250250
Provide custom `TypingIndicator` through the `Channel` prop.
251251
:::
252+
253+
## Updated browser target
254+
255+
Version 12 targets browsers that support ES2020. In particular, the code includes `async` functions, optional chaining (`?.`), and nullish coalescing (`??`). These features have been supported by all major desktop and mobile browsers for years, so it made sense for us to raise the baseline.
256+
257+
If you need to support older browsers, you should transpile your bundle using `babel` or a similar tool.
258+
259+
:::important
260+
**Action optional**
261+
If you're targeting browsers that don't support ES2020, use a transpilation tool like `babel` to process your bundle.
262+
:::
263+
264+
## Browser bundle removed from the package
265+
266+
Prior to version 12, we included the browser bundle in the package, which could be added to the page using the `<script>` tag. We no longer ship the browser bundle.
267+
268+
Using the browser bundle was never recommended, and it was mostly for testing purposes. If you still want to quickly add the SDK using the `<script>` tag, you can use services such as [https://esm.sh/](esm.sh) or [https://www.unpkg.com/](unpkg.com).
269+
270+
Installing the package from NPM and then bundling it with your application is still the best way to use the SDK.

0 commit comments

Comments
 (0)