@react-router/node 7.7.1 → 7.8.0-pre.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # `@react-router/node`
2
2
 
3
+ ## 7.8.0-pre.0
4
+
5
+ ### Patch Changes
6
+
7
+ - [UNSTABLE] Change `getLoadContext` signature (`type GetLoadContextFunction`) when `future.unstable_middleware` is enabled so that it returns an `unstable_RouterContextProvider` instance instead of a `Map` used to contruct the instance internally ([#14097](https://github.com/remix-run/react-router/pull/14097))
8
+ - This also removes the `type unstable_InitialContext` export
9
+ - ⚠️ This is a breaking change if you have adopted middleware and are using a custom server with a `getLoadContext` function
10
+
11
+ - Updated dependencies:
12
+ - `react-router@7.8.0-pre.0`
13
+
3
14
  ## 7.7.1
4
15
 
5
16
  ### Patch Changes
@@ -162,7 +173,6 @@
162
173
  - Remove single fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522))
163
174
 
164
175
  - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837))
165
-
166
176
  - `createCookie`
167
177
  - `createCookieSessionStorage`
168
178
  - `createMemorySessionStorage`
@@ -171,7 +181,6 @@
171
181
  For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html)
172
182
 
173
183
  Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed:
174
-
175
184
  - `createCookieFactory`
176
185
  - `createSessionStorageFactory`
177
186
  - `createCookieSessionStorageFactory`
@@ -579,12 +588,10 @@
579
588
  - Introduces the `defer()` API from `@remix-run/router` with support for server-rendering and HTTP streaming. This utility allows you to defer values returned from `loader` functions by returning promises instead of resolved values. This has been refered to as _"sending a promise over the wire"_. ([#4920](https://github.com/remix-run/remix/pull/4920))
580
589
 
581
590
  Informational Resources:
582
-
583
591
  - <https://gist.github.com/jacob-ebey/9bde9546c1aafaa6bc8c242054b1be26>
584
592
  - <https://github.com/remix-run/remix/blob/main/decisions/0004-streaming-apis.md>
585
593
 
586
594
  Documentation Resources (better docs specific to Remix are in the works):
587
-
588
595
  - <https://reactrouter.com/en/main/utils/defer>
589
596
  - <https://reactrouter.com/en/main/components/await>
590
597
  - <https://reactrouter.com/en/main/hooks/use-async-value>
package/dist/index.d.mts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { RequestListener } from 'node:http';
2
- import { ServerBuild, UNSAFE_MiddlewareEnabled, unstable_InitialContext, AppLoadContext, SessionData, SessionIdStorageStrategy, SessionStorage } from 'react-router';
2
+ import { ServerBuild, UNSAFE_MiddlewareEnabled, unstable_RouterContextProvider, AppLoadContext, SessionData, SessionIdStorageStrategy, SessionStorage } from 'react-router';
3
3
  import { ClientAddress } from '@mjackson/node-fetch-server';
4
4
  import { Readable, Writable } from 'node:stream';
5
5
 
6
6
  type MaybePromise<T> = T | Promise<T>;
7
7
  interface RequestListenerOptions {
8
8
  build: ServerBuild | (() => ServerBuild | Promise<ServerBuild>);
9
- getLoadContext?: (request: Request, client: ClientAddress) => UNSAFE_MiddlewareEnabled extends true ? MaybePromise<unstable_InitialContext> : MaybePromise<AppLoadContext>;
9
+ getLoadContext?: (request: Request, client: ClientAddress) => UNSAFE_MiddlewareEnabled extends true ? MaybePromise<unstable_RouterContextProvider> : MaybePromise<AppLoadContext>;
10
10
  mode?: string;
11
11
  }
12
12
  /**
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { RequestListener } from 'node:http';
2
- import { ServerBuild, UNSAFE_MiddlewareEnabled, unstable_InitialContext, AppLoadContext, SessionData, SessionIdStorageStrategy, SessionStorage } from 'react-router';
2
+ import { ServerBuild, UNSAFE_MiddlewareEnabled, unstable_RouterContextProvider, AppLoadContext, SessionData, SessionIdStorageStrategy, SessionStorage } from 'react-router';
3
3
  import { ClientAddress } from '@mjackson/node-fetch-server';
4
4
  import { Readable, Writable } from 'node:stream';
5
5
 
6
6
  type MaybePromise<T> = T | Promise<T>;
7
7
  interface RequestListenerOptions {
8
8
  build: ServerBuild | (() => ServerBuild | Promise<ServerBuild>);
9
- getLoadContext?: (request: Request, client: ClientAddress) => UNSAFE_MiddlewareEnabled extends true ? MaybePromise<unstable_InitialContext> : MaybePromise<AppLoadContext>;
9
+ getLoadContext?: (request: Request, client: ClientAddress) => UNSAFE_MiddlewareEnabled extends true ? MaybePromise<unstable_RouterContextProvider> : MaybePromise<AppLoadContext>;
10
10
  mode?: string;
11
11
  }
12
12
  /**
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/node v7.7.1
2
+ * @react-router/node v7.8.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @react-router/node v7.7.1
2
+ * @react-router/node v7.8.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-router/node",
3
- "version": "7.7.1",
3
+ "version": "7.8.0-pre.0",
4
4
  "description": "Node.js platform abstractions for React Router",
5
5
  "bugs": {
6
6
  "url": "https://github.com/remix-run/react-router/issues"
@@ -52,11 +52,11 @@
52
52
  "tsup": "^8.3.0",
53
53
  "typescript": "^5.1.6",
54
54
  "wireit": "0.14.9",
55
- "react-router": "7.7.1"
55
+ "react-router": "7.8.0-pre.0"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "typescript": "^5.1.0",
59
- "react-router": "7.7.1"
59
+ "react-router": "7.8.0-pre.0"
60
60
  },
61
61
  "peerDependenciesMeta": {
62
62
  "typescript": {