React Router v6 deprecation/future flag warnings

オープン
#325 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
javascript, react, typescript

調査の方向性

Start with shell/router/createRouter.tsx and check how its createBrowserRouter options are shared with the apps' test routers. Compare the two warnings and the behavior changes described in the issue with the converted apps before choosing whether to opt into flags, upgrade React Router, or filter warnings. Done means the chosen approach is consistent for the shell and affected app tests, with the warnings no longer appearing in the described setups.

索引モデルが issue の本文から書いたものです。

説明

What: react-router 6 prints its v7 future flag deprecation warnings for the shell's router, in the browser console of every frontend-base site in development and in the test output of every app that mounts a router. Deciding what to do about them belongs here, since the runtime router is the shell's.

Where it comes from: shell/router/createRouter.tsx calls createBrowserRouter(routes, { basename }) with no future option. react-router 6.26 and later (package.json pins ^6.26.1; apps install 6.30) warn once per router for each v7 flag that is not opted into:

⚠️ React Router Future Flag Warning: React Router will begin wrapping state updates in `React.startTransition` in v7. You can use the `v7_startTransition` future flag to opt-in early.
⚠️ React Router Future Flag Warning: Relative route resolution within Splat routes is changing in v7. You can use the `v7_relativeSplatPath` future flag to opt-in early.

Seen on 2026-10-21 in the dev console of an app's openedx dev site (the first message), and in every test file that renders a BrowserRouter or MemoryRouter (both messages; 58 of frontend-app-learning's 124 suites on master). The 6.30 runtime knows eight such flags (v7_startTransition, v7_relativeSplatPath, v7_partialHydration, v7_fetcherPersist, v7_normalizeFormMethod, v7_skipActionErrorRevalidation, v7_prependBasename, v7_throwAbortReason); the two above are the ones that warn in these setups.

Why it is not an app's fix: an app never creates the runtime router, and react-router offers no way to silence a deprecation other than opting into the flag it announces. Each flag is a behavior change for every app in the site (v7_startTransition wraps router state updates in React.startTransition; v7_relativeSplatPath changes how relative paths resolve inside splat routes), so opting in is a shell decision with an app-by-app check behind it. Upgrade guide: https://reactrouter.com/v6/upgrading/future.

Options

  1. Opt into the flags in createRouter.tsx, one at a time, after checking the converted apps against each. Apps' test routers then set the same flags so tests run under the runtime's semantics.
  2. Move to react-router 7, where the flags are the defaults and the warnings do not exist. Renovate's v7 PR (#47) was auto-closed; the migration is larger than the flags.
  3. Filter the two messages in the shell's development entry point until 1 or 2 happens.

[!NOTE]
This issue body was drafted by Claude (Claude Code) and reviewed before posting.

主要言語
TypeScript
スター
4
フォーク
13
平均マージ
3日 5時間
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

openedx/frontend-base のほかの issue

openedx/frontend-base の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。