-
Notifications
You must be signed in to change notification settings - Fork 11.7k
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
Chore: Upgrade to react 18 #64428
Changes from 66 commits
Commits
Show all changes
69 commits
Select commit
Hold shift + click to select a range
0a6064b
update react 18 related deps
ashharrison90 bd325e0
Merge branch 'main' into ash/react-18
ashharrison90 ae4f4d7
fix some types
ashharrison90 a679c74
Merge branch 'main' into ash/react-18
ashharrison90 7a8e1a9
Merge branch 'main' into ash/react-18
ashharrison90 7652c93
Merge branch 'main' into ash/react-18
ashharrison90 0549d8b
make sure we're on react-router-dom >= 5.3.3
ashharrison90 8b8232e
Use new root API
kaydelaney 570d594
Remove StrictMode for now - react 18 double rendering causes issues
ashharrison90 cc01302
Merge branch 'main' into ash/react-18
ashharrison90 747b50e
Merge branch 'main' into ash/react-18
ashharrison90 cb0ca7e
fix + ignore some @grafana/ui types
ashharrison90 423483a
fix some more types
ashharrison90 13f45f5
use renderHook from @testing-library/react in almost all cases
ashharrison90 846b883
fix storybook types
ashharrison90 7b97fab
rewrite useDashboardSave to not use useEffect
ashharrison90 53f29f0
make props optional
ashharrison90 2b9d8dd
only render if props are provided
ashharrison90 e3c14d1
Merge branch 'main' into ash/react-18
ashharrison90 ceb9d7d
add correct type for useCallback
ashharrison90 d6bac45
make resourcepicker tests more robust
ashharrison90 baff119
fix ModalManager rendering
ashharrison90 9ab3067
fix some more unit tests
ashharrison90 71ef071
store the click coordinates in a ref as setState is NOT synchronous
ashharrison90 1b9f4c1
fix remaining e2e tests
ashharrison90 7c39cda
rewrite dashboardpage tests to avoid act warnings
ashharrison90 0c39815
undo lint ignores
ashharrison90 9606b06
fix ExpanderCell types
ashharrison90 31b59c4
set SymbolCell type correctly
ashharrison90 7afe79b
Merge branch 'main' into ash/react-18
ashharrison90 0c45018
fix QueryAndExpressionsStep
ashharrison90 46f99d1
looks like the types were actually wrong instead :D
ashharrison90 2438f13
undo this for now...
ashharrison90 3f16481
remove spinner waits
ashharrison90 307f3c9
more robust tests
ashharrison90 ffa4ecb
rewrite errorboundary test to not explicitly count the number of renders
ashharrison90 b2d103b
make urlParam expect async
ashharrison90 34cdf50
increase timeout in waitFor
ashharrison90 cabc9b6
revert ExplorePage test changes
ashharrison90 3324cea
Update public/app/features/dashboard/containers/DashboardPage.test.tsx
ashharrison90 09633dc
Update public/app/features/dashboard/containers/PublicDashboardPage.t…
ashharrison90 36f2511
Update public/app/features/dashboard/containers/PublicDashboardPage.t…
ashharrison90 ac09842
Update public/app/features/dashboard/containers/PublicDashboardPage.t…
ashharrison90 f2580ef
skip fakeTimer test, ignore table types for now + other review comments
ashharrison90 8d4f518
Merge branch 'ash/react-18' of https://github.com/grafana/grafana int…
ashharrison90 cee4037
update package peerDeps
ashharrison90 bba9118
small tweak to resourcepicker test
ashharrison90 2aa2ddd
Merge branch 'main' into ash/react-18
ashharrison90 711598a
update lockfile...
ashharrison90 9c5fc2d
increase timeout in sharepublicdashboard tests
ashharrison90 90dd670
Merge branch 'main' into ash/react-18
ashharrison90 c94bc79
ensure ExplorePaneContainer passes correct queries to initializeExplore
ashharrison90 b03b23a
fix LokiContextUI test
ashharrison90 b08bb9c
Merge branch 'main' into ash/react-18
ashharrison90 1b71bfb
fix unit tests
ashharrison90 56a874d
make importDashboard flow more consistent
ashharrison90 346151d
wait for dashboard name before continuing
ashharrison90 8a8b919
more test fixes
ashharrison90 2fcb339
Merge branch 'main' into ash/react-18
ashharrison90 cfc57b0
readd dashboard name to variable e2e tests
ashharrison90 b20f267
wait for switches to be enabled before clicking
ashharrison90 d1483a4
Merge branch 'main' into ash/react-18
ashharrison90 8f3a402
Merge branch 'main' into ash/react-18
ashharrison90 f633691
fix modal rendering
ashharrison90 a565d87
don't use @testing-library/dom directly
ashharrison90 3fe7f61
quick fix for rendering of panels in firefox
ashharrison90 7655c7e
Merge branch 'main' into ash/react-18
ashharrison90 3fe8563
make PromQueryField test more robust
ashharrison90 6d1433d
don't wait for chartData - in react 18 this can happen before the wai…
ashharrison90 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
.yarn/patches/@storybook-addon-docs-npm-6.5.16-56ecbd77e7.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
12
.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/grafana-runtime/src/analytics/plugins/usePluginInteractionReporter.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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 usetesting-library/dom
mostly for thewithin
function, which is also available fromtesting-library/react
. Should we try to remove this package?There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.There was a problem hiding this comment.
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:
there's another issue here saying that installing it directly is the correct approach when using
@testing-library/user-event
.