Skip to content

Commit

Permalink
feat!: remove unstable_shouldReload references (#5685)
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 authored and MichaelDeBoey committed Jul 9, 2023
1 parent 1bdc06a commit a5a78fb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 192 deletions.
5 changes: 5 additions & 0 deletions .changeset/remove-should-reload.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": major
---

Remove `unstable_shouldReload`, which has been replaced by `shouldRevalidate`
18 changes: 4 additions & 14 deletions docs/api/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,21 +190,13 @@ title: Conventions

[Moved →][moved-44]

### unstable_shouldReload
### shouldRevalidate

[Moved →][moved-45]

#### Never reloading the root

[Moved →][moved-46]

#### Ignoring search params

[Moved →][moved-47]

## Asset URL Imports

[Moved →][moved-48]
[Moved →][moved-46]

[moved]: ../file-conventions/remix-config
[moved-2]: ../file-conventions/remix-config#appdirectory
Expand Down Expand Up @@ -250,7 +242,5 @@ title: Conventions
[moved-42]: ../route/catch-boundary
[moved-43]: ../route/error-boundary
[moved-44]: ../route/handle
[moved-45]: ../route/should-reload
[moved-46]: ../route/should-reload#never-reloading-the-root
[moved-47]: ../route/should-reload#ignoring-search-params
[moved-48]: ../other-api/asset-imports
[moved-45]: ../route/should-revalidate
[moved-46]: ../other-api/asset-imports
154 changes: 0 additions & 154 deletions docs/route/should-reload.md

This file was deleted.

1 change: 0 additions & 1 deletion packages/remix-react/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export type {
V2_MetaDescriptor,
V2_MetaFunction,
RouteModules as UNSAFE_RouteModules,
ShouldReloadFunction,
} from "./routeModules";

export { ScrollRestoration } from "./scroll-restoration";
Expand Down
23 changes: 0 additions & 23 deletions packages/remix-react/routeModules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,26 +205,3 @@ export async function loadRouteModule(
});
}
}

/**
* @deprecated The `unstable_shouldReload` function has been removed, so this
* function will never run and route data will be revalidated on every request.
* Please update the function name to `shouldRevalidate` and use the
* `ShouldRevalidateFunction` interface.
*/
export interface ShouldReloadFunction {
(args: {
url: URL;
prevUrl: URL;
params: Params;
submission?: Submission;
}): boolean;
}

interface Submission {
action: string;
method: string;
formData: FormData;
encType: string;
key: string;
}

0 comments on commit a5a78fb

Please sign in to comment.