Skip to content

Bump react-router-dom from 6.14.1 to 6.15.0 #61

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

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 6, 2023

Bumps react-router-dom from 6.14.1 to 6.15.0.

Release notes

Sourced from react-router-dom's releases.

react-router-dom-v5-compat@6.4.0-pre.15

Patch Changes

  • Updated dependencies
    • react-router@6.4.0-pre.15
    • react-router-dom@6.4.0-pre.15

react-router-dom-v5-compat@6.4.0-pre.11

Patch Changes

  • Updated dependencies
    • react-router@6.4.0-pre.11
    • react-router-dom@6.4.0-pre.11

react-router-dom-v5-compat@6.4.0-pre.10

Patch Changes

  • Updated dependencies
    • react-router@6.4.0-pre.10
    • react-router-dom@6.4.0-pre.10

react-router-dom-v5-compat@6.4.0-pre.9

Patch Changes

  • Updated dependencies
    • react-router@6.4.0-pre.9
    • react-router-dom@6.4.0-pre.9

react-router-dom-v5-compat@6.4.0-pre.8

Patch Changes

  • Updated dependencies
    • react-router@6.4.0-pre.8
    • react-router-dom@6.4.0-pre.8

react-router-dom-v5-compat@6.4.0-pre.7

Patch Changes

  • Updated dependencies
    • react-router@6.4.0-pre.7
    • react-router-dom@6.4.0-pre.7

react-router-dom-v5-compat@6.4.0-pre.6

Patch Changes

  • 44bce3c6: Fix react-router-dom peer dependency version
    • react-router@6.4.0-pre.6
    • react-router-dom@6.4.0-pre.6

react-router-dom-v5-compat@6.4.0-pre.5

... (truncated)

Changelog

Sourced from react-router-dom's changelog.

6.15.0

Minor Changes

  • Add's a new redirectDocument() function which allows users to specify that a redirect from a loader/action should trigger a document reload (via window.location) instead of attempting to navigate to the redirected location via React Router (#10705)

Patch Changes

  • Fixes an edge-case affecting web extensions in Firefox that use URLSearchParams and the useSearchParams hook. (#10620)
  • Do not include hash in useFormAction() for unspecified actions since it cannot be determined on the server and causes hydration issues (#10758)
  • Reorder effects in unstable_usePrompt to avoid throwing an exception if the prompt is unblocked and a navigation is performed synchronously (#10687, #10718)
  • Updated dependencies:
    • @remix-run/router@1.8.0
    • react-router@6.15.0

6.14.2

Patch Changes

  • Properly decode element id when emulating hash scrolling via <ScrollRestoration> (#10682)
  • Add missing <Form state> prop to populate history.state on submission navigations (#10630)
  • Support proper hydration of Error subclasses such as ReferenceError/TypeError (#10633)
  • Updated dependencies:
    • @remix-run/router@1.7.2
    • react-router@6.14.2
Commits
  • e79cb77 chore: Update version for release (#10776)
  • cd1e25a chore: Update version for release (pre) (#10771)
  • d6d0e5b Merge branch 'main' into release-next
  • fb70fed Do not include hash in useFormAction() for unspecified actions (#10758)
  • 46806a4 Add support to force reload on redirect with X-Remix-Reload-Document header...
  • b23d7b5 Fix docs on NavLink w.r.t. links to the root route and the end prop (#10757)
  • 4bdd6b4 Add setTimeout back to unstable_usePrompt (#10718)
  • 78ef4ef Stabilize useRevalidator (#10707)
  • 172bad7 Merge branch 'release-next' into dev
  • 1acea8b chore: Update version for release (#10711)
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Sep 6, 2023
@ohakutsu ohakutsu requested a review from kimkim0814 September 7, 2023 03:17
@kimkim0814
Copy link
Member

【CIで落ちていた箇所】

Run yarn run lint

Error: node_modules/react-router-dom/dist/index.d.ts(36,107): error TS2694: Namespace 'React' has no exported member 'JSX'.
Error: node_modules/react-router-dom/dist/index.d.ts(47,101): error TS2694: Namespace 'React' has no exported member 'JSX'.
Error: node_modules/react-router-dom/dist/index.d.ts(60,101): error TS2694: Namespace 'React' has no exported member 'JSX'.
Error: node_modules/react-router/dist/lib/components.d.ts(139,87): error TS2694: Namespace 'React' has no exported member 'JSX'.
Error: node_modules/react-router/dist/lib/hooks.d.ts([12](https://github.com/increments/qiita-cli/actions/runs/6093811413/job/16534137078?pr=61#step:5:13)3,77): error TS2694: Namespace 'React' has no exported member 'JSX'.
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "lint:typecheck" exited with 2.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.

Run yarn run build

Error: node_modules/react-router/dist/lib/components.d.ts(139,87): error TS2694: Namespace 'React' has no exported member 'JSX'.
Error: node_modules/react-router/dist/lib/hooks.d.ts(123,77): error TS2694: Namespace 'React' has no exported member 'JSX'.
Error: node_modules/react-router-dom/dist/index.d.ts(36,[10](https://github.com/increments/qiita-cli/actions/runs/6093811413/job/16534136860?pr=61#step:5:11)7): error TS2694: Namespace 'React' has no exported member 'JSX'.
Error: node_modules/react-router-dom/dist/index.d.ts(47,101): error TS2694: Namespace 'React' has no exported member 'JSX'.
Error: node_modules/react-router-dom/dist/index.d.ts(60,101): error TS2694: Namespace 'React' has no exported member 'JSX'.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build:server" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Process completed with exit code 1.

@kimkim0814
Copy link
Member

kimkim0814 commented Sep 7, 2023

📝

今回変更されるパッケージ

  • react-router-dom
    • 6.14.1から6.15.0にアップグレード
    • 「react-router-dom」は、React用のReact Routerライブラリの一部で、ブラウザベースのルーティングを実装するための特定のAPIを提供する
    • 今回の変更はQiita CLIで使用する

ライブラリの差分

  • react-router-domが6.14.1から6.15.0に変更
    • 6.14.2
      • 以下パッチ変更
        • <ScrollRestoration>を使用してハッシュスクロールをエミュレートする際に要素のIDを正しくデコードするようにした
          • 「エミュレート 」は、元のシステムや状況を模倣すること、あるいは再現すること
          • 今回の場合は、古いブラウザの動作や特定の機能を再現することを意味する。
        • サブミッションナビゲーションで history.state を設定するための不足している プロパティを追加した
        • ReferenceError/TypeError などのエラーサブクラスの適切なhydration をサポート
        • 依存関係の変更
          • @remix-run/router@1.7.2
          • react-router@6.14.2
    • 6.15.0
      • 以下マイナーチェンジ
        • 新しい redirectDocument() 関数が追加され、ユーザーがローダーまたはアクションからのリダイレクトが React Router を介したリダイレクトの代わりに、文書の再読み込み(window.locationを介した)をトリガーするように指定できるようになった
      • 以下パッチ変更
        • FirefoxでURLSearchParamsuseSearchParamsフックを使用するウェブ拡張機能に影響を及ぼすエッジケースを修正した
        • サーバー上で決定できず、ハイドレーションの問題を引き起こすため、未指定のアクションの場合、useFormAction()にハッシュを含めないようにした
        • unstable_usePrompt内のエフェクトを再配置して、プロンプトがブロック解除され、同期的にナビゲーションが実行された場合に例外がスローされないようにした
        • 依存関係の変更
          • @remix-run/router@1.8.0
          • react-router@6.15.0

@kimkim0814 kimkim0814 requested review from a team and kyntk and removed request for a team September 7, 2023 04:19
@kimkim0814
Copy link
Member

📝
#61 (comment)

上記のエラーについて、開発環境で実行したが mainブランチでは検出されずに
当ブランチでは検出された

@kimkim0814 kimkim0814 self-assigned this Sep 8, 2023
@kimkim0814 kimkim0814 removed their request for review September 8, 2023 02:52
@kimkim0814 kimkim0814 force-pushed the dependabot/npm_and_yarn/react-router-dom-6.15.0 branch from 638d7cc to 54a91f8 Compare September 8, 2023 04:05
@kimkim0814
Copy link
Member

@kyntk
TypeScript の公式ドキュメントに、外部ライブラリに対する型チェックのスキップについて言及されてました。

skipLibCheckオプションを使用してnode_modules内の外部ライブラリの型をスキップする
ユースケースが記載されており、一般的に node_modulesディレクトリ内の外部ライブラリはチェック
することは稀だと思うので今回はskipLibCheckを追加しようと思います。
(明確にbuildで書いてもいい理由とは逸れているかも知れないです🙏)

以下引用

A common case where you might think to use skipLibCheck is when there are two copies of a library’s types in your node_modules. In these cases, you should consider using a feature like yarn’s resolutions to ensure there is only one copy of that dependency in your tree or investigate how to ensure there is only one copy by understanding the dependency resolution to fix the issue without additional tooling.

ref:https://www.typescriptlang.org/tsconfig#skipLibCheck

@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Sep 18, 2023

A newer version of react-router-dom exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged.

@kyntk
Copy link
Contributor

kyntk commented Sep 29, 2023

@kimkim0814 レビューが遅くなり申し訳ございません。

lintがfailしていた原因を調査してみたのですが、型定義が古いことが起因していそうです。
remix-run/react-router#10824 (comment)

最新のバージョンに上げたところエラーは起きなかったので、skipLibCheckをするのではなく、この方法のほうが良さそうだと思いました

$ yarn remove @types/react @types/react-dom
$ yarn add -D @types/react@latest @types/react-dom@latest
$ yarn run lint                                                                                                                                                                                              +dependabot/npm_and_yarn/react-router-dom-6.15.0
yarn run v1.22.19
$ run-p lint:*
$ prettier --check .
$ eslint .
$ tsc --noEmit
Checking formatting...
All matched files use Prettier code style!
✨  Done in 9.44s.

Copy link
Contributor

@kyntk kyntk left a comment

Choose a reason for hiding this comment

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

コメント済み

@kimkim0814 kimkim0814 force-pushed the dependabot/npm_and_yarn/react-router-dom-6.15.0 branch from 54a91f8 to 821310c Compare October 3, 2023 03:25
@kimkim0814
Copy link
Member

@kyntk
下記で修正いたしました!
821310c

CIが落ちたテストの検証

Run yarn run lint

qiita-cli % yarn run lint:typecheck                                
yarn run v1.22.19
$ tsc --noEmit
✨  Done in 4.03s.

Run yarn run build

qiita-cli % yarn run build:server                    
yarn run v1.22.19
$ tsc --build
✨  Done in 0.51s.

@kimkim0814 kimkim0814 requested a review from kyntk October 3, 2023 03:31
Copy link
Contributor

@kyntk kyntk left a comment

Choose a reason for hiding this comment

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

LGTM!

@kimkim0814 kimkim0814 force-pushed the dependabot/npm_and_yarn/react-router-dom-6.15.0 branch from 821310c to c39c84c Compare November 1, 2023 05:45
dependabot bot and others added 2 commits November 1, 2023 14:49
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.14.1 to 6.15.0.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.15.0/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@kimkim0814 kimkim0814 force-pushed the dependabot/npm_and_yarn/react-router-dom-6.15.0 branch from c39c84c to 505f0df Compare November 1, 2023 05:50
@kyntk kyntk merged commit 3d008b3 into main Nov 1, 2023
@kyntk kyntk deleted the dependabot/npm_and_yarn/react-router-dom-6.15.0 branch November 1, 2023 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants