Skip to content

Commit 31ec1ca

Browse files
authored
React 19 upgrade (#1008)
* Upgrade React, Dom to 19; testing-lib to 16 * Update tsconfig * Upgrade storybook 8 * Fix unit tests * Fix build * Fix lint * Replace react-popper with floating-ui/react; replace storybook/addon-styling with storybook/addon-themes * Upgrade Jest to 29 * Fix more unit tests; PopOver component * Fix storybook related issues * Fix PopOver component and unit tests * Update package-lock.json * Update supported node and npm versions * Upgrate chime js sdk to the latest * Resolve comments, update React to 19.2 * Fix /docs/themes--page links * Add CHANGELOG, fix issues when running build:release
1 parent 0093322 commit 31ec1ca

File tree

44 files changed

+16590
-51234
lines changed

Some content is hidden

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

44 files changed

+16590
-51234
lines changed

.storybook/main.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@ const config: StorybookConfig = {
1111
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true,
1212
},
1313
},
14+
webpackFinal: async (config) => {
15+
config.module = config.module || {};
16+
config.module.rules = config.module.rules || [];
17+
18+
// Ensure TypeScript files are handled correctly
19+
config.module.rules.push({
20+
test: /\.tsx?$/,
21+
use: [
22+
{
23+
loader: require.resolve('ts-loader'),
24+
options: {
25+
transpileOnly: true,
26+
},
27+
},
28+
],
29+
exclude: /node_modules/,
30+
});
31+
32+
return config;
33+
},
1434
stories: ['../src/**/*.@(stories.tsx|mdx)'],
1535
addons: [
1636
{
@@ -19,8 +39,7 @@ const config: StorybookConfig = {
1939
actions: false,
2040
},
2141
},
22-
'@storybook/addon-storysource',
23-
'@storybook/addon-styling',
42+
'@storybook/addon-themes',
2443
'@storybook/addon-a11y',
2544
],
2645
framework: {

.storybook/manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { create } from '@storybook/theming';
2-
import { addons } from '@storybook/addons';
2+
import { addons } from '@storybook/manager-api';
33

44
addons.setConfig({
55
theme:create({
66
base: 'light',
77
brandTitle: 'Amazon Chime SDK Components'
88
})
9-
});
9+
});

.storybook/preview.ts

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
11
import { ThemeProvider } from 'styled-components';
2-
import { withThemeFromJSXProvider } from '@storybook/addon-styling';
2+
import { withThemeFromJSXProvider } from '@storybook/addon-themes';
3+
import type { Preview } from '@storybook/react';
34

45
import { GlobalStyles } from '../src/theme/GlobalStyles';
56
import lightTheme from '../src/theme/light';
67
import darkTheme from '../src/theme/dark';
78

8-
export const decorators = [
9-
withThemeFromJSXProvider({
10-
themes: {
11-
light: lightTheme,
12-
dark: darkTheme,
13-
},
14-
defaultTheme: 'light',
15-
Provider: ThemeProvider,
16-
GlobalStyles: GlobalStyles,
17-
}),
18-
];
19-
20-
export const argTypes = {
21-
tag: { table: { disable: true } },
22-
id: { table: { disable: true } },
23-
className: { table: { disable: true } },
24-
css: { table: { disable: true } },
25-
testId: { table: { disable: true } },
26-
viewBox: { table: { disable: true } },
27-
height: { table: { disable: true } },
28-
title: { table: { disable: true } },
29-
children: { table: { disable: true } },
9+
const preview: Preview = {
10+
decorators: [
11+
withThemeFromJSXProvider({
12+
themes: {
13+
light: lightTheme,
14+
dark: darkTheme,
15+
},
16+
defaultTheme: 'light',
17+
Provider: ThemeProvider,
18+
GlobalStyles: GlobalStyles,
19+
}),
20+
],
21+
argTypes: {
22+
tag: { table: { disable: true } },
23+
id: { table: { disable: true } },
24+
className: { table: { disable: true } },
25+
css: { table: { disable: true } },
26+
testId: { table: { disable: true } },
27+
viewBox: { table: { disable: true } },
28+
height: { table: { disable: true } },
29+
title: { table: { disable: true } },
30+
children: { table: { disable: true } },
31+
},
32+
parameters: {
33+
layout: 'centered',
34+
},
3035
};
3136

32-
export const parameters = {
33-
layout: 'centered',
34-
};
37+
export default preview;

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
### Removed
1717

1818
### Changed
19+
- Add support for React 19.
20+
- Migrate storybook to v8.
21+
- Migrate Jest to v29.
22+
- Rewrite PopOver component using floating-ui
1923

2024
### Fixed
2125

jest.config.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@ module.exports = {
44
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'jsx', 'node'],
55
transform: {
66
'\\.tsx?$': 'ts-jest',
7-
'^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx'
8-
},
9-
globals: {
10-
'ts-jest': {
11-
tsconfig: 'tsconfig.json'
12-
}
7+
'^.+\\.m?js$': 'ts-jest',
138
},
9+
preset: 'ts-jest',
1410
testPathIgnorePatterns: ['node_modules', '/tst/snapshots/',],
1511
testEnvironment: 'jsdom',
1612
collectCoverage: true,
@@ -36,4 +32,7 @@ module.exports = {
3632
* https://jestjs.io/docs/configuration#coverageprovider-string
3733
*/
3834
coverageProvider: 'v8',
35+
transformIgnorePatterns: [
36+
'node_modules/(?!uuid)',
37+
],
3938
};

0 commit comments

Comments
 (0)