Skip to content

Commit a34b722

Browse files
authored
Remove non-v7 packages (#11479)
* Remove react-router-native * Remove react-router-dom-v5-compat * Add __DEV__ TS definition that used to come from @types/react-native * Fix remix-dev test
1 parent 6ee39d0 commit a34b722

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+268
-6252
lines changed

.changeset/config.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
[
1010
"react-router",
1111
"react-router-dom",
12-
"react-router-dom-v5-compat",
13-
"react-router-native",
1412
"@react-router/dev",
1513
"@react-router/express",
1614
"@react-router/node",

.changeset/drop-node-16.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
---
2-
"react-router-dom-v5-compat": major
3-
"react-router-native": major
42
"react-router-dom": major
53
"react-router": major
64
"@remix-run/router": major

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ node_modules/
2222
/packages/*/dist/
2323
/packages/*/LICENSE.md
2424

25-
# compat module copies
26-
/packages/react-router-dom-v5-compat/react-router-dom
27-
2825
.eslintcache
2926
.tmp
3027
/.env

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[build-badge]: https://img.shields.io/github/actions/workflow/status/remix-run/react-router/test.yml?branch=dev&style=square
66
[build]: https://github.com/remix-run/react-router/actions/workflows/test.yml
77

8-
React Router is a lightweight, fully-featured routing library for the [React](https://reactjs.org) JavaScript library. React Router runs everywhere that React runs; on the web, on the server (using node.js), and on React Native.
8+
React Router is a lightweight, fully-featured routing library for the [React](https://reactjs.org) JavaScript library. React Router runs anywhere React runs; on the web, on the server with node.js, or on any other Javascript platform that supports the [Web Fetch API][fetch-api].
99

1010
If you're new to React Router, we recommend you start with [the tutorial](https://reactrouter.com/en/main/start/tutorial).
1111

@@ -21,9 +21,14 @@ There are many different ways to contribute to React Router's development. If yo
2121

2222
This repository is a monorepo containing the following packages:
2323

24+
- [`@react-router/dev`](/packages/remix-dev)
25+
- [`@react-router/express`](/packages/remix-express)
26+
- [`@react-router/node`](/packages/remix-node)
27+
- [`@react-router/serve`](/packages/remix-serve)
28+
- [`@react-router/server-runtime`](/packages/remix-server-runtime)
29+
- [`@react-router/testing`](/packages/remix-testing)
2430
- [`react-router`](/packages/react-router)
2531
- [`react-router-dom`](/packages/react-router-dom)
26-
- [`react-router-native`](/packages/react-router-native)
2732

2833
## Changes
2934

@@ -36,3 +41,5 @@ You may provide financial support for this project by donating [via Open Collect
3641
## About
3742

3843
React Router is developed and maintained by [Remix Software](https://remix.run) and many [amazing contributors](https://github.com/remix-run/react-router/graphs/contributors).
44+
45+
[fetch-api]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API

docs/components/link-native.md

Lines changed: 0 additions & 45 deletions
This file was deleted.

docs/components/link.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ title: Link
44

55
# `<Link>`
66

7-
<docs-info>This is the web version of `<Link>`. For the React Native version, [go here][link-native].</docs-info>
8-
97
<details>
108
<summary>Type declaration</summary>
119

@@ -216,7 +214,6 @@ function ImageLink(to) {
216214

217215
<docs-warning>Please note that this API is marked unstable and may be subject to breaking changes without a major release</docs-warning>
218216

219-
[link-native]: ./link-native
220217
[scrollrestoration]: ./scroll-restoration
221218
[history-replace-state]: https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
222219
[history-push-state]: https://developer.mozilla.org/en-US/docs/Web/API/History/pushState

docs/guides/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ We use [pnpm workspaces](https://pnpm.io/workspaces/) to manage installation of
7676

7777
### Building
7878

79-
Calling `pnpm build` from the root directory will run the build, which should take only a few seconds. It's important to build all the packages together because `react-router-dom` and `react-router-native` both use `react-router` as a dependency.
79+
Calling `pnpm build` from the root directory will run the build, which should take only a few seconds. It's important to build all the packages together because the individual packages have dependencies on one another.
8080

8181
### Testing
8282

docs/hooks/use-link-press-handler.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

docs/hooks/use-search-params-rn.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

docs/hooks/use-search-params.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ title: useSearchParams
44

55
# `useSearchParams`
66

7-
<docs-info>This is the web version of `useSearchParams`. For the React Native version, [go here][usesearchparams-native].</docs-info>
8-
97
<details>
108
<summary>Type declaration</summary>
119

@@ -68,6 +66,5 @@ function App() {
6866

6967
[functional-updates]: https://reactjs.org/docs/hooks-reference.html#functional-updates
7068
[searchparams]: https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams
71-
[usesearchparams-native]: ./use-search-params-rn
7269
[usestate]: https://react.dev/reference/react/useState
7370
[usenavigate]: ./use-navigate

docs/router-components/native-router.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

docs/routers/picking-a-router.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ The following routers do not support the data APIs:
2222
- [`<BrowserRouter>`][browserrouter]
2323
- [`<MemoryRouter>`][memoryrouter]
2424
- [`<HashRouter>`][hashrouter]
25-
- [`<NativeRouter>`][nativerouter]
2625
- [`<StaticRouter>`][staticrouter]
2726

28-
We recommend updating your app to use one of the new routers from 6.4. The data APIs are currently not supported in React Native, but should be eventually.
27+
We recommend updating your app to use one of the new routers from 6.4+.
2928

3029
The easiest way to quickly update to a v6.4 is to get the help from [`createRoutesFromElements`][createroutesfromelements] so you don't need to convert your `<Route>` elements to route objects.
3130

@@ -78,12 +77,6 @@ module.exports = {
7877
};
7978
```
8079

81-
## React Native
82-
83-
You will use [`<NativeRouter>`][nativerouter] from React Native projects.
84-
85-
The data APIs from v6.4 are currently not supported in React Native, but should be eventually.
86-
8780
## Data APIs
8881

8982
The following APIs are introduced in React Router 6.4 and will only work when using a data router:
@@ -119,7 +112,6 @@ The following APIs are introduced in React Router 6.4 and will only work when us
119112
[browserrouter]: ../router-components/browser-router
120113
[memoryrouter]: ../router-components/memory-router
121114
[hashrouter]: ../router-components/hash-router
122-
[nativerouter]: ../router-components/native-router
123115
[staticrouter]: ../router-components/static-router
124116
[data-apis]: #data-apis
125117
[action]: ../route/action

docs/start/_tutorial.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ hidden: true
1010

1111
[Check out the completed version of the app here][stackblitz-app].
1212

13-
React Router is a fully-featured client and server-side routing library for React, a JavaScript library for building user interfaces. React Router runs anywhere React runs; on the web, on the server with node.js, and on React Native.
13+
React Router is a fully-featured client and server-side routing library for React, a JavaScript library for building user interfaces. React Router runs anywhere React runs; on the web, on the server with node.js, or on any other Javascript platform that supports the [Web Fetch API][fetch-api].
1414

1515
If you're just getting started with React generally, we recommend you follow [the excellent Getting Started guide][reactjs-getting-started] in the official docs. There is plenty of information there to get you up and running. React Router is compatible with React >= 16.8.
1616

@@ -862,3 +862,4 @@ If you're having trouble, check out the [Resources](/resources) page to get help
862862
[cra]: https://create-react-app.dev/
863863
[vite]: https://vitejs.dev/guide/#scaffolding-your-first-vite-project
864864
[remix]: https://remix.run
865+
[fetch-api]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API

docs/upgrading/v5.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ For this step, you'll need to install React Router v6. If you're managing depend
139139

140140
```bash
141141
$ npm install react-router-dom
142-
# or, for a React Native app
143-
$ npm install react-router-native
144142
```
145143

146144
You'll also want to remove the `history` dependency from your package.json. The `history` library is a direct dependency of v6 (not a peer dep), so you won't ever import or use it directly. Instead, you'll use the `useNavigate()` hook for all navigation (see below).
@@ -814,8 +812,6 @@ const Link = React.forwardRef(
814812
);
815813
```
816814

817-
If you're using `react-router-native`, we provide `useLinkPressHandler` that works basically the same way. Just call that hook's returned function in your `Link`'s `onPress` handler and you're all set.
818-
819815
## Rename `<NavLink exact>` to `<NavLink end>`
820816

821817
This is a simple renaming of a prop to better align with the common practices of other libraries in the React ecosystem.

jest/jest.config.shared.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ module.exports = {
1212
"^@remix-run/router$": "<rootDir>/../router/index.ts",
1313
"^react-router$": "<rootDir>/../react-router/index.ts",
1414
"^react-router-dom$": "<rootDir>/../react-router-dom/index.tsx",
15-
"^react-router-dom-v5-compat$":
16-
"<rootDir>/../react-router-dom-v5-compat/index.ts",
17-
"^react-router-native$": "<rootDir>/../react-router-native/index.tsx",
1815
"^@web3-storage/multipart-parser$": require.resolve(
1916
"@web3-storage/multipart-parser"
2017
),

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
"@types/jsonfile": "^6.1.1",
7474
"@types/react": "^18.2.18",
7575
"@types/react-dom": "^18.2.7",
76-
"@types/react-native": "^0.69.21",
7776
"@types/react-test-renderer": "^18.0.0",
7877
"@types/semver": "^7.5.0",
7978
"@types/shelljs": "^0.8.11",

0 commit comments

Comments
 (0)