Skip to content

Upgrade prettier #13916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ worker-configuration.d.ts
/playground-local/
integration/helpers/**/dist/
integration/helpers/**/build/
# Temporary until we can get prettier upgraded to support `import ... with` syntax
integration/helpers/rsc-parcel/src/server.tsx
playwright-report/
test-results/
build.utils.d.ts
Expand Down
6 changes: 0 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ Date: 2025-06-27
### Patch Changes

- `react-router` - Do not serialize types for `useRouteLoaderData<typeof clientLoader>` ([#13752](https://github.com/remix-run/react-router/pull/13752))

- For types to distinguish a `clientLoader` from a `serverLoader`, you MUST annotate `clientLoader` args:

```ts
Expand Down Expand Up @@ -449,7 +448,6 @@ Date: 2025-05-25
- `@react-router/dev` - Add additional logging to `build` command output when cleaning assets from server build ([#13547](https://github.com/remix-run/react-router/pull/13547))
- `@react-router/dev` - Don't clean assets from server build when `build.ssrEmitAssets` has been enabled in Vite config ([#13547](https://github.com/remix-run/react-router/pull/13547))
- `@react-router/dev` - Fix typegen when same route is used at multiple paths ([#13574](https://github.com/remix-run/react-router/pull/13574))

- For example, `routes/route.tsx` is used at 4 different paths here:

```ts
Expand All @@ -468,7 +466,6 @@ Date: 2025-05-25
- Now, typegen creates unions as necessary for alternate paths for the same route file

- `@react-router/dev` - Better types for `params` ([#13543](https://github.com/remix-run/react-router/pull/13543))

- For example:

```ts
Expand Down Expand Up @@ -515,7 +512,6 @@ Date: 2025-05-25
```

- `@react-router/dev` - Fix `href` for optional segments ([#13595](https://github.com/remix-run/react-router/pull/13595))

- Type generation now expands paths with optionals into their corresponding non-optional paths
- For example, the path `/user/:id?` gets expanded into `/user` and `/user/:id` to more closely model visitable URLs
- `href` then uses these expanded (non-optional) paths to construct type-safe paths for your app:
Expand Down Expand Up @@ -623,7 +619,6 @@ Behind the scenes, React Router will generate the corresponding `declare module`

- `react-router` - Added a new `routeDiscovery` option in `react-router.config.ts` to configure Lazy Route Discovery behavior ([#13451](https://github.com/remix-run/react-router/pull/13451))
- `react-router` - Add support for route component props in `createRoutesStub` ([#13528](https://github.com/remix-run/react-router/pull/13528))

- This allows you to unit test your route components using the props instead of the hooks:

```tsx
Expand Down Expand Up @@ -742,7 +737,6 @@ Date: 2025-04-17
### Patch Changes

- `react-router` - When using the object-based `route.lazy` API, the `HydrateFallback` and `hydrateFallbackElement` properties are now skipped when lazy loading routes after hydration ([#13376](https://github.com/remix-run/react-router/pull/13376))

- If you move the code for these properties into a separate file, since the hydrate properties were unused already (if the route wasn't present during hydration), you can avoid downloading them at all. For example:

```ts
Expand Down
1 change: 1 addition & 0 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
React Router has been around since 2014 largely under the development and oversight of [Michael Jackson](https://x.com/mjackson) and [Ryan Florence](https://x.com/ryanflorence). After the launch of [Remix](https://remix.run/) in 2021, the subsequent creation of the Remix team, and the merging of Remix v2 into React Router v7[^1][^2], the project shifted from a [Founder-Leader](https://www.redhat.com/en/blog/understanding-open-source-governance-models) model to a "Steering Committee" (SC) model that operates on a Request for Comments (RFC) process.

[^1]: https://remix.run/blog/merging-remix-and-react-router

[^2]: https://remix.run/blog/incremental-path-to-react-19

This document will outline the process in which React Router will continue to evolve and how new features will make their way into the codebase. This is an evergreen document and will be updated as needed to reflect future changes in the process.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Checking for `.server` modules only requires checking the module's path and does
`vite-env-only` does require AST parsing and transformations so it will always be slower than `.server` modules.

[^1]: Vite provides a lower-level module graph API, but the module graph is not guaranteed to be complete as it is only populated as modules are requested.

[^2]: When a file changes on disk, Vite invalidates the corresponding module in its cache to power features like HMR.

[decision-0009]: ./0009-do-not-rely-on-treeshaking-for-correctness.md
Expand Down
2 changes: 0 additions & 2 deletions docs/explanation/state-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ React Router seamlessly bridges the gap between the backend and frontend via mec
Here's why using typical React state patterns might be an anti-pattern in React Router:

1. **Network-related State:** If your React state is managing anything related to the network—such as data from loaders, pending form submissions, or navigational states—it's likely that you're managing state that React Router already manages:

- **[`useNavigation`][use_navigation]**: This hook gives you access to `navigation.state`, `navigation.formData`, `navigation.location`, etc.
- **[`useFetcher`][use_fetcher]**: This facilitates interaction with `fetcher.state`, `fetcher.formData`, `fetcher.data` etc.
- **[`loaderData`][loader_data]**: Access the data for a route.
- **[`actionData`][action_data]**: Access the data from the latest action.

2. **Storing Data in React Router:** A lot of data that developers might be tempted to store in React state has a more natural home in React Router, such as:

- **URL Search Params:** Parameters within the URL that hold state.
- **[Cookies][cookies]:** Small pieces of data stored on the user's device.
- **[Server Sessions][sessions]:** Server-managed user sessions.
Expand Down
29 changes: 19 additions & 10 deletions docs/start/rsc/parcel.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,13 @@ function fetchServer(request: Request) {
routes: routes(),
// Encode the match with the React Server implementation.
generateResponse(match) {
return new Response(renderToReadableStream(match.payload), {
status: match.statusCode,
headers: match.headers,
});
return new Response(
renderToReadableStream(match.payload),
{
status: match.statusCode,
headers: match.headers,
}
);
},
});
}
Expand All @@ -115,25 +118,31 @@ app.use(
app.use(compression(), express.static("public"));

// Ignore Chrome extension requests.
app.get("/.well-known/appspecific/com.chrome.devtools.json", (_, res) => {
res.status(404);
res.end();
});
app.get(
"/.well-known/appspecific/com.chrome.devtools.json",
(_, res) => {
res.status(404);
res.end();
}
);

// Hookup our application.
app.use(
createRequestListener((request) =>
prerender(
request,
fetchServer,
(routes as unknown as { bootstrapScript?: string }).bootstrapScript
(routes as unknown as { bootstrapScript?: string })
.bootstrapScript
)
)
);

const PORT = Number.parseInt(process.env.PORT || "3000");
app.listen(PORT, () => {
console.log(`Server listening on port ${PORT} (http://localhost:${PORT})`);
console.log(
`Server listening on port ${PORT} (http://localhost:${PORT})`
);
});
```

Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/address-book.md
Original file line number Diff line number Diff line change
Expand Up @@ -1238,8 +1238,8 @@ export default function SidebarLayout({
isActive
? "active"
: isPending
? "pending"
: ""
? "pending"
: ""
}
to={`contacts/${contact.id}`}
>
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ First, as a convenience, add `dev` and `start` commands in `package.json` that w
{
"scripts": {
"dev": "node ./server.js",
"start": "cross-env NODE_ENV=production node ./server.js"
}
"start": "cross-env NODE_ENV=production node ./server.js",
},
// ...
}
```
Expand Down
2 changes: 1 addition & 1 deletion examples/auth-router-provider/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
10 changes: 5 additions & 5 deletions examples/auth-router-provider/src/index.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family:
source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}
2 changes: 1 addition & 1 deletion examples/auth/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
10 changes: 5 additions & 5 deletions examples/auth/src/index.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family:
source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}
2 changes: 1 addition & 1 deletion examples/basic-data-router/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
10 changes: 5 additions & 5 deletions examples/basic-data-router/src/index.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family:
source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}
2 changes: 1 addition & 1 deletion examples/basic/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
10 changes: 5 additions & 5 deletions examples/basic/src/index.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family:
source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}
2 changes: 1 addition & 1 deletion examples/custom-filter-link/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
10 changes: 5 additions & 5 deletions examples/custom-filter-link/src/index.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family:
source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}
2 changes: 1 addition & 1 deletion examples/custom-link/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
10 changes: 5 additions & 5 deletions examples/custom-link/src/index.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family:
source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}
2 changes: 1 addition & 1 deletion examples/custom-query-parsing/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
10 changes: 5 additions & 5 deletions examples/custom-query-parsing/src/index.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family:
source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}
2 changes: 1 addition & 1 deletion examples/data-router/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
10 changes: 5 additions & 5 deletions examples/data-router/src/index.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family:
source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
}
2 changes: 1 addition & 1 deletion examples/error-boundaries/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
10 changes: 5 additions & 5 deletions examples/error-boundaries/src/index.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
sans-serif;
font-family:
-apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
"Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
max-width: 600px;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
monospace;
font-family:
source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
background-color: #eee;
padding: 1px 3px;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/lazy-loading-router-provider/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
Loading
Loading