Skip to content

Commit e3d4596

Browse files
chore: Update version for release (pre) (#9229)
* chore: Update version for release (pre) * update changelogs Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Brophy <[email protected]>
1 parent 5cfde28 commit e3d4596

File tree

12 files changed

+131
-10
lines changed

12 files changed

+131
-10
lines changed

.changeset/pre.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"beige-buckets-lick",
1515
"big-bags-report",
1616
"brave-shirts-sneeze",
17+
"calm-lies-destroy",
1718
"chilled-beers-sell",
1819
"cuddly-dingos-tickle",
1920
"dirty-ladybugs-grow",
@@ -33,6 +34,7 @@
3334
"ninety-spoons-suffer",
3435
"odd-yaks-kneel",
3536
"red-sheep-push",
37+
"shy-guests-tickle",
3638
"silver-planes-relate",
3739
"sixty-otters-teach",
3840
"slimy-pugs-sip",

.changeset/shy-guests-tickle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"@remix-run/router": patch
44
---
55

6-
fix: Avoid suspense loops on promise aborted values
6+
fix: Avoid suspense loops on promise aborted values (#9226)

packages/react-router-dom-v5-compat/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# react-router-dom-v5-compat
22

3+
## 6.4.0-pre.15
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
9+
10+
311
## 6.4.0-pre.14
412

513
### Patch Changes

packages/react-router-dom-v5-compat/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-dom-v5-compat",
3-
"version": "6.4.0-pre.14",
3+
"version": "6.4.0-pre.15",
44
"description": "Migration path to React Router v6 from v4/5",
55
"keywords": [
66
"react",
@@ -24,7 +24,7 @@
2424
"types": "./dist/index.d.ts",
2525
"dependencies": {
2626
"history": "^5.3.0",
27-
"react-router": "6.4.0-pre.14"
27+
"react-router": "6.4.0-pre.15"
2828
},
2929
"peerDependencies": {
3030
"react": ">=16.8",

packages/react-router-dom/CHANGELOG.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,93 @@
11
# react-router-dom
22

3+
## 6.4.0-pre.15
4+
5+
### Patch Changes
6+
7+
- fix: remove internal router singleton (#9227)
8+
9+
This change removes the internal module-level `routerSingleton` we create and maintain inside our data routers since it was causing a number of headaches for non-simple use cases:
10+
11+
- Unit tests are a pain because you need to find a way to reset the singleton in-between tests
12+
- Use use a `_resetModuleScope` singleton for our tests
13+
- ...but this isn't exposed to users who may want to do their own tests around our router
14+
- The JSX children `<Route>` objects cause non-intuitive behavior based on idiomatic react expectations
15+
- Conditional runtime `<Route>`'s won't get picked up
16+
- Adding new `<Route>`'s during local dev won't get picked up during HMR
17+
- Using external state in your elements doesn't work as one might expect (see #9225)
18+
19+
Instead, we are going to lift the singleton out into user-land, so that they create the router singleton and manage it outside the react tree - which is what react 18 is encouraging with `useSyncExternalStore` anyways! This also means that since users create the router - there's no longer any difference in the rendering aspect for memory/browser/hash routers (which only impacts router/history creation) - so we can get rid of those and trim to a simple `RouterProvider`
20+
21+
```jsx
22+
// Before
23+
function App() {
24+
<DataBrowserRouter>
25+
<Route path="/" element={<Layout />}>
26+
<Route index element={<Home />}>
27+
</Route>
28+
<DataBrowserRouter>
29+
}
30+
31+
// After
32+
let router = createBrowserRouter([{
33+
path: "/",
34+
element: <Layout />,
35+
children: [{
36+
index: true,
37+
element: <Home />,
38+
}]
39+
}]);
40+
41+
function App() {
42+
return <RouterProvider router={router} />
43+
}
44+
```
45+
46+
If folks still prefer the JSX notation, they can leverage `createRoutesFromElements` (aliased from `createRoutesFromChildren` since they are not "children" in this usage):
47+
48+
```jsx
49+
let routes = createRoutesFromElements(
50+
<Route path="/" element={<Layout />}>
51+
<Route index element={<Home />}>
52+
</Route>
53+
);
54+
let router = createBrowserRouter(routes);
55+
56+
function App() {
57+
return <RouterProvider router={router} />
58+
}
59+
```
60+
61+
And now they can also hook into HMR correctly for router disposal:
62+
63+
```
64+
if (import.meta.hot) {
65+
import.meta.hot.dispose(() => router.dispose());
66+
}
67+
```
68+
69+
And finally since `<RouterProvider>` accepts a router, it makes unit testing easer since you can create a fresh router with each test.
70+
71+
**Removed APIs**
72+
73+
- `<DataMemoryRouter>`
74+
- `<DataBrowserRouter>`
75+
- `<DataHashRouter>`
76+
- `<DataRouterProvider>`
77+
- `<DataRouter>`
78+
79+
**Modified APIs**
80+
81+
- `createMemoryRouter`/`createBrowserRouter`/`createHashRouter` used to live in `@remix-run/router` to prevent devs from needing to create their own `history`. These are now moved to `react-router`/`react-router-dom` and handle the `RouteObject -> AgnosticRouteObject` conversion.
82+
83+
**Added APIs**
84+
85+
- `<RouterProvider>`
86+
- `createRoutesFromElements` (alias of `createRoutesFromChildren`)
87+
88+
- Updated dependencies
89+
90+
391
## 6.4.0-pre.14
492

593
### Patch Changes

packages/react-router-dom/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-dom",
3-
"version": "6.4.0-pre.14",
3+
"version": "6.4.0-pre.15",
44
"description": "Declarative routing for React web applications",
55
"keywords": [
66
"react",
@@ -23,7 +23,7 @@
2323
"module": "./dist/index.js",
2424
"types": "./dist/index.d.ts",
2525
"dependencies": {
26-
"react-router": "6.4.0-pre.14"
26+
"react-router": "6.4.0-pre.15"
2727
},
2828
"devDependencies": {
2929
"react": "^18.2.0",

packages/react-router-native/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# react-router-native
22

3+
## 6.4.0-pre.15
4+
5+
### Patch Changes
6+
7+
- Updated dependencies
8+
9+
310
## 6.4.0-pre.14
411

512
### Patch Changes

packages/react-router-native/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router-native",
3-
"version": "6.4.0-pre.14",
3+
"version": "6.4.0-pre.15",
44
"description": "Declarative routing for React Native applications",
55
"keywords": [
66
"react",
@@ -22,7 +22,7 @@
2222
"types": "./dist/index.d.ts",
2323
"dependencies": {
2424
"@ungap/url-search-params": "^0.1.4",
25-
"react-router": "6.4.0-pre.14"
25+
"react-router": "6.4.0-pre.15"
2626
},
2727
"devDependencies": {
2828
"react": "^18.2.0",

packages/react-router/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# react-router
22

3+
## 6.4.0-pre.15
4+
5+
### Patch Changes
6+
7+
- fix: remove internal router singleton (#9227)
8+
- fix: Avoid suspense loops on promise aborted values (#9226)
9+
- Updated dependencies
10+
- @remix-run/router@0.2.0-pre.10
11+
312
## 6.4.0-pre.14
413

514
### Patch Changes

packages/react-router/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-router",
3-
"version": "6.4.0-pre.14",
3+
"version": "6.4.0-pre.15",
44
"description": "Declarative routing for React",
55
"keywords": [
66
"react",
@@ -23,7 +23,7 @@
2323
"module": "./dist/index.js",
2424
"types": "./dist/index.d.ts",
2525
"dependencies": {
26-
"@remix-run/router": "0.2.0-pre.9"
26+
"@remix-run/router": "0.2.0-pre.10"
2727
},
2828
"devDependencies": {
2929
"react": "^18.2.0"

packages/router/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# @remix-run/router
22

3+
## 0.2.0-pre.10
4+
5+
### Patch Changes
6+
7+
- fix: remove internal router singleton (#9227)
8+
- fix: Avoid suspense loops on promise aborted values (#9226)
9+
310
## 0.2.0-pre.9
411

512
### Patch Changes

packages/router/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@remix-run/router",
3-
"version": "0.2.0-pre.9",
3+
"version": "0.2.0-pre.10",
44
"description": "Nested/Data-driven/Framework-agnostic Routing",
55
"keywords": [
66
"remix",

0 commit comments

Comments
 (0)