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

Upgrade react/next version #10

Merged
merged 13 commits into from
Nov 24, 2022
Merged

Upgrade react/next version #10

merged 13 commits into from
Nov 24, 2022

Conversation

JinTakenaka
Copy link
Contributor

@JinTakenaka JinTakenaka commented Nov 17, 2022

Summary

update next version to 13
update react version to 18

@JinTakenaka
Copy link
Contributor Author

fixing...

@github-actions
Copy link

Coverage after merging update/react-next into main

81.25%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
src/config
   routes.ts100%100%100%
src/functions
   config.ts0%0%57.14%..., 21, 21, 22, 24
   httpClient.ts66.67%100%90.91%..., 49, 51, 56, 99
   numberWithCommas.ts100%100%100%
src/hooks
   useCSR.ts87.50%100%84.62%11, 13, 14
src/pages/Home
   Home.tsx100%100%100%
src/pages/Login
   Login.tsx100%0%0%3, 4

@github-actions
Copy link

Coverage after merging update/react-next into main

81.25%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
src/config
   routes.ts100%100%100%
src/functions
   config.ts0%0%57.14%..., 21, 21, 22, 24
   httpClient.ts66.67%100%90.91%..., 49, 51, 56, 99
   numberWithCommas.ts100%100%100%
src/hooks
   useCSR.ts87.50%100%84.62%11, 13, 14
src/pages/Home
   Home.tsx100%100%100%
src/pages/Login
   Login.tsx100%0%0%3, 4

"webpack": "^5.75.0"
},
"resolutions": {
"react-test-renderer": "18.2.0"
Copy link
Contributor Author

@JinTakenaka JinTakenaka Nov 22, 2022

Choose a reason for hiding this comment

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

どうにも現状ではreact18でstorybookを動作させるにはreact-test-rendererのバージョンを強制的に指定する必要がある模様

@github-actions
Copy link

Coverage after merging update/react-next into main

81.25%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
src/config
   routes.ts100%100%100%
src/functions
   config.ts0%0%57.14%..., 21, 21, 22, 24
   httpClient.ts66.67%100%90.91%..., 49, 51, 56, 99
   numberWithCommas.ts100%100%100%
src/hooks
   useCSR.ts87.50%100%84.62%11, 13, 14
src/pages/Home
   Home.tsx100%100%100%
src/pages/Login
   Login.tsx100%0%0%3, 4

@JinTakenaka JinTakenaka changed the title [WIP]upgrade react next [WIP]upgrade react/next version Nov 22, 2022
@github-actions
Copy link

Coverage after merging update/react-next into main

85.42%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
src/config
   routes.ts100%100%100%
src/functions
   config.ts0%0%57.14%..., 21, 21, 22, 24
   httpClient.ts66.67%100%90.91%..., 49, 51, 56, 99
   numberWithCommas.ts100%100%100%
src/hooks
   useCSR.ts100%100%100%
src/pages/Home
   Home.tsx100%100%100%
src/pages/Login
   Login.tsx100%0%0%3, 4

1 similar comment
@github-actions
Copy link

Coverage after merging update/react-next into main

85.42%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
src/config
   routes.ts100%100%100%
src/functions
   config.ts0%0%57.14%..., 21, 21, 22, 24
   httpClient.ts66.67%100%90.91%..., 49, 51, 56, 99
   numberWithCommas.ts100%100%100%
src/hooks
   useCSR.ts100%100%100%
src/pages/Home
   Home.tsx100%100%100%
src/pages/Login
   Login.tsx100%0%0%3, 4

"lint-staged": "^12.4.1",
"nock": "^13.2.7",
"prettier": "^2.6.2",
"sass": "^1.52.3",
"sass-loader": "^13.0.0",
"storybook-addon-next-router": "^4.0.0",
"next-router-mock": "^0.8.0",
Copy link
Contributor Author

@JinTakenaka JinTakenaka Nov 22, 2022

Choose a reason for hiding this comment

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

next13でnext/routerをインポートすると

you should only use "next/router" on the client side of your app.

と言われていしまうので、その対策として導入

@github-actions
Copy link

Coverage after merging update/react-next into main

85.42%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
src/config
   routes.ts100%100%100%
src/functions
   config.ts0%0%57.14%..., 21, 21, 22, 24
   httpClient.ts66.67%100%90.91%..., 49, 51, 56, 99
   numberWithCommas.ts100%100%100%
src/hooks
   useCSR.ts100%100%100%
src/pages/Home
   Home.tsx100%100%100%
src/pages/Login
   Login.tsx100%0%0%3, 4

1 similar comment
@github-actions
Copy link

Coverage after merging update/react-next into main

85.42%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
src/config
   routes.ts100%100%100%
src/functions
   config.ts0%0%57.14%..., 21, 21, 22, 24
   httpClient.ts66.67%100%90.91%..., 49, 51, 56, 99
   numberWithCommas.ts100%100%100%
src/hooks
   useCSR.ts100%100%100%
src/pages/Home
   Home.tsx100%100%100%
src/pages/Login
   Login.tsx100%0%0%3, 4

@JinTakenaka JinTakenaka changed the title [WIP]upgrade react/next version Upgrade react/next version Nov 22, 2022
@@ -17,6 +17,7 @@ Array [
href="/login"
onClick={[Function]}
onMouseEnter={[Function]}
onTouchStart={[Function]}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

(おそらく)React18の影響?

import { renderHook, act, RenderResult } from '@testing-library/react-hooks'

import { useCSR } from '../useCSR'

jest.mock('next/router')
jest.mock('next/router', () => require('next-router-mock'))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

これで

you should only use "next/router" on the client side of your app.

と言われない

Copy link
Collaborator

Choose a reason for hiding this comment

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

細かいですが、jest.mockはimportの後の行に書きましょう。
記載自体は問題ないです。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

修正:26f04a6

Copy link
Collaborator

@MasahikoJinno MasahikoJinno left a comment

Choose a reason for hiding this comment

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

コメントしたところ以外は問題ないですー

@github-actions
Copy link

Coverage after merging update/react-next into main

85.42%

Coverage Report
FileBranchesFuncsLinesUncovered Lines
src/config
   routes.ts100%100%100%
src/functions
   config.ts0%0%57.14%..., 21, 21, 22, 24
   httpClient.ts66.67%100%90.91%..., 49, 51, 56, 99
   numberWithCommas.ts100%100%100%
src/hooks
   useCSR.ts100%100%100%
src/pages/Home
   Home.tsx100%100%100%
src/pages/Login
   Login.tsx100%0%0%3, 4

@JinTakenaka JinTakenaka merged commit bb74fbc into main Nov 24, 2022
@JinTakenaka JinTakenaka deleted the update/react-next branch November 24, 2022 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants