Skip to content

Commit 0f043f2

Browse files
authored
chore: upgrade to React v19 (#2615)
1 parent 893e407 commit 0f043f2

File tree

100 files changed

+2479
-2670
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2479
-2670
lines changed

.releaserc.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@
7272
}
7373
],
7474
[
75-
"@semantic-release/exec", {
76-
"prepareCmd": "NEXT_VERSION=${nextRelease.version} npm run build"
77-
}],
75+
"@semantic-release/exec",
76+
{
77+
"prepareCmd": "NEXT_VERSION=${nextRelease.version} npm run build"
78+
}
79+
],
7880
[
7981
"@semantic-release/changelog",
8082
{

package.json

+11-14
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@
122122
"react-dropzone": "^14.2.3",
123123
"react-fast-compare": "^3.2.2",
124124
"react-image-gallery": "1.2.12",
125-
"react-is": "^18.1.0",
126125
"react-markdown": "^8.0.7",
127126
"react-player": "2.10.1",
128127
"react-popper": "^2.3.0",
@@ -144,8 +143,8 @@
144143
"@emoji-mart/data": "^1.1.0",
145144
"@emoji-mart/react": "^1.1.0",
146145
"emoji-mart": "^5.4.0",
147-
"react": "^18.0.0 || ^17.0.0 || ^16.8.0",
148-
"react-dom": "^18.0.0 || ^17.0.0 || ^16.8.0",
146+
"react": "^19.0.0 || ^18.0.0 || ^17.0.0 || ^16.8.0",
147+
"react-dom": "^19.0.0 || ^18.0.0 || ^17.0.0 || ^16.8.0",
149148
"stream-chat": "^8.50.0"
150149
},
151150
"peerDependenciesMeta": {
@@ -189,12 +188,12 @@
189188
"@semantic-release/git": "^10.0.1",
190189
"@stream-io/rollup-plugin-node-builtins": "^2.1.5",
191190
"@stream-io/stream-chat-css": "^5.6.0",
192-
"@testing-library/jest-dom": "^6.1.4",
193-
"@testing-library/react": "^13.1.1",
194-
"@testing-library/react-hooks": "^8.0.0",
191+
"@testing-library/jest-dom": "^6.6.3",
192+
"@testing-library/react": "^16.2.0",
195193
"@types/deep-equal": "^1.0.1",
196194
"@types/dotenv": "^8.2.0",
197195
"@types/hast": "^2.3.4",
196+
"@types/jest": "^29.5.14",
198197
"@types/jsdom": "^21.1.5",
199198
"@types/linkifyjs": "^2.1.3",
200199
"@types/lodash.debounce": "^4.0.7",
@@ -203,10 +202,9 @@
203202
"@types/lodash.throttle": "^4.1.7",
204203
"@types/lodash.uniqby": "^4.7.7",
205204
"@types/moment": "^2.13.0",
206-
"@types/react": "^18.2.55",
207-
"@types/react-dom": "^18.2.19",
205+
"@types/react": "^19.0.7",
206+
"@types/react-dom": "^19.0.3",
208207
"@types/react-image-gallery": "^1.2.4",
209-
"@types/react-is": "^18.2.4",
210208
"@types/textarea-caret": "3.0.0",
211209
"@types/use-sync-external-store": "^0.0.6",
212210
"@types/uuid": "^8.3.0",
@@ -250,17 +248,16 @@
250248
"i18next-parser": "^6.0.0",
251249
"jest": "^29.7.0",
252250
"jest-axe": "^8.0.0",
253-
"jest-environment-jsdom": "^28.1.3",
251+
"jest-environment-jsdom": "^29.7.0",
254252
"jsdom": "^24.1.1",
255253
"lint-staged": "^15.2.1",
256254
"moment-timezone": "^0.5.43",
257255
"prettier": "^2.2.0",
258-
"react": "^18.1.0",
259-
"react-dom": "^18.1.0",
260-
"react-test-renderer": "^18.1.0",
256+
"react": "^19.0.0",
257+
"react-dom": "^19.0.0",
261258
"semantic-release": "^19.0.5",
262259
"stream-chat": "^8.50.0",
263-
"ts-jest": "^29.1.4",
260+
"ts-jest": "^29.2.5",
264261
"typescript": "^5.4.5"
265262
},
266263
"scripts": {

src/components/Attachment/__tests__/AttachmentActions.test.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import '@testing-library/jest-dom';
33
import { fireEvent, render, waitFor } from '@testing-library/react';
44

5-
import renderer from 'react-test-renderer';
65
import { nanoid } from 'nanoid';
76
import { AttachmentActions } from '../AttachmentActions';
87

@@ -22,16 +21,14 @@ const actions = [
2221

2322
describe('AttachmentActions', () => {
2423
it('should render AttachmentActions component', () => {
25-
const tree = renderer
26-
.create(
27-
getComponent({
28-
actionHandler: jest.fn(),
29-
actions,
30-
id: nanoid(),
31-
}),
32-
)
33-
.toJSON();
34-
expect(tree).toMatchSnapshot();
24+
const { container } = render(
25+
getComponent({
26+
actionHandler: jest.fn(),
27+
actions,
28+
id: nanoid(),
29+
}),
30+
);
31+
expect(container).toMatchSnapshot();
3532
});
3633
it('should call actionHandler on click', async () => {
3734
const actionHandler = jest.fn();

src/components/Attachment/__tests__/File.test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2+
import { render } from '@testing-library/react';
23
import '@testing-library/jest-dom';
3-
import renderer from 'react-test-renderer';
44

55
import { FileAttachment } from '../FileAttachment';
66
import { TranslationContext } from '../../../context';
@@ -23,7 +23,7 @@ const file = {
2323

2424
describe('File', () => {
2525
it('should render File component', () => {
26-
const tree = renderer.create(getComponent({ attachment: file })).toJSON();
27-
expect(tree).toMatchSnapshot();
26+
const { container } = render(getComponent({ attachment: file }));
27+
expect(container).toMatchSnapshot();
2828
});
2929
});
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`AttachmentActions should render AttachmentActions component 1`] = `
4-
<div
5-
className="str-chat__message-attachment-actions"
6-
>
4+
<div>
75
<div
8-
className="str-chat__message-attachment-actions-form"
6+
class="str-chat__message-attachment-actions"
97
>
10-
<span />
11-
<button
12-
className="str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--undefined"
13-
data-testid="action 1 name"
14-
data-value="action 1"
15-
onClick={[Function]}
8+
<div
9+
class="str-chat__message-attachment-actions-form"
1610
>
17-
action 1 text
18-
</button>
19-
<button
20-
className="str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--undefined"
21-
data-testid="action 2 name"
22-
data-value="action 2"
23-
onClick={[Function]}
24-
>
25-
action 2 text
26-
</button>
11+
<span />
12+
<button
13+
class="str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--undefined"
14+
data-testid="action 1 name"
15+
data-value="action 1"
16+
>
17+
action 1 text
18+
</button>
19+
<button
20+
class="str-chat__message-attachment-actions-button str-chat__message-attachment-actions-button--undefined"
21+
data-testid="action 2 name"
22+
data-value="action 2"
23+
>
24+
action 2 text
25+
</button>
26+
</div>
2727
</div>
2828
</div>
2929
`;

0 commit comments

Comments
 (0)