Skip to content

Commit 5611898

Browse files
AlemTuzlakthomasfrabrulic
authored
React router v7 transition to react-router-devtools (#151)
* Start of React router v7 transition * fix * temp fix for typecheck * small fix * Removed remix forge completely, removed all remix references, renamed package to react-router-devtools * fix * removed test app, moved to pre.1 release * fix * fix * knip update * Network tracking PR (#161) * Network tracking PR * Network tracking PR * Catch aborted requests * Added tests, fixed some bugs and UI issues * fixes * Release 2.0.0-beta.0 * Complete refactor of the server to support single fetch properly * fix for linting issues * small bug fix * README update * README update * Removed legacy config, allow to include segments in produciton, updated docs website * made transforms safer * made transforms safer * Finalised the doc page migration to react-router * Finalised the doc page migration to react-router * renamed test app * necessary chanages to make deploy to fly work again * added fly deploy workflows * moved to validate * Added Dockerfile reference * Added newly introduced flag for single-repo but subfolder app deploys like docs in this case * removed "journal" text and changed title color * title color changed * main title fixed * Custom context feature * Refactored completely the testing strategy, added 100-ish tests * Refactored completely the testing strategy, added 100-ish tests * Refactored completely the testing strategy, added 100-ish tests * upgrade to react-router v7 --------- Co-authored-by: Thomas Fritz <mail@fritzthomas.com> Co-authored-by: abrulic1 <abrulic1@etf.unsa.ba>
1 parent 28711a9 commit 5611898

875 files changed

Lines changed: 29329 additions & 119406 deletions

File tree

Some content is hidden

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

.github/workflows/publish-commit.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: 🚀 pkg-pr-new
2-
on: [push, pull_request]
2+
concurrency:
3+
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}
4+
cancel-in-progress: true
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
310

411
jobs:
512
build:

.github/workflows/publish.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,15 @@ jobs:
1616
- run: npm ci
1717
- run: npm publish
1818
env:
19-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
19+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
20+
21+
deploy-preview:
22+
name: "🚀 Deploy Docs"
23+
needs: [npm-publish]
24+
uses: forge42dev/workflows/.github/workflows/deploy-to-fly.yaml@monorepo-matrix
25+
with:
26+
workspace_name: docs
27+
set_cwd_to_workspace: true
28+
github_environment: "docs-release"
29+
secrets:
30+
fly_api_token: ${{ secrets.FLY_API_TOKEN }}

.github/workflows/validate.yaml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,19 @@ jobs:
6363
run: npm install -g dotenv-cli
6464
- name: ⚡ Run vitest
6565
run: npm run test:cov
66-
- name: "Report Coverage"
66+
# - name: "Report Coverage"
6767
# Only works if you set `reportOnFailure: true` in your vite config as specified above
68-
if: always()
69-
uses: davelosert/vitest-coverage-report-action@v2
68+
# if: always()
69+
# uses: davelosert/vitest-coverage-report-action@v2
70+
71+
72+
deploy-preview:
73+
name: "🚀 Deploy Docs"
74+
needs: [lint, typecheck, vitest]
75+
uses: forge42dev/workflows/.github/workflows/deploy-to-fly.yaml@monorepo-matrix
76+
with:
77+
workspace_name: docs
78+
set_cwd_to_workspace: true
79+
github_environment: "docs-previev"
80+
secrets:
81+
fly_api_token: ${{ secrets.FLY_API_TOKEN }}

README.md

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,53 @@
11
<p align="center">
2-
<img src="./assets/remix-dev-tools.png" style="display: block; margin: 0 auto;" align="middle" height="240" alt="Remix Development Tools" />
2+
<img src="./assets/react-router-dev-tools.png" style="display: block; margin: 0 auto;" align="middle" height="240" alt="react-router-devtools" />
33
</p>
44

5-
# Remix Development Tools
5+
# react-router-devtools
66

7-
![GitHub Repo stars](https://img.shields.io/github/stars/Code-Forge-Net/Remix-Dev-Tools?style=social)
8-
![npm](https://img.shields.io/npm/v/remix-development-tools?style=plastic)
9-
![GitHub](https://img.shields.io/github/license/Code-Forge-Net/Remix-Dev-Tools?style=plastic)
10-
![npm](https://img.shields.io/npm/dy/remix-development-tools?style=plastic)
11-
![npm](https://img.shields.io/npm/dw/remix-development-tools?style=plastic)
12-
![GitHub top language](https://img.shields.io/github/languages/top/Code-Forge-Net/Remix-Dev-Tools?style=plastic)
7+
![GitHub Repo stars](https://img.shields.io/github/stars/forge42dev/react-router-devtools?style=social)
8+
![npm](https://img.shields.io/npm/v/react-router-devtools?style=plastic)
9+
![GitHub](https://img.shields.io/github/license/forge42dev/react-router-devtools?style=plastic)
10+
![npm](https://img.shields.io/npm/dy/react-router-devtools?style=plastic)
11+
![npm](https://img.shields.io/npm/dw/react-router-devtools?style=plastic)
12+
![GitHub top language](https://img.shields.io/github/languages/top/forge42dev/react-router-devtools?style=plastic)
1313

14-
Remix Development Tools is an open-source package designed to enhance your development workflow when working with Remix, a full-stack JavaScript framework for building web applications. This package provides a user-friendly interface consisting of three tabs, **Active Page**, **Terminal**, **Settings**, **Errors** and **Routes**, along with a side tab called **Timeline**. With Remix Development Tools, you can efficiently monitor and manage various aspects of your Remix projects, including page information, URL parameters, server responses, loader data, routes, and more. You can
15-
also track down hydration issues with the **Errors** tab and view your routes in a tree/list view with the **Routes** tab.
14+
react-router-devtools is an open-source package designed to enhance your development workflow when working with React Router v7+, a full-stack JavaScript framework for building web applications. This package provides a user-friendly interface consisting of three tabs, **Active Page**, **Terminal**, **Settings**, **Errors**, **Network** and **Routes**, along with a side tab called **Timeline**. With react-router-devtools, you can efficiently monitor and manage various aspects of your React Router v7+ projects, including page information, URL parameters, server responses, loader data, routes, and more.
1615

17-
# Documentation
1816

19-
Detailed documentation can be found here:
17+
You can also track down hydration issues with the **Errors** tab and view your routes in a tree/list view with the **Routes** tab.
2018

21-
https://remix-development-tools.fly.dev/
2219

20+
**Network** tab is a powerful tool for tracing all your network requests and see what's happening under the hood. You can see all the requests in real-time, with the ability to see if they are aborted, if they are cached, and if they are successful or not.
21+
22+
### Remix Development Tools
23+
24+
This repository used to be called remix-development-tools, but we decided to rename it to react-router-devtools to better reflect the fact that it's a package for React Router v7+ and not just for Remix.
25+
26+
If you're looking for the old version of this package, you can find it [here](https://github.com/forge42dev/Remix-Dev-Tools/tree/remix-development-tools).
2327

24-
# Deprecation warning!
28+
And the detailed documentation can be found [here](https://remix-development-tools.fly.dev/).
2529

26-
Huge news! The remix-development-tools will be turning into react-router-devtools once the stable release of react-router 7 is out! As you already might've heard remix is being merged into react-router, so naturally these devtools are going to be supporting react-router users rather than remix users!
30+
# Documentation
31+
32+
Detailed documentation can be found here:
33+
34+
https://remix-development-tools.fly.dev/
2735

28-
We are looking forward to expanding the scope of our users to a much broader audience and helping even more projects. When it comes to remix-development-tools all the updates will be coming out regularly until the official release of react-router v7 where this package will be rebranded with the same feature set.
2936

3037
## Getting Started
3138

3239
1. Install the package via npm:
3340

3441
```bash
35-
npm install remix-development-tools -D
42+
npm install react-router-devtools -D
3643
```
3744

3845
```js
39-
import { remixDevTools } from "remix-development-tools";
46+
import { reactRouterDevTools } from "react-router-devtools";
4047

4148
// Add it to your plugins array in vite.config.js
4249
export default defineConfig({
43-
plugins: [remixDevTools(), remix(), tsconfigPaths()],
50+
plugins: [reactRouterDevTools(), reactRouter(), tsconfigPaths()],
4451
});
4552
```
4653

@@ -49,17 +56,17 @@ That's it, you're done!
4956

5057
## Support
5158

52-
If you like Remix Development Tools consider starring the repository. If you have any questions, comments, or suggestions, please feel free to reach out!
59+
If you like react-router-devtools consider starring the repository or donating via Github sponsors. If you have any questions, comments, or suggestions, please feel free to reach out!
5360

5461
## License
5562

56-
Remix Development Tools is open-source software released under the [MIT License](https://opensource.org/licenses/MIT).
63+
react-router-devtools is open-source software released under the [MIT License](https://opensource.org/licenses/MIT).
5764

5865
## Acknowledgments
5966

60-
Remix Development Tools was inspired by the Remix framework and aims to enhance the development experience for Remix users.
67+
React Router Devtools was inspired by the React Router v7 and aims to enhance the development experience for React Router v7+ users.
6168

62-
Feel free to explore Remix Development Tools, and we hope it significantly improves your Remix development process. If you encounter any issues or have suggestions for enhancements, please don't hesitate to open an issue on our GitHub repository. Happy Remixing!
69+
Feel free to explore React Router Devtools, and we hope it significantly improves your React Router development process. If you encounter any issues or have suggestions for enhancements, please don't hesitate to open an issue on our GitHub repository. Happy Remixing!
6370

6471
## Thanks
6572

biome.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"lineWidth": 120
1515
},
1616
"files": {
17-
"ignore": ["test-apps/**", "docs/**", "./src/external/**", "./plugins/**", "./src/input.css"]
17+
"ignore": ["test-apps/**", "docs/**", "./src/external/**", "./plugins/**", "./src/input.css", "./src/gradients.css"]
1818
},
1919
"organizeImports": {
2020
"enabled": true
@@ -28,7 +28,9 @@
2828
"noExplicitAny": "off",
2929
"noConsole": {
3030
"level": "error",
31-
"options": { "allow": ["assert", "error", "info", "warn"] }
31+
"options": {
32+
"allow": ["assert", "error", "info", "warn"]
33+
}
3234
}
3335
},
3436
"style": {

docs/.eslintrc.cjs

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

docs/Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
# syntax = docker/dockerfile:1
1+
# syntax = docker/dockerfile:1.4
22

33
# Adjust NODE_VERSION as desired
4-
ARG NODE_VERSION=20.10.0
5-
FROM node:${NODE_VERSION}-slim as base
4+
ARG NODE_VERSION=22
5+
FROM node:${NODE_VERSION}-slim AS base
66

7-
LABEL fly_launch_runtime="Remix"
8-
9-
# Remix app lives here
7+
# React router app lives here
108
WORKDIR /app
119

1210
# Set production environment
@@ -42,4 +40,4 @@ COPY --from=build / /
4240

4341
# Start the server by default, this can be overwritten at runtime
4442
EXPOSE 3000
45-
CMD [ "node_modules/.bin/remix-serve", "./build/server/index.js" ]
43+
CMD [ "node_modules/.bin/react-router-serve", "./build/server/index.js" ]

docs/app/components/ClientHint.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { useRevalidator } from '@remix-run/react'
1+
22
import { useEffect } from 'react'
3+
import { useRevalidator } from 'react-router'
34

45
const clientHints = {
56
theme: {

docs/app/components/ThemeSwitcher.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
import { useFetcher } from '@remix-run/react'
1+
22
import { MoonIcon, SunIcon } from 'lucide-react'
33
import { useRef } from 'react'
4+
import { useFetcher } from 'react-router'
45

56
import { useTheme } from '~/hooks/useTheme'
67

7-
export const RemixPWAThemeSwitcher = () => {
8+
export const PWAThemeSwitcher = () => {
89
const fetcher = useFetcher()
910
const theme = useTheme()
1011
const ref = useRef<HTMLButtonElement>(null)

docs/app/components/layout/Documentation.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import { Link, useRouteLoaderData } from '@remix-run/react'
1+
22
import { Fragment, useMemo, useRef } from 'react'
33
import { getMDXComponent, getMDXExport } from 'mdx-bundler/client'
44
import clsx from 'clsx'
55
import redent from 'redent'
66
import type { MouseEvent } from 'react'
77

8-
import { RemixPWAInfo as Info } from '~/components/plugins/Info'
9-
import { RemixPWAWarn as Warn } from '~/components/plugins/Warn'
8+
import { PWAInfo as Info } from '~/components/plugins/Info'
9+
import { PWAWarn as Warn } from '~/components/plugins/Warn'
1010
import SnippetGroup from '~/components/plugins/Snippet'
1111
import Editor from '~/components/plugins/Editor'
1212
import Heading from '~/components/plugins/Heading'
1313
import { useTableOfContents } from '~/hooks/useTableOfContents'
1414
import { BackgroundGradient } from '../ui/background-gradient'
15+
import { Link, useRouteLoaderData } from 'react-router'
1516

1617
export function Documentation({
1718
route = 'routes/docs.$tag.$slug',
@@ -117,7 +118,7 @@ export function Documentation({
117118
</dt>
118119
<dd className="mt-1">
119120
<Link
120-
unstable_viewTransition
121+
viewTransition
121122
className="text-base font-semibold text-slate-500 hover:text-slate-600 dark:text-slate-400 dark:hover:text-slate-300"
122123
to={`/docs/${tag}/${prev.slug}`}
123124
prefetch="intent"
@@ -138,7 +139,7 @@ export function Documentation({
138139
className="text-base font-semibold text-slate-500 hover:text-slate-600 dark:text-slate-400 dark:hover:text-slate-300"
139140
to={`/docs/${tag}/${next.slug}`}
140141
prefetch="intent"
141-
unstable_viewTransition
142+
viewTransition
142143
>
143144
{next.alternateTitle ?? next.title}
144145
{/* */}&nbsp;<span aria-hidden="true"></span>

0 commit comments

Comments
 (0)