Skip to content

Commit fa97936

Browse files
authored
Update Docusaurus to v3 (#4774)
* Update Docusaurus packages * Rename DS config file * Update DS config file to TS syntax * Add DS faster package * Only transpile codeblocks in CI * Enable "faster" build tools * Fix broken anchor links * Update DS + TS config to speed up TS compilation * Build RTK so types are available * Fix more broken anchors * Fix revert of remark-ts-tools * Convert sidebars file to TS * Use remark-ts-tools 2.0
1 parent 4f3bc9f commit fa97936

19 files changed

+2280
-1901
lines changed

docs/api/createAsyncThunk.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ An object with the following optional fields:
108108

109109
- `condition(arg, { getState, extra } ): boolean | Promise<boolean>`: a callback that can be used to skip execution of the payload creator and all action dispatches, if desired. See [Canceling Before Execution](#canceling-before-execution) for a complete description.
110110
- `dispatchConditionRejection`: if `condition()` returns `false`, the default behavior is that no actions will be dispatched at all. If you still want a "rejected" action to be dispatched when the thunk was canceled, set this flag to `true`.
111-
- `idGenerator(arg): string`: a function to use when generating the `requestId` for the request sequence. Defaults to use [nanoid](./otherExports.mdx/#nanoid), but you can implement your own ID generation logic.
111+
- `idGenerator(arg): string`: a function to use when generating the `requestId` for the request sequence. Defaults to use [nanoid](./otherExports.mdx#nanoid), but you can implement your own ID generation logic.
112112
- `serializeError(error: unknown) => any` to replace the internal `miniSerializeError` method with your own serialization logic.
113113
- `getPendingMeta({ arg, requestId }, { getState, extra }): any`: a function to create an object that will be merged into the `pendingAction.meta` field.
114114

docs/api/createEntityAdapter.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ const globalizedSelectors = booksAdapter.getSelectors((state) => state.books, {
341341
})
342342
```
343343

344-
If no instance is passed, it will default to [`createDraftSafeSelector`](./createSelector#createDraftSafeSelector).
344+
If no instance is passed, it will default to [`createDraftSafeSelector`](./createSelector.mdx#createdraftsafeselector).
345345

346346
:::
347347

docs/api/createSlice.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ As a result, there are two ways of getting final selectors:
498498

499499
#### `selectors`
500500

501-
Most commonly, the slice is reliably mounted under its [`reducerPath`](#reducerPath).
501+
Most commonly, the slice is reliably mounted under its [`reducerPath`](#reducerpath).
502502

503503
Following this, the slice has a `selectSlice` selector attached, which assumes that the slice is located under `rootState[slice.reducerPath]`.
504504

docs/rtk-query/api/createApi.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export type QueryReturnValue<T = unknown, E = unknown, M = unknown> =
144144
145145
[summary](docblock://query/createApi.ts?token=CreateApiOptions.endpoints)
146146
147-
See [Anatomy of an endpoint](#anatomy-of-an-endpoint) for details on individual properties.
147+
See [Endpoint Definition Parameters](#endpoint-definition-parameters) for details on individual properties.
148148
149149
#### Query endpoint definition
150150

docs/rtk-query/internal/buildMiddleware/invalidationByTags.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const handler: ApiMiddlewareInternalHandler = (action, mwApi) => {
6363
1. `invalidateTags()` initiates:
6464
1. invalidateTags function is called with a list of tags generated from the action metadata
6565
2. in the case of a [queryThunk] resolution an empty set of tags is always provided
66-
2. The tags calculated are added to the list of pending tags to invalidate (see [delayed](#Delayed))
66+
2. The tags calculated are added to the list of pending tags to invalidate (see [delayed](#delayed))
6767
3. (optional: 'Delayed') the invalidateTags function is ended if the `apiSlice.invalidationBehavior` is set to "delayed" and there are any pending thunks/queries running in that `apiSlice`
6868
4. Pending tags are reset to an empty list, if there are no tags the function ends here
6969
5. Selects all `{ endpointName, originalArgs, queryCacheKey }` combinations that would be invalidated by a specific set of tags.

docs/rtk-query/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export default function App() {
179179

180180
## Further Information
181181

182-
See the [**RTK Query Quick Start tutorial**](../tutorials/rtk-query.mdx/) for examples of how to add RTK Query to a project that uses Redux Toolkit, set up an "API slice" with endpoint definitions, and how to use the auto-generated React hooks in your components.
182+
See the [**RTK Query Quick Start tutorial**](../tutorials/rtk-query.mdx) for examples of how to add RTK Query to a project that uses Redux Toolkit, set up an "API slice" with endpoint definitions, and how to use the auto-generated React hooks in your components.
183183

184184
The [**RTK Query usage guide section**](./usage/queries.mdx) has information on topics like [querying data](./usage/queries.mdx), [using mutations to send updates to the server](./usage/mutations.mdx), [streaming cache updates](./usage/streaming-updates.mdx), and much more.
185185

docs/rtk-query/usage-with-typescript.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ function MaybePost({ id }: { id?: number }) {
527527

528528
## Type safe error handling
529529

530-
When an error is gracefully provided from a [`base query`](./api/createApi.mdx#baseQuery), RTK query will provide the error
530+
When an error is gracefully provided from a [`base query`](./api/createApi.mdx#basequery), RTK query will provide the error
531531
directly. If an unexpected error is thrown by user code rather than a handled error,
532532
that error will be transformed into a `SerializedError` shape. Users should make sure that they are checking which kind of error they are dealing with before attempting to access its properties. This can be done in a type safe manner either
533533
by using a type guard, e.g. by checking for [discriminated properties](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#the-in-operator-narrowing),
@@ -613,7 +613,7 @@ function PostDetail() {
613613
<div>{errMsg}</div>
614614
</div>
615615
)
616-
}
616+
}
617617
// you can access all properties of `SerializedError` here
618618
return <div>{error.message}</div>
619619
}

docs/rtk-query/usage/cache-behavior.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ The Redux docs have always recommended [keeping data in a normalized lookup tabl
403403
404404
There are a couple additional points that can help here:
405405
406-
- The generated query hooks have [a `selectFromResult` option](../api/created-api/hooks.mdx#selectfromresult) that allow components to read individual pieces of data from a query result. As an example, a `<TodoList>` component might call `useTodosQuery()`, and each individual `<TodoListItem>` could use the same query hook but select from the result to get the right todo object.
406+
- The generated query hooks have [a `selectFromResult` option](../api/created-api/hooks.mdx#usequery) that allow components to read individual pieces of data from a query result. As an example, a `<TodoList>` component might call `useTodosQuery()`, and each individual `<TodoListItem>` could use the same query hook but select from the result to get the right todo object.
407407
- You can use the [`transformResponse` endpoint option](../api/createApi.mdx#transformresponse) to modify the fetched data so that it's [stored in a different shape](./customizing-queries.mdx#customizing-query-responses-with-transformresponse), such as using `createEntityAdapter` to normalize the data _for this one response_ before it's inserted into the cache.
408408
409409
### Further information

docs/rtk-query/usage/customizing-queries.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ import type {
690690
FetchArgs,
691691
FetchBaseQueryError,
692692
} from '@reduxjs/toolkit/query'
693-
import type { FetchBaseQueryMeta } from '@reduxjs/toolkit/dist/query/fetchBaseQuery'
693+
import type { FetchBaseQueryMeta } from '@reduxjs/toolkit/query'
694694
import { uuid } from './idGenerator'
695695

696696
// highlight-start
@@ -980,7 +980,7 @@ You could also try creating a custom base query that uses the SDK, and define en
980980

981981
In certain scenarios, you may wish to have a `query` or `mutation` where sending a request or returning data is not relevant for the situation. Such a scenario would be to leverage the `invalidatesTags` property to force re-fetch specific `tags` that have been provided to the cache.
982982

983-
See also [`providing errors to the cache`](./automated-refetching.mdx#providing-data-to-the-cache) to see additional detail and an example for such a scenario to 'refetch errored queries'.
983+
See also ["providing errors to the cache"](./automated-refetching.mdx#providing-errors-to-the-cache) to see additional detail and an example for such a scenario to 'refetch errored queries'.
984984

985985
```ts title="Using a no-op queryFn"
986986
// file: types.ts noEmit

docs/rtk-query/usage/error-handling.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ There are quite a few ways that you can manage your errors, and in some cases, y
7676

7777
:::tip
7878

79-
Redux Toolkit has [action matching utilities](../../api/matching-utilities.mdx#matching-utilities) that we can leverage for additional custom behaviors.
79+
Redux Toolkit has [action matching utilities](../../api/matching-utilities.mdx) that we can leverage for additional custom behaviors.
8080

8181
:::
8282

0 commit comments

Comments
 (0)