From ac99918a58927d3ea981d9dc8e1855cf76329f64 Mon Sep 17 00:00:00 2001 From: Iskander Broere Date: Wed, 23 Apr 2025 08:36:35 +0200 Subject: [PATCH 1/2] update session documentation links --- contributors.yml | 1 + docs/api/utils/isSession.md | 2 +- llm.txt | 2 +- .../__tests__/server-runtime/sessions-test.ts | 2 +- packages/react-router/lib/server-runtime/sessions.ts | 10 ++++------ 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/contributors.yml b/contributors.yml index 21f580c381..46fd53bfa9 100644 --- a/contributors.yml +++ b/contributors.yml @@ -139,6 +139,7 @@ - infoxicator - IsaiStormBlesed - Isammoc +- iskanderbroere - istarkov - ivanjeremic - ivanjonas diff --git a/docs/api/utils/isSession.md b/docs/api/utils/isSession.md index 709744f172..bc819f6fe4 100644 --- a/docs/api/utils/isSession.md +++ b/docs/api/utils/isSession.md @@ -10,4 +10,4 @@ title: isSession [Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.isSession.html) -Returns true if an object is a Remix session. +Returns true if an object is a React Router session. diff --git a/llm.txt b/llm.txt index 44b02307d7..5b3d9f7004 100644 --- a/llm.txt +++ b/llm.txt @@ -8223,7 +8223,7 @@ title: isSession [Reference Documentation ↗](https://api.reactrouter.com/v7/functions/react_router.isSession.html) -Returns true if an object is a Remix session. +Returns true if an object is a React Router session. --- title: Location hidden: true diff --git a/packages/react-router/__tests__/server-runtime/sessions-test.ts b/packages/react-router/__tests__/server-runtime/sessions-test.ts index 13e16644a3..d45a14a657 100644 --- a/packages/react-router/__tests__/server-runtime/sessions-test.ts +++ b/packages/react-router/__tests__/server-runtime/sessions-test.ts @@ -182,7 +182,7 @@ describe("Cookie session storage", () => { expect(spy.console).toHaveBeenCalledTimes(1); expect(spy.console).toHaveBeenCalledWith( - 'The "__session" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://remix.run/utils/cookies#signing-cookies for more information.' + 'The "__session" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies for more information.' ); }); }); diff --git a/packages/react-router/lib/server-runtime/sessions.ts b/packages/react-router/lib/server-runtime/sessions.ts index 8c38c8393e..1c29de5c99 100644 --- a/packages/react-router/lib/server-runtime/sessions.ts +++ b/packages/react-router/lib/server-runtime/sessions.ts @@ -14,7 +14,7 @@ export interface SessionData { /** * Session persists data across HTTP requests. * - * @see https://remix.run/utils/sessions#session-api + * @see https://reactrouter.com/explanation/sessions-and-cookies#sessions */ export interface Session { /** @@ -89,8 +89,6 @@ export type CreateSessionFunction = ( * * Note: This function is typically not invoked directly by application code. * Instead, use a `SessionStorage` object's `getSession` method. - * - * @see https://remix.run/utils/sessions#createsession */ export const createSession: CreateSessionFunction = < Data = SessionData, @@ -144,9 +142,9 @@ export const createSession: CreateSessionFunction = < export type IsSessionFunction = (object: any) => object is Session; /** - * Returns true if an object is a Remix session. + * Returns true if an object is a React Router session. * - * @see https://remix.run/utils/sessions#issession + * @see https://reactrouter.com/api/utils/isSession */ export const isSession: IsSessionFunction = (object): object is Session => { return ( @@ -303,7 +301,7 @@ export function warnOnceAboutSigningSessionCookie(cookie: Cookie) { cookie.isSigned, `The "${cookie.name}" cookie is not signed, but session cookies should be ` + `signed to prevent tampering on the client before they are sent back to the ` + - `server. See https://remix.run/utils/cookies#signing-cookies ` + + `server. See https://reactrouter.com/explanation/sessions-and-cookies#signing-cookies ` + `for more information.` ); } From 81f4c828392920eb455b367bf4d16d557c15ffc9 Mon Sep 17 00:00:00 2001 From: Iskander Broere Date: Wed, 23 Apr 2025 08:45:25 +0200 Subject: [PATCH 2/2] add changeset --- .changeset/plenty-hounds-heal.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/plenty-hounds-heal.md diff --git a/.changeset/plenty-hounds-heal.md b/.changeset/plenty-hounds-heal.md new file mode 100644 index 0000000000..cf1ebebac3 --- /dev/null +++ b/.changeset/plenty-hounds-heal.md @@ -0,0 +1,5 @@ +--- +"react-router": patch +--- + +update session documentation links