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

Chore: Upgrade to react 18 #64428

Merged
merged 69 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
0a6064b
update react 18 related deps
ashharrison90 Mar 8, 2023
bd325e0
Merge branch 'main' into ash/react-18
ashharrison90 Mar 8, 2023
ae4f4d7
fix some types
ashharrison90 Mar 13, 2023
a679c74
Merge branch 'main' into ash/react-18
ashharrison90 Mar 13, 2023
7a8e1a9
Merge branch 'main' into ash/react-18
ashharrison90 Mar 14, 2023
7652c93
Merge branch 'main' into ash/react-18
ashharrison90 Mar 15, 2023
0549d8b
make sure we're on react-router-dom >= 5.3.3
ashharrison90 Mar 15, 2023
8b8232e
Use new root API
kaydelaney Sep 19, 2022
570d594
Remove StrictMode for now - react 18 double rendering causes issues
ashharrison90 Mar 15, 2023
cc01302
Merge branch 'main' into ash/react-18
ashharrison90 Mar 15, 2023
747b50e
Merge branch 'main' into ash/react-18
ashharrison90 Mar 16, 2023
cb0ca7e
fix + ignore some @grafana/ui types
ashharrison90 Mar 16, 2023
423483a
fix some more types
ashharrison90 Mar 16, 2023
13f45f5
use renderHook from @testing-library/react in almost all cases
ashharrison90 Mar 16, 2023
846b883
fix storybook types
ashharrison90 Mar 16, 2023
7b97fab
rewrite useDashboardSave to not use useEffect
ashharrison90 Mar 17, 2023
53f29f0
make props optional
ashharrison90 Mar 21, 2023
2b9d8dd
only render if props are provided
ashharrison90 Mar 21, 2023
e3c14d1
Merge branch 'main' into ash/react-18
ashharrison90 Mar 21, 2023
ceb9d7d
add correct type for useCallback
ashharrison90 Mar 21, 2023
d6bac45
make resourcepicker tests more robust
ashharrison90 Mar 21, 2023
baff119
fix ModalManager rendering
ashharrison90 Mar 21, 2023
9ab3067
fix some more unit tests
ashharrison90 Mar 21, 2023
71ef071
store the click coordinates in a ref as setState is NOT synchronous
ashharrison90 Mar 22, 2023
1b9f4c1
fix remaining e2e tests
ashharrison90 Mar 22, 2023
7c39cda
rewrite dashboardpage tests to avoid act warnings
ashharrison90 Mar 22, 2023
0c39815
undo lint ignores
ashharrison90 Mar 22, 2023
9606b06
fix ExpanderCell types
ashharrison90 Mar 22, 2023
31b59c4
set SymbolCell type correctly
ashharrison90 Mar 22, 2023
7afe79b
Merge branch 'main' into ash/react-18
ashharrison90 Mar 22, 2023
0c45018
fix QueryAndExpressionsStep
ashharrison90 Mar 22, 2023
46f99d1
looks like the types were actually wrong instead :D
ashharrison90 Mar 22, 2023
2438f13
undo this for now...
ashharrison90 Mar 22, 2023
3f16481
remove spinner waits
ashharrison90 Mar 22, 2023
307f3c9
more robust tests
ashharrison90 Mar 22, 2023
ffa4ecb
rewrite errorboundary test to not explicitly count the number of renders
ashharrison90 Mar 23, 2023
b2d103b
make urlParam expect async
ashharrison90 Mar 23, 2023
34cdf50
increase timeout in waitFor
ashharrison90 Mar 23, 2023
cabc9b6
revert ExplorePage test changes
ashharrison90 Mar 23, 2023
3324cea
Update public/app/features/dashboard/containers/DashboardPage.test.tsx
ashharrison90 Mar 27, 2023
09633dc
Update public/app/features/dashboard/containers/PublicDashboardPage.t…
ashharrison90 Mar 27, 2023
36f2511
Update public/app/features/dashboard/containers/PublicDashboardPage.t…
ashharrison90 Mar 27, 2023
ac09842
Update public/app/features/dashboard/containers/PublicDashboardPage.t…
ashharrison90 Mar 27, 2023
f2580ef
skip fakeTimer test, ignore table types for now + other review comments
ashharrison90 Mar 27, 2023
8d4f518
Merge branch 'ash/react-18' of https://github.com/grafana/grafana int…
ashharrison90 Mar 27, 2023
cee4037
update package peerDeps
ashharrison90 Mar 27, 2023
bba9118
small tweak to resourcepicker test
ashharrison90 Mar 27, 2023
2aa2ddd
Merge branch 'main' into ash/react-18
ashharrison90 Mar 27, 2023
711598a
update lockfile...
ashharrison90 Mar 27, 2023
9c5fc2d
increase timeout in sharepublicdashboard tests
ashharrison90 Mar 27, 2023
90dd670
Merge branch 'main' into ash/react-18
ashharrison90 Mar 28, 2023
c94bc79
ensure ExplorePaneContainer passes correct queries to initializeExplore
ashharrison90 Mar 28, 2023
b03b23a
fix LokiContextUI test
ashharrison90 Mar 28, 2023
b08bb9c
Merge branch 'main' into ash/react-18
ashharrison90 Mar 30, 2023
1b71bfb
fix unit tests
ashharrison90 Mar 30, 2023
56a874d
make importDashboard flow more consistent
ashharrison90 Mar 30, 2023
346151d
wait for dashboard name before continuing
ashharrison90 Mar 30, 2023
8a8b919
more test fixes
ashharrison90 Mar 30, 2023
2fcb339
Merge branch 'main' into ash/react-18
ashharrison90 Mar 31, 2023
cfc57b0
readd dashboard name to variable e2e tests
ashharrison90 Mar 31, 2023
b20f267
wait for switches to be enabled before clicking
ashharrison90 Apr 3, 2023
d1483a4
Merge branch 'main' into ash/react-18
ashharrison90 Apr 3, 2023
8f3a402
Merge branch 'main' into ash/react-18
ashharrison90 Apr 4, 2023
f633691
fix modal rendering
ashharrison90 Apr 4, 2023
a565d87
don't use @testing-library/dom directly
ashharrison90 Apr 4, 2023
3fe7f61
quick fix for rendering of panels in firefox
ashharrison90 Apr 6, 2023
7655c7e
Merge branch 'main' into ash/react-18
ashharrison90 Apr 11, 2023
3fe8563
make PromQueryField test more robust
ashharrison90 Apr 11, 2023
6d1433d
don't wait for chartData - in react 18 this can happen before the wai…
ashharrison90 Apr 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
"@sentry/browser",
"@sentry/types",
"@sentry/utils",

// dep updates blocked by React 18
"@testing-library/dom",
"@testing-library/react",
"@types/react",
"@types/react-dom",
"@types/react-test-renderer",
"react",
"react-dom",
"react-test-renderer"
],
"includePaths": ["package.json", "packages/**"],
"ignorePaths": ["packages/grafana-toolkit/package.json", "emails/**", "plugins-bundled/**", "**/mocks/**"],
Expand Down
14 changes: 14 additions & 0 deletions .yarn/patches/@storybook-addon-docs-npm-6.5.16-56ecbd77e7.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/dist/ts3.9/blocks/DocsContainer.d.ts b/dist/ts3.9/blocks/DocsContainer.d.ts
index be330e44bebb02eaf2c92d365d4e7dc1da452465..6c8b1d42bea2e184456e2757eb2ee20076ba43b3 100644
--- a/dist/ts3.9/blocks/DocsContainer.d.ts
+++ b/dist/ts3.9/blocks/DocsContainer.d.ts
@@ -1,7 +1,8 @@
-import { FunctionComponent } from 'react';
+import { FunctionComponent, ReactNode } from 'react';
import { AnyFramework } from '@storybook/csf';
import { DocsContextProps } from './DocsContext';
export interface DocsContainerProps<TFramework extends AnyFramework = AnyFramework> {
context: DocsContextProps<TFramework>;
+ children?: ReactNode;
}
export declare const DocsContainer: FunctionComponent<DocsContainerProps>;
12 changes: 12 additions & 0 deletions .yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/index.d.ts b/index.d.ts
index d116f54d6da12d24b48e24ff3636c9066059aa58..93290945d8b1818cab893d6466179b33869a47b9 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -25,6 +25,7 @@ export type SplitPaneProps = {
pane2Style?: React.CSSProperties;
resizerClassName?: string;
step?: number;
+ children?: React.ReactNode;
};

export type SplitPaneState = {
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { e2e } from '@grafana/e2e';
const PAGE_UNDER_TEST = 'k3PEoCpnk/repeating-a-row-with-a-non-repeating-panel-and-horizontal-repeating-panel';
const DASHBOARD_NAME = 'Repeating a row with a non-repeating panel and horizontal repeating panel';

describe('Repeating a row with repeated panels and a non-repeating panel', () => {
beforeEach(() => {
Expand All @@ -8,6 +9,7 @@ describe('Repeating a row with repeated panels and a non-repeating panel', () =>

it('should be able to collapse and expand a repeated row without losing panels', () => {
e2e.flows.openDashboard({ uid: PAGE_UNDER_TEST });
e2e().contains(DASHBOARD_NAME).should('be.visible');

const panelsToCheck = [
'Row 2 non-repeating panel',
Expand Down
4 changes: 3 additions & 1 deletion e2e/dashboards-suite/new-constant-variable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { e2e } from '@grafana/e2e';
import { GrafanaBootConfig } from '@grafana/runtime';

const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output';
const DASHBOARD_NAME = 'Test variable output';

describe('Variables - Constant', () => {
it('can add a new constant variable', () => {
e2e.flows.login('admin', 'admin');
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e().contains(DASHBOARD_NAME).should('be.visible');

// Create a new "Constant" variable
e2e.components.CallToActionCard.buttonV2('Add variable').click();
Expand All @@ -15,8 +17,8 @@ describe('Variables - Constant', () => {
e2e().get('input').type('Constant{enter}');
});
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalNameInputV2().clear().type('VariableUnderTest').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2().type('Variable under test').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.ConstantVariable.constantOptionsQueryInputV2().type('pesto').blur();
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalLabelInputV2().type('Variable under test').blur();

e2e.pages.Dashboard.Settings.Variables.Edit.General.previewOfValuesOption().eq(0).should('have.text', 'pesto');

Expand Down
3 changes: 3 additions & 0 deletions e2e/dashboards-suite/new-custom-variable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { e2e } from '@grafana/e2e';
import { GrafanaBootConfig } from '@grafana/runtime';

const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output';
const DASHBOARD_NAME = 'Test variable output';

function fillInCustomVariable(name: string, label: string, value: string) {
e2e.pages.Dashboard.Settings.Variables.Edit.General.generalTypeSelectV2().within(() => {
Expand All @@ -23,6 +24,7 @@ describe('Variables - Custom', () => {
it('can add a custom template variable', () => {
e2e.flows.login('admin', 'admin');
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e().contains(DASHBOARD_NAME).should('be.visible');

// Create a new "Custom" variable
e2e.components.CallToActionCard.buttonV2('Add variable').click();
Expand Down Expand Up @@ -50,6 +52,7 @@ describe('Variables - Custom', () => {
it('can add a custom template variable with labels', () => {
e2e.flows.login('admin', 'admin');
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e().contains(DASHBOARD_NAME).should('be.visible');

// Create a new "Custom" variable
e2e.components.CallToActionCard.buttonV2('Add variable').click();
Expand Down
2 changes: 2 additions & 0 deletions e2e/dashboards-suite/new-datasource-variable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { e2e } from '@grafana/e2e';
import { GrafanaBootConfig } from '@grafana/runtime';

const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output';
const DASHBOARD_NAME = 'Test variable output';

describe('Variables - Datasource', () => {
it('can add a new datasource variable', () => {
e2e.flows.login('admin', 'admin');
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e().contains(DASHBOARD_NAME).should('be.visible');

// Create a new "Datasource" variable
e2e.components.CallToActionCard.buttonV2('Add variable').click();
Expand Down
2 changes: 2 additions & 0 deletions e2e/dashboards-suite/new-interval-variable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { e2e } from '@grafana/e2e';
import { GrafanaBootConfig } from '@grafana/runtime';

const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output';
const DASHBOARD_NAME = 'Test variable output';

function assertPreviewValues(expectedValues: string[]) {
for (const expected of expectedValues) {
Expand All @@ -14,6 +15,7 @@ describe('Variables - Interval', () => {
it('can add a new interval variable', () => {
e2e.flows.login('admin', 'admin');
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e().contains(DASHBOARD_NAME).should('be.visible');

// Create a new "Interval" variable
e2e.components.CallToActionCard.buttonV2('Add variable').click();
Expand Down
4 changes: 4 additions & 0 deletions e2e/dashboards-suite/new-query-variable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { e2e } from '@grafana/e2e';
import { GrafanaBootConfig } from '@grafana/runtime';

const PAGE_UNDER_TEST = '-Y-tnEDWk/templating-nested-template-variables';
const DASHBOARD_NAME = 'Templating - Nested Template Variables';

describe('Variables - Query - Add variable', () => {
it('query variable should be default and default fields should be correct', () => {
e2e.flows.login('admin', 'admin');
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e().contains(DASHBOARD_NAME).should('be.visible');

e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();

Expand Down Expand Up @@ -77,6 +79,7 @@ describe('Variables - Query - Add variable', () => {
it('adding a single value query variable', () => {
e2e.flows.login('admin', 'admin');
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e().contains(DASHBOARD_NAME).should('be.visible');

e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();

Expand Down Expand Up @@ -132,6 +135,7 @@ describe('Variables - Query - Add variable', () => {
it('adding a multi value query variable', () => {
e2e.flows.login('admin', 'admin');
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e().contains(DASHBOARD_NAME).should('be.visible');

e2e.pages.Dashboard.Settings.Variables.List.newButton().should('be.visible').click();

Expand Down
2 changes: 2 additions & 0 deletions e2e/dashboards-suite/new-text-box-variable.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { e2e } from '@grafana/e2e';
import { GrafanaBootConfig } from '@grafana/runtime';

const PAGE_UNDER_TEST = 'kVi2Gex7z/test-variable-output';
const DASHBOARD_NAME = 'Test variable output';

describe('Variables - Text box', () => {
it('can add a new text box variable', () => {
e2e.flows.login('admin', 'admin');
e2e.flows.openDashboard({ uid: `${PAGE_UNDER_TEST}?orgId=1&editview=templating` });
e2e().contains(DASHBOARD_NAME).should('be.visible');

// Create a new "text box" variable
e2e.components.CallToActionCard.buttonV2('Add variable').click();
Expand Down
4 changes: 3 additions & 1 deletion e2e/various-suite/trace-view-scrolling.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ describe('Trace view', () => {
e2e.pages.Explore.General.scrollView().children('.scrollbar-view').scrollTo('center');

// After scrolling we should load more spans
e2e.components.TraceViewer.spanBar().its('length').should('be.gt', oldLength);
e2e.components.TraceViewer.spanBar().should(($span) => {
expect($span.length).to.be.gt(oldLength);
});
});
});
});
24 changes: 13 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,9 @@
"@rtsao/plugin-proposal-class-properties": "7.0.1-patch.1",
"@swc/core": "1.3.38",
"@swc/helpers": "0.4.14",
"@testing-library/dom": "8.20.0",
"@testing-library/dom": "9.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RTL is built on top testing-library/dom, so should include all its functions. I quickly checked our codebase and it seems like we use testing-library/dom mostly for the within function, which is also available from testing-library/react. Should we try to remove this package?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok so i've changed the instances of the code that are using within/fireEvent from @testing-library/dom directly to instead use the methods from @testing-library/react, however i don't think we can remove the package itself as @testing-library/user-event declares a peer dependency on it.

Copy link
Contributor

@Clarity-89 Clarity-89 Apr 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @testing-library/react should pull it in as a dependency? Also found an issue where it says that @testing-library/dom shouldn't be listed as dependency unless used directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does, but that will still leave us with warnings when yarn installing:

➤ YN0002: │ grafana@workspace:. doesn't provide @testing-library/dom (p15dc6), requested by @testing-library/user-event

there's another issue here saying that installing it directly is the correct approach when using @testing-library/user-event.

"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "12.1.4",
"@testing-library/react-hooks": "8.0.1",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@types/angular": "1.8.4",
"@types/angular-route": "1.7.2",
Expand Down Expand Up @@ -146,15 +145,15 @@
"@types/papaparse": "5.3.7",
"@types/pluralize": "^0.0.29",
"@types/prismjs": "1.26.0",
"@types/react": "17.0.42",
"@types/react": "18.0.28",
"@types/react-beautiful-dnd": "13.1.3",
"@types/react-dom": "17.0.14",
"@types/react-dom": "18.0.11",
"@types/react-grid-layout": "1.3.2",
"@types/react-highlight-words": "0.16.4",
"@types/react-redux": "7.1.25",
"@types/react-router-dom": "5.3.3",
"@types/react-table": "7.7.14",
"@types/react-test-renderer": "17.0.1",
"@types/react-test-renderer": "18.0.0",
"@types/react-transition-group": "4.4.5",
"@types/react-virtualized-auto-sizer": "1.0.1",
"@types/react-window": "1.8.5",
Expand Down Expand Up @@ -226,7 +225,7 @@
"react-refresh": "0.14.0",
"react-select-event": "5.5.1",
"react-simple-compat": "1.2.3",
"react-test-renderer": "17.0.2",
"react-test-renderer": "18.2.0",
"redux-mock-store": "1.5.4",
"rimraf": "4.4.0",
"rudder-sdk-js": "2.25.0",
Expand Down Expand Up @@ -294,6 +293,7 @@
"@sentry/browser": "6.19.7",
"@sentry/types": "6.19.7",
"@sentry/utils": "6.19.7",
"@testing-library/react-hooks": "^8.0.1",
"@types/react-resizable": "3.0.3",
"@types/webpack-env": "1.18.0",
"@visx/event": "3.0.1",
Expand Down Expand Up @@ -366,11 +366,11 @@
"rc-time-picker": "3.7.3",
"rc-tree": "5.7.2",
"re-resizable": "6.9.9",
"react": "17.0.2",
"react": "18.2.0",
"react-awesome-query-builder": "5.4.0",
"react-beautiful-dnd": "13.1.1",
"react-diff-viewer": "^3.1.1",
"react-dom": "17.0.2",
"react-dom": "18.2.0",
"react-draggable": "4.4.5",
"react-dropzone": "^14.2.3",
"react-enable": "^3.1.0",
Expand All @@ -385,7 +385,7 @@
"react-redux": "7.2.6",
"react-resizable": "3.0.4",
"react-reverse-portal": "2.1.1",
"react-router-dom": "^5.2.0",
"react-router-dom": "5.3.3",
"react-select": "5.7.0",
"react-split-pane": "0.1.92",
"react-table": "7.8.0",
Expand Down Expand Up @@ -437,7 +437,9 @@
"@storybook/manager-webpack5/webpack": "5.76.0",
"ngtemplate-loader/loader-utils": "^2.0.0",
"trim": "0.0.3",
"slate-dev-environment@^0.2.2": "patch:slate-dev-environment@npm:0.2.5#.yarn/patches/slate-dev-environment-npm-0.2.5-9aeb7da7b5.patch"
"slate-dev-environment@^0.2.2": "patch:slate-dev-environment@npm:0.2.5#.yarn/patches/slate-dev-environment-npm-0.2.5-9aeb7da7b5.patch",
"react-split-pane@0.1.92": "patch:react-split-pane@npm:0.1.92#.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch",
"@storybook/addon-docs@6.5.16": "patch:@storybook/addon-docs@npm:6.5.16#.yarn/patches/@storybook-addon-docs-npm-6.5.16-56ecbd77e7.patch"
},
"workspaces": {
"packages": [
Expand Down
19 changes: 9 additions & 10 deletions packages/grafana-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@
"@rollup/plugin-commonjs": "23.0.2",
"@rollup/plugin-json": "5.0.1",
"@rollup/plugin-node-resolve": "15.0.1",
"@testing-library/dom": "8.20.0",
"@testing-library/dom": "9.0.1",
"@testing-library/jest-dom": "5.16.5",
"@testing-library/react": "12.1.4",
"@testing-library/react-hooks": "8.0.1",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@types/dompurify": "^2",
"@types/history": "4.7.11",
Expand All @@ -76,15 +75,15 @@
"@types/marked": "4.0.8",
"@types/node": "18.14.6",
"@types/papaparse": "5.3.7",
"@types/react": "17.0.42",
"@types/react-dom": "17.0.14",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"@types/sinon": "10.0.13",
"@types/testing-library__jest-dom": "5.14.5",
"@types/tinycolor2": "1.4.3",
"esbuild": "0.16.17",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-test-renderer": "17.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-test-renderer": "18.2.0",
"rimraf": "4.4.0",
"rollup": "2.79.1",
"rollup-plugin-dts": "^5.0.0",
Expand All @@ -94,7 +93,7 @@
"typescript": "4.8.4"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
}
}
3 changes: 0 additions & 3 deletions packages/grafana-e2e/src/flows/configurePanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC

if (queriesForm) {
queriesForm(fullConfig);
e2e().wait('@chartData');

// Wait for a possible complex visualization to render (or something related, as this isn't necessary on the dashboard page)
// Can't assert that its HTML changed because a new query could produce the same results
Expand All @@ -158,8 +157,6 @@ export const configurePanel = (config: PartialAddPanelConfig | PartialEditPanelC
// Avoid annotations flakiness
e2e.components.RefreshPicker.runButtonV2().first().click({ force: true });

e2e().wait('@chartData');

// Wait for RxJS
e2e().wait(500);

Expand Down
7 changes: 3 additions & 4 deletions packages/grafana-e2e/src/flows/importDashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,9 @@ export const importDashboard = (dashboardToImport: Dashboard, queryTimeout?: num
e2e().visit(fromBaseUrl('/dashboard/import'));

// Note: normally we'd use 'click' and then 'type' here, but the json object is so big that using 'val' is much faster
e2e.components.DashboardImportPage.textarea()
.should('be.visible')
.click()
.invoke('val', JSON.stringify(dashboardToImport));
e2e.components.DashboardImportPage.textarea().should('be.visible');
e2e.components.DashboardImportPage.textarea().click();
e2e.components.DashboardImportPage.textarea().invoke('val', JSON.stringify(dashboardToImport));
e2e.components.DashboardImportPage.submit().should('be.visible').click();
e2e.components.ImportDashboardForm.name().should('be.visible').click().clear().type(dashboardToImport.title);
e2e.components.ImportDashboardForm.submit().should('be.visible').click();
Expand Down
17 changes: 8 additions & 9 deletions packages/grafana-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,20 @@
"@grafana/tsconfig": "^1.2.0-rc1",
"@rollup/plugin-commonjs": "23.0.2",
"@rollup/plugin-node-resolve": "15.0.1",
"@testing-library/dom": "8.20.0",
"@testing-library/react": "12.1.4",
"@testing-library/react-hooks": "8.0.1",
"@testing-library/dom": "9.0.1",
"@testing-library/react": "14.0.0",
"@testing-library/user-event": "14.4.3",
"@types/angular": "1.8.4",
"@types/history": "4.7.11",
"@types/jest": "29.2.3",
"@types/lodash": "4.14.191",
"@types/react": "17.0.42",
"@types/react-dom": "17.0.14",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"@types/systemjs": "^0.20.6",
"esbuild": "0.16.17",
"lodash": "4.17.21",
"react": "17.0.2",
"react-dom": "17.0.2",
"react": "18.2.0",
"react-dom": "18.2.0",
"rimraf": "4.4.0",
"rollup": "2.79.1",
"rollup-plugin-dts": "^5.0.0",
Expand All @@ -77,7 +76,7 @@
"typescript": "4.8.4"
},
"peerDependencies": {
"react": "17.0.2",
"react-dom": "17.0.2"
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0"
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { renderHook } from '@testing-library/react-hooks';
import { renderHook } from '@testing-library/react';
import React from 'react';

import {
Expand Down