Add a new future.v7_relativeSplatPath flag to implement a breaking bug fix to relative routing when inside a splat route. (#11087)
This fix was originally added in #10983 and was later reverted in #11078 because it was determined that a large number of existing applications were relying on the buggy behavior (see #11052)
The Bug
The buggy behavior is that without this flag, the default behavior when resolving relative paths is to ignore any splat (*) portion of the current route path.
The Background
This decision was originally made thinking that it would make the concept of nested different sections of your apps in <Routes> easier if relative routing would replace the current splat:
Any paths like /dashboard, /dashboard/team, /dashboard/projects will match the Dashboard route. The dashboard component itself can then render nested <Routes>:
Now, all links and route paths are relative to the router above them. This makes code splitting and compartmentalizing your app really easy. You could render the Dashboard as its own independent app, or embed it into your large app without making any changes to it.
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually 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)
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.20.1 to 6.21.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/remix-run/react-router/releases">react-router-dom's releases</a>.</em></p>
<blockquote>
<h2>react-router-dom-v5-compat@6.4.0-pre.15</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li>react-router@6.4.0-pre.15</li>
<li>react-router-dom@6.4.0-pre.15</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.11</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li>react-router@6.4.0-pre.11</li>
<li>react-router-dom@6.4.0-pre.11</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.10</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li>react-router@6.4.0-pre.10</li>
<li>react-router-dom@6.4.0-pre.10</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.9</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li>react-router@6.4.0-pre.9</li>
<li>react-router-dom@6.4.0-pre.9</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.8</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li>react-router@6.4.0-pre.8</li>
<li>react-router-dom@6.4.0-pre.8</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.7</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies
<ul>
<li><code>react-router@6.4.0-pre.7</code></li>
<li><code>react-router-dom@6.4.0-pre.7</code></li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.6</h2>
<h3>Patch Changes</h3>
<ul>
<li>44bce3c6: Fix <code>react-router-dom</code> peer dependency version
<ul>
<li>react-router@6.4.0-pre.6</li>
<li>react-router-dom@6.4.0-pre.6</li>
</ul>
</li>
</ul>
<h2>react-router-dom-v5-compat@6.4.0-pre.5</h2>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md">react-router-dom's changelog</a>.</em></p>
<blockquote>
<h2>6.21.0</h2>
<h3>Minor Changes</h3>
<ul>
<li>
<p>Add a new <code>future.v7_relativeSplatPath</code> flag to implement a breaking bug fix to relative routing when inside a splat route. (<a href="https://redirect.github.com/remix-run/react-router/pull/11087">#11087</a>)</p>
<p>This fix was originally added in <a href="https://redirect.github.com/remix-run/react-router/issues/10983">#10983</a> and was later reverted in <a href="https://redirect.github.com/remix-run/react-router/pull/11078">#11078</a> because it was determined that a large number of existing applications were relying on the buggy behavior (see <a href="https://redirect.github.com/remix-run/react-router/issues/11052">#11052</a>)</p>
<p><strong>The Bug</strong>
The buggy behavior is that without this flag, the default behavior when resolving relative paths is to <em>ignore</em> any splat (<code>*</code>) portion of the current route path.</p>
<p><strong>The Background</strong>
This decision was originally made thinking that it would make the concept of nested different sections of your apps in <code><Routes></code> easier if relative routing would <em>replace</em> the current splat:</p>
<pre lang="jsx"><code><BrowserRouter>
<Routes>
<Route path="/" element={<Home />} />
<Route path="dashboard/*" element={<Dashboard />} />
</Routes>
</BrowserRouter>
</code></pre>
<p>Any paths like <code>/dashboard</code>, <code>/dashboard/team</code>, <code>/dashboard/projects</code> will match the <code>Dashboard</code> route. The dashboard component itself can then render nested <code><Routes></code>:</p>
<pre lang="jsx"><code>function Dashboard() {
return (
<div>
<h2>Dashboard</h2>
<nav>
<Link to="/">Dashboard Home</Link>
<Link to="team">Team</Link>
<Link to="projects">Projects</Link>
</nav>
<pre><code> &lt;Routes&gt;
&lt;Route path=&quot;/&quot; element={&lt;DashboardHome /&gt;} /&gt;
&lt;Route path=&quot;team&quot; element={&lt;DashboardTeam /&gt;} /&gt;
&lt;Route path=&quot;projects&quot; element={&lt;DashboardProjects /&gt;} /&gt;
&lt;/Routes&gt;
&lt;/div&gt;
</code></pre>
<p>);
}
</code></pre></p>
<p>Now, all links and route paths are relative to the router above them. This makes code splitting and compartmentalizing your app really easy. You could render the <code>Dashboard</code> as its own independent app, or embed it into your large app without making any changes to it.</p>
<p><strong>The Problem</strong></p>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/remix-run/react-router/commit/69ba50e06633fd4add234fb47f2d49b0a5ee41f9"><code>69ba50e</code></a> chore: Update version for release (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/11114">#11114</a>)</li>
<li><a href="https://github.com/remix-run/react-router/commit/ea0ffeef8a0c353f8ef402b5df2ac7c60a4d0b49"><code>ea0ffee</code></a> chore: Update version for release (pre) (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/11095">#11095</a>)</li>
<li><a href="https://github.com/remix-run/react-router/commit/fe3c071037b18f447dabb44fb24e4b1bce2a2a15"><code>fe3c071</code></a> Slight refactor to partial hydration to leverage state.initialized properly (...</li>
<li><a href="https://github.com/remix-run/react-router/commit/373b30cdfb4a770e77f6ded25e94ba72fbde4e23"><code>373b30c</code></a> chore: Update version for release (pre) (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/11091">#11091</a>)</li>
<li><a href="https://github.com/remix-run/react-router/commit/f9d7ed62904766013d05a1642232d73e47f3bc27"><code>f9d7ed6</code></a> Fix server future plumbing</li>
<li><a href="https://github.com/remix-run/react-router/commit/56b2944ef18307fa6d5e432b52eead38eeda3402"><code>56b2944</code></a> chore: Update version for release (pre) (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/11090">#11090</a>)</li>
<li><a href="https://github.com/remix-run/react-router/commit/558d7936cc8fe643374a2c9a9fdcf022e8c4c939"><code>558d793</code></a> Fix plumbing of future prop</li>
<li><a href="https://github.com/remix-run/react-router/commit/ee5fcd54af4784d58191d97a7117fa4d75378946"><code>ee5fcd5</code></a> Generate release notes</li>
<li><a href="https://github.com/remix-run/react-router/commit/ddc2b94c26ac4a12b5a8e37dc4179e1b10644e1b"><code>ddc2b94</code></a> chore: Update version for release (pre) (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/11089">#11089</a>)</li>
<li><a href="https://github.com/remix-run/react-router/commit/149ad65a8dfb90b18835ec784792b6a86e4427a9"><code>149ad65</code></a> Add future.v7_relativeSplatPath flag (<a href="https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom/issues/11087">#11087</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/remix-run/react-router/commits/react-router-dom@6.21.0/packages/react-router-dom">compare view</a></li>
</ul>
</details>
<br />
[](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
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)
</details>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Bumps react-router-dom from 6.20.1 to 6.21.0.
Release notes
Sourced from react-router-dom's releases.
... (truncated)
Changelog
Sourced from react-router-dom's changelog.
... (truncated)
Commits
69ba50echore: Update version for release (#11114)ea0ffeechore: Update version for release (pre) (#11095)fe3c071Slight refactor to partial hydration to leverage state.initialized properly (...373b30cchore: Update version for release (pre) (#11091)f9d7ed6Fix server future plumbing56b2944chore: Update version for release (pre) (#11090)558d793Fix plumbing of future propee5fcd5Generate release notesddc2b94chore: Update version for release (pre) (#11089)149ad65Add future.v7_relativeSplatPath flag (#11087)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill 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 versionwill 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 dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)Deploying with
Cloudflare Pages
17b7402View logs