react-router 7.0.0-pre.1 → 7.0.0-pre.2

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/dom-export.mjs +10 -2
  3. package/dist/dom-export.mjs.map +1 -1
  4. package/dist/index.d.ts +2 -3
  5. package/dist/index.mjs +1375 -219
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/lib/components.d.ts +6 -6
  8. package/dist/lib/dom/lib.d.ts +3 -2
  9. package/dist/lib/dom/ssr/components.d.ts +0 -1
  10. package/dist/lib/dom/ssr/data.d.ts +0 -5
  11. package/dist/lib/dom/ssr/entry.d.ts +2 -1
  12. package/dist/lib/dom/ssr/routeModules.d.ts +64 -22
  13. package/dist/lib/dom/ssr/routes.d.ts +2 -5
  14. package/dist/lib/hooks.d.ts +4 -3
  15. package/dist/lib/router/router.d.ts +4 -0
  16. package/dist/lib/router/utils.d.ts +1 -9
  17. package/dist/lib/server-runtime/build.d.ts +1 -1
  18. package/dist/lib/server-runtime/cookies.d.ts +5 -5
  19. package/dist/lib/server-runtime/data.d.ts +1 -5
  20. package/dist/lib/server-runtime/routeModules.d.ts +3 -175
  21. package/dist/lib/server-runtime/routes.d.ts +2 -22
  22. package/dist/lib/server-runtime/sessions.d.ts +4 -4
  23. package/dist/lib/types.d.ts +17 -10
  24. package/dist/lib/types.mjs +1 -1
  25. package/dist/main-dom-export.js +1 -1
  26. package/dist/main.js +1 -1
  27. package/dist/react-router-dom.development.js +2 -2
  28. package/dist/react-router-dom.development.js.map +1 -1
  29. package/dist/react-router-dom.production.min.js +2 -2
  30. package/dist/react-router-dom.production.min.js.map +1 -1
  31. package/dist/react-router.development.js +196 -171
  32. package/dist/react-router.development.js.map +1 -1
  33. package/dist/react-router.production.min.js +2 -2
  34. package/dist/react-router.production.min.js.map +1 -1
  35. package/dist/umd/react-router-dom.development.js +2 -2
  36. package/dist/umd/react-router-dom.development.js.map +1 -1
  37. package/dist/umd/react-router-dom.production.min.js +2 -2
  38. package/dist/umd/react-router-dom.production.min.js.map +1 -1
  39. package/dist/umd/react-router.development.js +195 -179
  40. package/dist/umd/react-router.development.js.map +1 -1
  41. package/dist/umd/react-router.production.min.js +2 -2
  42. package/dist/umd/react-router.production.min.js.map +1 -1
  43. package/package.json +4 -4
  44. package/dist/lib/server-runtime/jsonify.d.ts +0 -33
  45. package/dist/lib/server-runtime/responses.d.ts +0 -37
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-router",
3
- "version": "7.0.0-pre.1",
3
+ "version": "7.0.0-pre.2",
4
4
  "description": "Declarative routing for React",
5
5
  "keywords": [
6
6
  "react",
@@ -41,11 +41,11 @@
41
41
  "dependencies": {
42
42
  "@types/cookie": "^0.6.0",
43
43
  "@web3-storage/multipart-parser": "^1.0.0",
44
- "cookie": "^0.6.0",
44
+ "cookie": "^1.0.1",
45
45
  "set-cookie-parser": "^2.6.0",
46
46
  "source-map": "^0.7.3",
47
47
  "turbo-stream": "2.4.0",
48
- "react-router": "7.0.0-pre.1"
48
+ "react-router": "7.0.0-pre.2"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/set-cookie-parser": "^2.4.1",
@@ -68,6 +68,6 @@
68
68
  "README.md"
69
69
  ],
70
70
  "engines": {
71
- "node": ">=18.0.0"
71
+ "node": ">=20.0.0"
72
72
  }
73
73
  }
@@ -1,33 +0,0 @@
1
- export type Jsonify<T> = IsAny<T> extends true ? any : T extends {
2
- toJSON(): infer U;
3
- } ? (U extends JsonValue ? U : unknown) : T extends JsonPrimitive ? T : T extends String ? string : T extends Number ? number : T extends Boolean ? boolean : T extends Promise<unknown> ? EmptyObject : T extends Map<unknown, unknown> ? EmptyObject : T extends Set<unknown> ? EmptyObject : T extends TypedArray ? Record<string, number> : T extends NotJson ? never : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [NeverToNull<Jsonify<F>>, ...Jsonify<R>] : T extends readonly unknown[] ? Array<NeverToNull<Jsonify<T[number]>>> : T extends Record<keyof unknown, unknown> ? JsonifyObject<T> : unknown extends T ? unknown : never;
4
- type ValueIsNotJson<T> = T extends NotJson ? true : false;
5
- type IsNotJson<T> = {
6
- [K in keyof T]-?: ValueIsNotJson<T[K]>;
7
- };
8
- type JsonifyValues<T> = {
9
- [K in keyof T]: Jsonify<T[K]>;
10
- };
11
- type JsonifyObject<T extends Record<keyof unknown, unknown>> = {
12
- [K in keyof T as unknown extends T[K] ? never : IsNotJson<T>[K] extends false ? K : never]: JsonifyValues<T>[K];
13
- } & {
14
- [K in keyof T as unknown extends T[K] ? K : IsNotJson<T>[K] extends false ? never : IsNotJson<T>[K] extends true ? never : K]?: JsonifyValues<T>[K];
15
- };
16
- type JsonPrimitive = string | number | boolean | null;
17
- type JsonArray = JsonValue[] | readonly JsonValue[];
18
- type JsonObject = {
19
- [K in string]: JsonValue;
20
- } & {
21
- [K in string]?: JsonValue;
22
- };
23
- type JsonValue = JsonPrimitive | JsonObject | JsonArray;
24
- type NotJson = undefined | symbol | AnyFunction;
25
- type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
26
- type AnyFunction = (...args: any[]) => unknown;
27
- type NeverToNull<T> = [T] extends [never] ? null : T;
28
- declare const emptyObjectSymbol: unique symbol;
29
- export type EmptyObject = {
30
- [emptyObjectSymbol]?: never;
31
- };
32
- type IsAny<T> = 0 extends 1 & T ? true : false;
33
- export {};
@@ -1,37 +0,0 @@
1
- export type JsonFunction = <Data>(data: Data, init?: number | ResponseInit) => TypedResponse<Data>;
2
- export type TypedResponse<T = unknown> = Omit<Response, "json"> & {
3
- json(): Promise<T>;
4
- };
5
- /**
6
- * This is a shortcut for creating `application/json` responses. Converts `data`
7
- * to JSON and sets the `Content-Type` header.
8
- *
9
- * @see https://remix.run/utils/json
10
- */
11
- export declare const json: JsonFunction;
12
- export type RedirectFunction = (url: string, init?: number | ResponseInit) => TypedResponse<never>;
13
- /**
14
- * A redirect response. Sets the status code and the `Location` header.
15
- * Defaults to "302 Found".
16
- *
17
- * @see https://remix.run/utils/redirect
18
- */
19
- export declare const redirect: RedirectFunction;
20
- /**
21
- * A redirect response that will force a document reload to the new location.
22
- * Sets the status code and the `Location` header.
23
- * Defaults to "302 Found".
24
- *
25
- * @see https://remix.run/utils/redirect
26
- */
27
- export declare const redirectDocument: RedirectFunction;
28
- /**
29
- * A redirect response. Sets the status code and the `Location` header.
30
- * Defaults to "302 Found".
31
- *
32
- * @see https://remix.run/utils/redirect
33
- */
34
- export declare const replace: RedirectFunction;
35
- export declare function isResponse(value: any): value is Response;
36
- export declare function isRedirectStatusCode(statusCode: number): boolean;
37
- export declare function isRedirectResponse(response: Response): boolean;