Skip to content

Commit d130a52

Browse files
committed
Remove v7_relativeSplatPath future flag and old code paths
1 parent ea6d5be commit d130a52

18 files changed

+153
-238
lines changed

.changeset/tidy-clouds-lay.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": major
3+
---
4+
5+
Remove `v7_relativeSplatPath` future flag

packages/react-router/__tests__/dom/data-browser-router-test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2955,7 +2955,7 @@ function testDomRouter(
29552955
let { container } = render(<RouterProvider router={router} />);
29562956

29572957
expect(container.querySelector("form")?.getAttribute("action")).toBe(
2958-
"/foo?a=1"
2958+
"/foo/bar?a=1"
29592959
);
29602960
});
29612961

@@ -2975,7 +2975,7 @@ function testDomRouter(
29752975
let { container } = render(<RouterProvider router={router} />);
29762976

29772977
expect(container.querySelector("form")?.getAttribute("action")).toBe(
2978-
"/foo"
2978+
"/foo/bar"
29792979
);
29802980
});
29812981

@@ -2995,7 +2995,7 @@ function testDomRouter(
29952995
let { container } = render(<RouterProvider router={router} />);
29962996

29972997
expect(container.querySelector("form")?.getAttribute("action")).toBe(
2998-
"/foo"
2998+
"/foo/bar"
29992999
);
30003000
});
30013001
});
@@ -3129,7 +3129,7 @@ function testDomRouter(
31293129
let { container } = render(<RouterProvider router={router} />);
31303130

31313131
expect(container.querySelector("form")?.getAttribute("action")).toBe(
3132-
"/inbox"
3132+
"/inbox/messages/1/2"
31333133
);
31343134
});
31353135
});

packages/react-router/__tests__/dom/link-href-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ describe("<Link> href", () => {
530530
});
531531

532532
expect(renderer.root.findByType("a").props.href).toEqual(
533-
"/inbox/messages"
533+
"/inbox/messages/abc"
534534
);
535535
});
536536

packages/react-router/__tests__/dom/special-characters-test.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,13 @@ describe("special character tests", () => {
581581
}
582582

583583
function Child() {
584+
let location = useLocation();
585+
let to = location.pathname.endsWith("grandchild")
586+
? "."
587+
: "./grandchild";
584588
return (
585589
<>
586-
<Link to="./grandchild">Link to grandchild</Link>
590+
<Link to={to}>Link to grandchild</Link>
587591
<Routes>
588592
<Route path="grandchild" element={<Grandchild />} />
589593
</Routes>

packages/react-router/__tests__/router/lazy-discovery-test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { AgnosticDataRouteObject, Router } from "../index";
2-
import { createMemoryHistory, createRouter } from "../index";
3-
import { ErrorResponseImpl } from "../utils";
1+
import type { AgnosticDataRouteObject, Router } from "../../lib/router/index";
2+
import { createMemoryHistory, createRouter } from "../../lib/router/index";
3+
import { ErrorResponseImpl } from "../../lib/router/utils";
44
import { createDeferred, createFormData, tick } from "./utils/utils";
55

66
let router: Router;

packages/react-router/__tests__/router/path-resolution-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ describe("path resolution", () => {
138138
path: "*",
139139
},
140140
],
141-
"/foo",
141+
"/foo/bar",
142142
false
143143
);
144144
});

0 commit comments

Comments
 (0)