Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump React@17 #128239

Merged
merged 69 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
38e9ee9
cleanup
patrykkopycinski May 26, 2022
6e274b3
fix
patrykkopycinski May 26, 2022
428a660
fix
patrykkopycinski May 26, 2022
9ae5caf
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski May 29, 2022
b70ecef
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski May 30, 2022
dc57cf8
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski May 30, 2022
a2309e3
fix
patrykkopycinski May 30, 2022
9ccd325
fix tests
patrykkopycinski May 30, 2022
978d1f6
fix tests
patrykkopycinski May 30, 2022
3704633
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski May 30, 2022
33b8b65
fix search bar
patrykkopycinski May 30, 2022
5ae4d7b
test
patrykkopycinski May 30, 2022
bd8110f
types
patrykkopycinski May 30, 2022
0191511
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski May 31, 2022
cc431f7
test
patrykkopycinski May 31, 2022
dbe9655
fix warnings
patrykkopycinski May 31, 2022
7f91c7f
fix types
patrykkopycinski May 31, 2022
a2bcff0
update constate
patrykkopycinski May 31, 2022
70254a6
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine May 31, 2022
fc0d53a
polyfill resizeobserver
patrykkopycinski May 31, 2022
6b48617
test
patrykkopycinski May 31, 2022
a2a6f79
cleanup
patrykkopycinski Jun 1, 2022
80864ea
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski Jul 3, 2022
23a0969
WIP
patrykkopycinski Jul 3, 2022
252075b
[CI] Auto-commit changed files from 'yarn kbn run build -i @kbn/pm'
kibanamachine Jul 3, 2022
7f966e1
WIP
patrykkopycinski Jul 3, 2022
9495f21
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Jul 3, 2022
88d10d6
WIP
patrykkopycinski Jul 3, 2022
8ee76ea
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Jul 3, 2022
111f24e
WIP
patrykkopycinski Jul 3, 2022
f5cc69c
WIP
patrykkopycinski Jul 4, 2022
88b5af9
Merge branch 'chore/react-17' of github.com:patrykkopycinski/kibana i…
patrykkopycinski Jul 4, 2022
54b95a5
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Jul 4, 2022
eb4c45e
WIP
patrykkopycinski Jul 4, 2022
ef362ce
Merge branch 'chore/react-17' of github.com:patrykkopycinski/kibana i…
patrykkopycinski Jul 4, 2022
a116de7
fix snapshot
patrykkopycinski Jul 4, 2022
11bd861
Merge branch 'main' into chore/react-17
kibanamachine Jul 5, 2022
733da25
Comment out code around triggering the command input history
paul-tavares Jul 13, 2022
db116f1
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski Jul 13, 2022
87f5e1d
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski Jul 13, 2022
f08e62d
Merge branch 'task/olm-turn-off-up-arrow-access-to-comand-input-histo…
patrykkopycinski Jul 13, 2022
3e613d8
Update jest_setup.js
patrykkopycinski Jul 14, 2022
d9f9c70
fix jest
patrykkopycinski Jul 14, 2022
347eca0
bump
patrykkopycinski Jul 14, 2022
7b61a37
[CI] Auto-commit changed files from 'yarn kbn run build -i @kbn/pm'
kibanamachine Jul 14, 2022
ce9a008
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski Jul 14, 2022
6fbcaaa
Merge branch 'chore/react-17' of github.com:patrykkopycinski/kibana i…
patrykkopycinski Jul 14, 2022
77ed7fc
update
patrykkopycinski Jul 14, 2022
fe67885
update supported licenses
patrykkopycinski Jul 14, 2022
19013d3
types
patrykkopycinski Jul 14, 2022
8e8d53d
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski Jul 14, 2022
d370090
snapshot
patrykkopycinski Jul 15, 2022
b5e5222
Merge branch 'main' into chore/react-17
kibanamachine Jul 15, 2022
e3e60b0
Merge branch 'main' into chore/react-17
kibanamachine Jul 18, 2022
08fabfd
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski Aug 6, 2022
a9d5306
fix merge conflicts
patrykkopycinski Aug 6, 2022
3451fc7
fix
patrykkopycinski Aug 6, 2022
3f09ddc
[CI] Auto-commit changed files from 'node scripts/precommit_hook.js -…
kibanamachine Aug 6, 2022
bd80037
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski Aug 21, 2022
327888d
lock
patrykkopycinski Aug 21, 2022
e311926
Merge branch 'main' of github.com:elastic/kibana into chore/react-17
patrykkopycinski Aug 21, 2022
30ac341
Merge branch 'main' into chore/react-17
kibanamachine Aug 21, 2022
263594d
Merge branch 'main' into chore/react-17
kibanamachine Aug 21, 2022
84f3afd
Merge branch 'main' into chore/react-17
kibanamachine Aug 21, 2022
6aa796d
Merge branch 'main' into chore/react-17
kibanamachine Aug 21, 2022
81c2b02
Merge branch 'main' into chore/react-17
kibanamachine Aug 21, 2022
d97f5e2
Merge branch 'main' into chore/react-17
kibanamachine Aug 22, 2022
2d2f671
Merge branch 'main' into chore/react-17
kibanamachine Aug 22, 2022
16dd7a3
test
patrykkopycinski Aug 22, 2022
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
74 changes: 37 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
"**/refractor/prismjs": "~1.27.0",
"**/trim": "1.0.1",
"**/typescript": "4.6.3",
"**/use-composed-ref": "^1.3.0",
"**/use-latest": "^1.2.1",
"globby/fast-glob": "3.2.7",
"puppeteer/node-fetch": "^2.6.7"
},
Expand Down Expand Up @@ -378,7 +380,7 @@
"color": "^4.2.3",
"commander": "^4.1.1",
"compare-versions": "3.5.1",
"constate": "^1.3.2",
"constate": "^3.3.2",
"content-disposition": "^0.5.4",
"copy-to-clipboard": "^3.0.8",
"core-js": "^3.23.5",
Expand Down Expand Up @@ -486,47 +488,47 @@
"pluralize": "3.1.0",
"polished": "^3.7.2",
"pretty-ms": "6.0.0",
"prop-types": "^15.7.2",
"prop-types": "^15.8.1",
"proxy-from-env": "1.0.0",
"puid": "1.0.7",
"puppeteer": "^10.2.0",
"query-string": "^6.13.2",
"rbush": "^3.0.1",
"re-resizable": "^6.1.1",
"re2": "1.17.4",
"react": "^16.14.0",
"react": "^17.0.2",
"react-ace": "^7.0.5",
"react-beautiful-dnd": "^13.1.0",
"react-color": "^2.13.8",
"react-dom": "^16.14.0",
"react-dom": "^17.0.2",
"react-dropzone": "^4.2.9",
"react-fast-compare": "^2.0.4",
"react-grid-layout": "^0.16.2",
"react-focus-on": "^3.6.0",
"react-grid-layout": "^1.3.4",
"react-hook-form": "^7.30.0",
"react-intl": "^2.8.0",
"react-is": "^16.13.1",
"react-markdown": "^4.3.1",
"react-is": "^17.0.2",
"react-markdown": "^6.0.3",
"react-moment-proptypes": "^1.7.0",
"react-monaco-editor": "^0.41.2",
"react-popper-tooltip": "^2.10.1",
"react-popper-tooltip": "^3.1.1",
"react-query": "^3.39.1",
"react-redux": "^7.2.0",
"react-resizable": "^1.7.5",
"react-resize-detector": "^4.2.0",
"react-reverse-portal": "^1.0.4",
"react-redux": "^7.2.8",
"react-resizable": "^3.0.4",
"react-resize-detector": "^7.1.1",
"react-reverse-portal": "^2.1.0",
"react-router": "^5.2.0",
"react-router-config": "^5.1.1",
"react-router-dom": "^5.2.0",
"react-router-redux": "^4.0.8",
"react-shortcuts": "^2.0.0",
"react-sizeme": "^2.6.6",
"react-shortcuts": "^2.1.0",
"react-sizeme": "^3.0.2",
"react-syntax-highlighter": "^15.3.1",
"react-tiny-virtual-list": "^2.2.0",
"react-use": "^15.3.8",
"react-virtualized": "^9.21.2",
"react-virtualized": "^9.22.3",
"react-vis": "^1.8.1",
"react-visibility-sensor": "^5.1.1",
"recompose": "^0.26.0",
"recompose": "^0.30.0",
"reduce-reducers": "^1.0.4",
"redux": "^4.1.0",
"redux-actions": "^2.6.5",
Expand Down Expand Up @@ -584,7 +586,7 @@
"@babel/cli": "^7.18.9",
"@babel/core": "^7.18.9",
"@babel/eslint-parser": "^7.18.9",
"@babel/eslint-plugin": "^7.17.7",
"@babel/eslint-plugin": "^7.18.9",
"@babel/generator": "^7.18.9",
"@babel/helper-plugin-utils": "^7.18.9",
"@babel/parser": "^7.18.9",
Expand Down Expand Up @@ -681,11 +683,13 @@
"@storybook/addon-storyshots": "^6.4.22",
"@storybook/addons": "^6.4.22",
"@storybook/api": "^6.4.22",
"@storybook/client-api": "^6.4.22",
"@storybook/components": "^6.4.22",
"@storybook/core": "^6.4.22",
"@storybook/core-common": "^6.4.22",
"@storybook/core-events": "^6.4.22",
"@storybook/node-logger": "^6.4.22",
"@storybook/preview-web": "^6.4.22",
"@storybook/react": "^6.4.22",
"@storybook/testing-react": "^1.2.4",
"@storybook/theming": "^6.4.22",
Expand Down Expand Up @@ -722,7 +726,7 @@
"@types/delete-empty": "^2.0.0",
"@types/ejs": "^3.0.6",
"@types/elastic__apm-synthtrace": "link:bazel-bin/packages/elastic-apm-synthtrace/npm_module_types",
"@types/enzyme": "^3.10.8",
"@types/enzyme": "^3.10.12",
"@types/eslint": "^7.28.0",
"@types/express": "^4.17.13",
"@types/extract-zip": "^1.6.2",
Expand All @@ -749,7 +753,6 @@
"@types/intl-relativeformat": "^2.1.0",
"@types/jest": "^26.0.22",
"@types/jest-axe": "^3.5.3",
"@types/jest-specific-snapshot": "^0.5.5",
"@types/joi": "^17.2.3",
"@types/jquery": "^3.3.31",
"@types/js-levenshtein": "^1.1.0",
Expand Down Expand Up @@ -1044,23 +1047,22 @@
"@types/pngjs": "^3.4.0",
"@types/prettier": "^2.3.2",
"@types/pretty-ms": "^5.0.0",
"@types/prop-types": "^15.7.3",
"@types/prop-types": "^15.7.5",
"@types/rbush": "^3.0.0",
"@types/react": "^16.14.25",
"@types/react": "^17.0.45",
"@types/react-beautiful-dnd": "^13.0.0",
"@types/react-dom": "^16.9.15",
"@types/react-grid-layout": "^0.16.7",
"@types/react-dom": "^17.0.17",
"@types/react-grid-layout": "^1.3.2",
"@types/react-intl": "^2.3.15",
"@types/react-is": "^16.7.2",
"@types/react-redux": "^7.1.9",
"@types/react-resize-detector": "^4.0.1",
"@types/react-is": "^17.0.3",
"@types/react-resize-detector": "^6.1.0",
"@types/react-router": "^5.1.7",
"@types/react-router-config": "^5.0.2",
"@types/react-router-dom": "^5.1.5",
"@types/react-test-renderer": "^16.9.1",
"@types/react-virtualized": "^9.18.7",
"@types/react-test-renderer": "^17.0.2",
"@types/react-virtualized": "^9.21.21",
"@types/react-vis": "^1.11.9",
"@types/recompose": "^0.30.6",
"@types/recompose": "^0.30.10",
"@types/reduce-reducers": "^1.0.0",
"@types/redux-actions": "^2.6.1",
"@types/redux-logger": "^3.0.8",
Expand Down Expand Up @@ -1100,6 +1102,7 @@
"@typescript-eslint/eslint-plugin": "^5.20.0",
"@typescript-eslint/parser": "^5.20.0",
"@typescript-eslint/typescript-estree": "^5.20.0",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
"@yarnpkg/lockfile": "^1.1.0",
"abab": "^2.0.4",
"aggregate-error": "^3.1.0",
Expand Down Expand Up @@ -1145,8 +1148,6 @@
"dpdm": "3.5.0",
"ejs": "^3.1.8",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.6",
"enzyme-adapter-utils": "^1.14.0",
"enzyme-to-json": "^3.6.1",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.5.0",
Expand Down Expand Up @@ -1197,15 +1198,14 @@
"jest-config": "^26",
"jest-diff": "^26.6.2",
"jest-environment-jsdom": "^26.6.2",
"jest-environment-jsdom-thirteen": "^1.0.1",
"jest-raw-loader": "^1.0.1",
"jest-runtime": "^26",
"jest-silent-reporter": "^0.5.0",
"jest-snapshot": "^26.6.2",
"jest-specific-snapshot": "2.0.0",
"jest-specific-snapshot": "^4.0.0",
"jest-styled-components": "^7.0.3",
"jimp": "^0.14.0",
"jsdom": "13.1.0",
"jsdom": "^16.4.0",
"json-schema-typed": "^8.0.1",
"json5": "^1.0.1",
"jsondiffpatch": "0.4.1",
Expand Down Expand Up @@ -1243,10 +1243,10 @@
"pretty-format": "^27.5.1",
"q": "^1.5.1",
"raw-loader": "^3.1.0",
"react-test-renderer": "^16.14.0",
"react-test-renderer": "^17.0.2",
"regenerate": "^1.4.0",
"resolve": "^1.22.0",
"rxjs-marbles": "^5.0.6",
"rxjs-marbles": "^7.0.1",
"sass-loader": "^10.3.1",
"selenium-webdriver": "^4.3.1",
"simple-git": "^3.10.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import React, { Fragment } from 'react';
import React from 'react';
import ReactDOM from 'react-dom';
import { filter } from 'rxjs/operators';
import { Subscription } from 'rxjs';
Expand Down Expand Up @@ -72,7 +72,7 @@ export class UserBannerService {
</div>
}
>
<ReactMarkdownLazy renderers={{ root: Fragment }} source={content.trim()} />
<ReactMarkdownLazy>{content.trim()}</ReactMarkdownLazy>
</React.Suspense>

<EuiButton type="primary" size="s" onClick={() => banners.remove(id!)}>
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-test/src/jest/setup/enzyme.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
*/

import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import Adapter from '@wojtekmaj/enzyme-adapter-react-17';

configure({ adapter: new Adapter() });
1 change: 1 addition & 0 deletions src/dev/license_checker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const LICENSE_ALLOWED = [
'WTFPL',
'Nuclide software',
'Python-2.0',
'(Apache-2.0 AND MIT)',
];

// The following list only applies to licenses that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ export const TitleField = ({
isInvalid={isInvalid}
value={field.value}
onChange={(e: ChangeEvent<HTMLInputElement>) => {
e.persist();
let query = e.target.value;
if (query.length === 1 && !appendedWildcard && canAppendWildcard(query)) {
query += '*';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { searchSourceInstanceMock } from '@kbn/data-plugin/common/search/search_
import { findTestSubject } from '@elastic/eui/lib/test';
jest.mock('./discover_main_app', () => {
return {
DiscoverMainApp: jest.fn(),
DiscoverMainApp: jest.fn().mockReturnValue(<></>),
};
});

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,15 @@ const logs = `
[Sun Mar 7 21:16:17 2004] [error] [client xx.xx.xx.xx] File does not exist: /home/httpd/twiki/view/Main/WebHome
`;

class ResizeObserver {
observe() {}
unobserve() {}
disconnect() {}
}

describe('<CodeEditor />', () => {
window.ResizeObserver = ResizeObserver;

test('is rendered', () => {
const component = mountWithIntl(
<CodeEditor languageId="loglang" height={250} value={logs} onChange={() => {}} />
Expand Down
15 changes: 8 additions & 7 deletions src/plugins/kibana_react/public/code_editor/code_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import React, { useState, useRef, useCallback, useMemo, useEffect, KeyboardEvent } from 'react';
import ReactResizeDetector from 'react-resize-detector';
import { useResizeDetector } from 'react-resize-detector';
import ReactMonacoEditor from 'react-monaco-editor';
import {
htmlIdGenerator,
Expand Down Expand Up @@ -186,6 +186,13 @@ export const CodeEditor: React.FC<Props> = ({
_editor.current?.layout();
}, []);

useResizeDetector({
handleWidth: true,
handleHeight: true,
onResize: _updateDimensions,
refreshMode: 'debounce',
});

const startEditing = useCallback(() => {
setIsHintActive(false);
_editor.current?.focus();
Expand Down Expand Up @@ -469,12 +476,6 @@ export const CodeEditor: React.FC<Props> = ({
}}
/>
</FullScreenDisplay>
<ReactResizeDetector
handleWidth
handleHeight
onResize={_updateDimensions}
refreshMode="debounce"
/>
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,16 @@
* Side Public License, v 1.
*/

import React, { Fragment } from 'react';
import React from 'react';
import ReactMarkdown from 'react-markdown';

const markdownRenderers = {
root: Fragment,
};

export interface MarkdownSimpleProps {
children: string;
}

// Render markdown string into JSX inside of a Fragment.
export const MarkdownSimple = ({ children }: MarkdownSimpleProps) => (
<ReactMarkdown renderers={markdownRenderers}>{children}</ReactMarkdown>
<ReactMarkdown>{children}</ReactMarkdown>
);

// Needed for React.lazy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import React, { Fragment } from 'react';
import React from 'react';
import { History } from 'history';
import { i18n } from '@kbn/i18n';
import { EuiLoadingSpinner } from '@elastic/eui';
Expand All @@ -20,7 +20,7 @@ import { KibanaThemeProvider } from '../theme';
const ReactMarkdown = React.lazy(() => import('react-markdown'));
const ErrorRenderer = (props: { children: string }) => (
<React.Suspense fallback={<EuiLoadingSpinner />}>
<ReactMarkdown renderers={{ root: Fragment }} {...props} />
<ReactMarkdown {...props} />
</React.Suspense>
);

Expand Down
8 changes: 7 additions & 1 deletion x-pack/plugins/apm/public/application/application.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ describe('renderApp (APM)', () => {
};
};

it('renders the app', () => {
it('renders the app', async () => {
const promise = Promise.resolve();
const mountProps = getApmMountProps();

let unmount: () => void;
Expand All @@ -131,6 +132,11 @@ describe('renderApp (APM)', () => {
unmount = renderApmApp(mountProps);
});

// fake promise to wait for to ensure the app is mounted
await act(async () => {
await promise;
});

expect(() => {
unmount();
}).not.toThrowError();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export const WorkpadApp: FC<Props> = ({ deselectElement, isWriteable, workpad })
<div
id={CANVAS_LAYOUT_STAGE_CONTENT_SELECTOR}
className={CANVAS_LAYOUT_STAGE_CONTENT_SELECTOR}
onMouseDown={deselectElement}
>
{/* NOTE: canvasWorkpadContainer is used for exporting */}
<div
Expand Down
Loading