Skip to content

Commit

Permalink
chore: update react&react-dom to 18.3 (#20316)
Browse files Browse the repository at this point in the history
* chore: update react&react-dom to 18.3

* chore: TS fix

* chore: update testing packages

* chore: fix lint
  • Loading branch information
joshuaellis committed May 17, 2024
1 parent 20865b6 commit a3960e1
Show file tree
Hide file tree
Showing 31 changed files with 255 additions and 216 deletions.
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"@mdx-js/react": "^3.0.0",
"clsx": "^1.1.1",
"prism-react-renderer": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react": "18.3.0",
"react-dom": "18.3.0"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "3.1.1",
Expand Down
4 changes: 2 additions & 2 deletions examples/getstarted/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"mysql2": "3.6.2",
"passport-google-oauth2": "0.2.0",
"pg": "8.11.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-intl": "6.6.2",
"react-router-dom": "6.22.3",
"strapi-plugin-workspace-plugin": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions examples/kitchensink-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"@strapi/plugin-users-permissions": "5.0.0-beta.7",
"@strapi/strapi": "5.0.0-beta.7",
"better-sqlite3": "9.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
},
Expand Down
4 changes: 2 additions & 2 deletions examples/kitchensink/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"mysql2": "3.6.2",
"passport-google-oauth2": "0.2.0",
"pg": "8.11.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
},
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@
"@types/fs-extra": "11.0.4",
"@types/git-url-parse": "9.0.3",
"@types/prompts": "2.4.9",
"@types/react": "18.2.66",
"@types/react-dom": "18.2.22",
"@types/styled-components": "5.1.34",
"@types/react": "18.3.2",
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "6.7.3",
"@typescript-eslint/parser": "6.7.3",
"babel-eslint": "10.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"devDependencies": {
"@reduxjs/toolkit": "1.9.7",
"@strapi/pack-up": "5.0.0",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/jest-dom": "6.4.5",
"eslint-config-custom": "5.0.0-beta.7",
"jest-environment-jsdom": "29.6.1",
"tsconfig": "5.0.0-beta.7"
Expand Down
2 changes: 2 additions & 0 deletions packages/admin-test-utils/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ window.console = {
/Unknown event handler property/.test(message)
) {
// do nothing
} else if (/Support for defaultProps will be removed/gi.test(message)) {
// do nothing
} else {
throw new Error(message);
}
Expand Down
6 changes: 5 additions & 1 deletion packages/core/admin/admin/src/components/PageHelpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ const Protect = ({ permissions = [], children }: ProtectProps) => {
return <NoPermissions />;
}

return typeof children === 'function' ? children({ permissions: matchingPermissions }) : children;
return (
<>
{typeof children === 'function' ? children({ permissions: matchingPermissions }) : children}
</>
);
};

/* -------------------------------------------------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions packages/core/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@
"@strapi/types": "5.0.0-beta.7",
"@strapi/typescript-utils": "5.0.0-beta.7",
"@strapi/utils": "5.0.0-beta.7",
"@testing-library/dom": "9.2.0",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@testing-library/dom": "10.1.0",
"@testing-library/react": "15.0.7",
"@testing-library/user-event": "14.5.2",
"axios": "1.6.8",
"bcryptjs": "2.4.3",
"boxen": "5.1.2",
Expand Down Expand Up @@ -156,8 +156,8 @@
"@types/sanitize-html": "2.11.0",
"@vitejs/plugin-react-swc": "3.6.0",
"koa-body": "6.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8",
"vite": "5.1.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { baseHandleConvert } from '../utils/conversions';
import { pressEnterTwiceToExit } from '../utils/enterKey';
import { type Block } from '../utils/types';

const CodeBlock = styled.pre.attrs({ role: 'code' })`
const CodeBlock = styled.pre`
border-radius: ${({ theme }) => theme.borderRadius};
background-color: ${({ theme }) => theme.colors.neutral100};
max-width: 100%;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable testing-library/no-node-access */
import { render, screen, within } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import { createEditor, Transforms, Editor } from 'slate';

import { codeBlocks } from '../Code';
Expand All @@ -25,11 +25,8 @@ describe('Code', () => {
}
);

const pre = screen.getByRole('code');
expect(pre).toBeInTheDocument();

const code = within(pre).getByText('Some code');
expect(code).toBeInTheDocument();
expect(screen.getByRole('code')).toBeInTheDocument();
expect(screen.getByText('Some code')).toBeInTheDocument();
});

it('handles enter key on a code block', () => {
Expand Down
6 changes: 3 additions & 3 deletions packages/core/content-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@
"@strapi/admin": "5.0.0-beta.7",
"@strapi/database": "workspace:*",
"@strapi/pack-up": "5.0.0",
"@testing-library/react": "14.0.0",
"@testing-library/react": "15.0.7",
"@types/jest": "29.5.2",
"@types/lodash": "^4.14.191",
"koa-body": "6.0.1",
"msw": "1.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
},
Expand Down
9 changes: 4 additions & 5 deletions packages/core/content-releases/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,13 @@
"@strapi/admin-test-utils": "5.0.0-beta.7",
"@strapi/content-manager": "5.0.0-beta.7",
"@strapi/pack-up": "5.0.0",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@testing-library/react": "15.0.7",
"@testing-library/user-event": "14.5.2",
"@types/koa": "2.13.4",
"@types/styled-components": "5.1.34",
"koa": "2.15.2",
"msw": "1.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-query": "3.39.3",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8",
Expand Down
8 changes: 4 additions & 4 deletions packages/core/content-type-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@
"@strapi/admin": "5.0.0-beta.7",
"@strapi/pack-up": "5.0.0",
"@strapi/types": "5.0.0-beta.7",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@testing-library/react": "15.0.7",
"@testing-library/user-event": "14.5.2",
"@types/fs-extra": "11.0.4",
"@types/pluralize": "0.0.30",
"koa": "2.15.2",
"koa-body": "6.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-query": "3.39.3",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
Expand Down
10 changes: 10 additions & 0 deletions packages/core/database/src/metadata/__tests__/identifiers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ type TestOptions = {
auxiliarModels?: any[];
};

declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace jest {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Matchers<R> {
toEqualMap(expected: unknown): CustomMatcherResult;
}
}
}

expect.extend({
toEqualMap(received, expected) {
// Iterate through expected map
Expand Down
6 changes: 3 additions & 3 deletions packages/core/email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
"@strapi/admin": "5.0.0-beta.7",
"@strapi/pack-up": "5.0.0",
"@strapi/types": "5.0.0-beta.7",
"@testing-library/react": "14.0.0",
"@testing-library/react": "15.0.7",
"@types/koa": "2.13.4",
"@types/lodash": "^4.14.191",
"koa": "2.15.2",
"koa-body": "6.0.1",
"msw": "1.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/core/review-workflows/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@
"@strapi/pack-up": "5.0.0",
"@strapi/types": "5.0.0-beta.7",
"@strapi/utils": "5.0.0-beta.7",
"@testing-library/react": "14.0.0",
"@testing-library/react": "15.0.7",
"msw": "1.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/core/strapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@
"@types/webpack-bundle-analyzer": "4.7.0",
"@types/webpack-hot-middleware": "2.25.9",
"eslint-config-custom": "5.0.0-beta.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"tsconfig": "5.0.0-beta.7"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ const PLUGIN_TEMPLATE = defineTemplate(async ({ logger, gitConfig, packagePath }
...pkgJson.devDependencies,
'@types/react': '*',
'@types/react-dom': '*',
'@types/styled-components': '5.1.32',
};

const { adminTsconfigFiles } = await import('./files/typescript');
Expand Down
10 changes: 5 additions & 5 deletions packages/core/upload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
"@strapi/admin": "5.0.0-beta.7",
"@strapi/pack-up": "5.0.0",
"@strapi/types": "5.0.0-beta.7",
"@testing-library/dom": "9.2.0",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@testing-library/dom": "10.1.0",
"@testing-library/react": "15.0.7",
"@testing-library/user-event": "14.5.2",
"@types/fs-extra": "11.0.4",
"@types/koa": "2.13.4",
"@types/koa-range": "0.3.5",
Expand All @@ -87,8 +87,8 @@
"koa": "2.15.2",
"koa-body": "6.0.1",
"msw": "1.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
},
Expand Down
7 changes: 2 additions & 5 deletions packages/plugins/cloud/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@
},
"devDependencies": {
"@strapi/strapi": "5.0.0-beta.7",
"@types/react": "18.2.66",
"@types/react-dom": "18.2.22",
"@types/styled-components": "5.1.34",
"eslint-config-custom": "5.0.0-beta.7",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8",
"tsconfig": "5.0.0-beta.7",
Expand Down
9 changes: 4 additions & 5 deletions packages/plugins/color-picker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@
},
"devDependencies": {
"@strapi/strapi": "5.0.0-beta.7",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@types/styled-components": "5.1.34",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@testing-library/react": "15.0.7",
"@testing-library/user-event": "14.5.2",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8",
"typescript": "5.3.2"
Expand Down
8 changes: 4 additions & 4 deletions packages/plugins/documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
"@strapi/pack-up": "5.0.0",
"@strapi/strapi": "5.0.0-beta.7",
"@strapi/types": "5.0.0-beta.7",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@testing-library/react": "15.0.7",
"@testing-library/user-event": "14.5.2",
"@types/fs-extra": "11.0.4",
"@types/koa": "2.13.4",
"@types/koa-session": "6.4.1",
Expand All @@ -89,8 +89,8 @@
"koa-session": "6.4.0",
"msw": "1.3.0",
"openapi-types": "12.1.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
"cross-env": "^7.0.3",
"eslint-config-custom": "5.0.0-beta.7",
"koa": "2.15.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8",
"tsconfig": "5.0.0-beta.7",
Expand Down
8 changes: 4 additions & 4 deletions packages/plugins/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
"@strapi/content-manager": "5.0.0-beta.7",
"@strapi/pack-up": "5.0.0",
"@strapi/types": "5.0.0-beta.7",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@testing-library/react": "15.0.7",
"@testing-library/user-event": "14.5.2",
"msw": "1.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-query": "3.39.3",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/sentry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
"devDependencies": {
"@strapi/pack-up": "5.0.0",
"@strapi/strapi": "5.0.0-beta.7",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/plugins/users-permissions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@
"devDependencies": {
"@strapi/pack-up": "5.0.0",
"@strapi/strapi": "5.0.0-beta.7",
"@testing-library/dom": "9.2.0",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@testing-library/dom": "10.1.0",
"@testing-library/react": "15.0.7",
"@testing-library/user-event": "14.5.2",
"msw": "1.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.22.3",
"styled-components": "6.1.8"
},
Expand Down
Loading

0 comments on commit a3960e1

Please sign in to comment.