expo-router 5.1.2 → 5.2.0-canary-20250611-f0afe80

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 (54) hide show
  1. package/build/fork/getStateFromPath-forks.d.ts.map +1 -1
  2. package/build/fork/getStateFromPath-forks.js +1 -4
  3. package/build/fork/getStateFromPath-forks.js.map +1 -1
  4. package/build/getRoutes.d.ts +1 -1
  5. package/build/getRoutes.d.ts.map +1 -1
  6. package/build/getRoutes.js +6 -14
  7. package/build/getRoutes.js.map +1 -1
  8. package/build/getRoutesCore.d.ts +2 -7
  9. package/build/getRoutesCore.d.ts.map +1 -1
  10. package/build/getRoutesCore.js +58 -86
  11. package/build/getRoutesCore.js.map +1 -1
  12. package/build/getRoutesRedirects.d.ts +2 -2
  13. package/build/getRoutesRedirects.d.ts.map +1 -1
  14. package/build/getRoutesRedirects.js +24 -18
  15. package/build/getRoutesRedirects.js.map +1 -1
  16. package/build/getRoutesSSR.d.ts +1 -1
  17. package/build/getRoutesSSR.d.ts.map +1 -1
  18. package/build/getRoutesSSR.js +3 -2
  19. package/build/getRoutesSSR.js.map +1 -1
  20. package/build/global-state/router-store.d.ts.map +1 -1
  21. package/build/global-state/router-store.js +0 -1
  22. package/build/global-state/router-store.js.map +1 -1
  23. package/build/link/Link.d.ts +56 -1
  24. package/build/link/Link.d.ts.map +1 -1
  25. package/build/link/Link.js +39 -3
  26. package/build/link/Link.js.map +1 -1
  27. package/build/typed-routes/generate.js +1 -1
  28. package/build/typed-routes/generate.js.map +1 -1
  29. package/build/useFocusEffect.d.ts.map +1 -1
  30. package/build/useFocusEffect.js +3 -5
  31. package/build/useFocusEffect.js.map +1 -1
  32. package/build/useScreens.js +1 -1
  33. package/build/useScreens.js.map +1 -1
  34. package/build/views/Screen.d.ts.map +1 -1
  35. package/build/views/Screen.js +40 -13
  36. package/build/views/Screen.js.map +1 -1
  37. package/build/views/Unmatched.d.ts.map +1 -1
  38. package/build/views/Unmatched.js +3 -9
  39. package/build/views/Unmatched.js.map +1 -1
  40. package/package.json +8 -9
  41. package/plugin/options.json +1 -29
  42. package/build/link/Redirect.d.ts +0 -59
  43. package/build/link/Redirect.d.ts.map +0 -1
  44. package/build/link/Redirect.js +0 -43
  45. package/build/link/Redirect.js.map +0 -1
  46. package/build/utils/stack.d.ts +0 -5
  47. package/build/utils/stack.d.ts.map +0 -1
  48. package/build/utils/stack.js +0 -10
  49. package/build/utils/stack.js.map +0 -1
  50. package/build/views/useSafeLayoutEffect.d.ts +0 -3
  51. package/build/views/useSafeLayoutEffect.d.ts.map +0 -1
  52. package/build/views/useSafeLayoutEffect.js +0 -6
  53. package/build/views/useSafeLayoutEffect.js.map +0 -1
  54. package/plugin/tsconfig.tsbuildinfo +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-router",
3
- "version": "5.1.2",
3
+ "version": "5.2.0-canary-20250611-f0afe80",
4
4
  "description": "Expo Router is a file-based router for React Native and web applications.",
5
5
  "author": "650 Industries, Inc.",
6
6
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  },
62
62
  "homepage": "https://docs.expo.dev/routing/introduction/",
63
63
  "scripts": {
64
- "build": "bash -c 'if [ -z \"$1\" ]; then expo-module build -p tsconfig.build.json; else expo-module build \"$1\"; fi' --",
64
+ "build": "bash -c 'if [ -z \"$1\" ]; then expo-module build -p tsconfig.json; else expo-module build \"$1\"; fi' --",
65
65
  "clean": "expo-module clean",
66
66
  "lint": "expo-module lint",
67
67
  "test": "expo-module test",
@@ -76,9 +76,9 @@
76
76
  ],
77
77
  "peerDependencies": {
78
78
  "@react-navigation/drawer": "^7.3.9",
79
- "expo": "*",
80
- "expo-constants": "*",
81
- "expo-linking": "*",
79
+ "expo": "54.0.0-canary-20250611-f0afe80",
80
+ "expo-constants": "17.1.7-canary-20250611-f0afe80",
81
+ "expo-linking": "7.1.6-canary-20250611-f0afe80",
82
82
  "react-native-reanimated": "*",
83
83
  "react-native-safe-area-context": "*",
84
84
  "react-native-screens": "*"
@@ -105,8 +105,8 @@
105
105
  "tsd": "^0.28.1"
106
106
  },
107
107
  "dependencies": {
108
- "@expo/metro-runtime": "5.0.4",
109
- "@expo/server": "^0.6.3",
108
+ "@expo/metro-runtime": "5.0.5-canary-20250611-f0afe80",
109
+ "@expo/server": "0.6.3-canary-20250611-f0afe80",
110
110
  "@radix-ui/react-slot": "1.2.0",
111
111
  "@react-navigation/bottom-tabs": "^7.3.10",
112
112
  "@react-navigation/native": "^7.1.6",
@@ -119,6 +119,5 @@
119
119
  "semver": "~7.6.3",
120
120
  "server-only": "^0.0.1",
121
121
  "shallowequal": "^1.1.0"
122
- },
123
- "gitHead": "9731a6191dcab84e9c3a24492bbe70c56d6f5cc3"
122
+ }
124
123
  }
@@ -91,7 +91,7 @@
91
91
  "description": "The target file path that this route should redirect to",
92
92
  "type": "string"
93
93
  },
94
- "permanent": {
94
+ "temporary": {
95
95
  "description": "Whether the redirect is temporary or permanent. Defaults to `false`.",
96
96
  "type": "boolean",
97
97
  "default": false
@@ -107,34 +107,6 @@
107
107
  }
108
108
  }
109
109
  }
110
- },
111
- "rewrites": {
112
- "description": "Enable static rewrites",
113
- "type": "array",
114
- "uniqueItems": true,
115
- "items": {
116
- "type": "object",
117
- "required": ["source", "destination"],
118
- "properties": {
119
- "source": {
120
- "description": "The previous file path that should be rewritten",
121
- "type": "string"
122
- },
123
- "destination": {
124
- "description": "The target file path that this route should rewrite",
125
- "type": "string"
126
- },
127
- "methods": {
128
- "description": "HTTP methods that should be rewritten. Omit to rewrite all methods.",
129
- "type": "array",
130
- "uniqueItems": true,
131
- "items": {
132
- "type": "string",
133
- "enum": ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS", "HEAD"]
134
- }
135
- }
136
- }
137
- }
138
110
  }
139
111
  },
140
112
  "additionalProperties": false
@@ -1,59 +0,0 @@
1
- import type { Href } from '../types';
2
- export type RedirectProps = {
3
- /**
4
- * The path of the route to navigate to. It can either be:
5
- * - **string**: A full path like `/profile/settings` or a relative path like `../settings`.
6
- * - **object**: An object with a `pathname` and optional `params`. The `pathname` can be
7
- * a full path like `/profile/settings` or a relative path like `../settings`. The
8
- * params can be an object of key-value pairs.
9
- *
10
- * @example
11
- * ```tsx Dynamic
12
- * import { Redirect } from 'expo-router';
13
- *
14
- * export default function RedirectToAbout() {
15
- * return (
16
- * <Redirect href="/about" />
17
- * );
18
- *}
19
- * ```
20
- */
21
- href: Href;
22
- /**
23
- * Relative URL references are either relative to the directory or the document.
24
- * By default, relative paths are relative to the document.
25
- *
26
- * @see [Resolving relative references in Mozilla's documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL_API/Resolving_relative_references).
27
- */
28
- relativeToDirectory?: boolean;
29
- /**
30
- * Replaces the initial screen with the current route.
31
- */
32
- withAnchor?: boolean;
33
- };
34
- /**
35
- * Redirects to the `href` as soon as the component is mounted.
36
- *
37
- * @example
38
- * ```tsx
39
- * import { View, Text } from 'react-native';
40
- * import { Redirect } from 'expo-router';
41
- *
42
- * export default function Page() {
43
- * const { user } = useAuth();
44
- *
45
- * if (!user) {
46
- * return <Redirect href="/login" />;
47
- * }
48
- *
49
- * return (
50
- * <View>
51
- * <Text>Welcome Back!</Text>
52
- * </View>
53
- * );
54
- * }
55
- * ```
56
- */
57
- export declare function Redirect({ href, relativeToDirectory, withAnchor }: RedirectProps): null;
58
- export default Redirect;
59
- //# sourceMappingURL=Redirect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Redirect.d.ts","sourceRoot":"","sources":["../../src/link/Redirect.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGrC,MAAM,MAAM,aAAa,GAAG;IAC1B;;;;;;;;;;;;;;;;;OAiBG;IACH,IAAI,EAAE,IAAI,CAAC;IAEX;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,EAAE,aAAa,QAUhF;AAED,eAAe,QAAQ,CAAC"}
@@ -1,43 +0,0 @@
1
- "use strict";
2
- 'use client';
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Redirect = Redirect;
5
- const hooks_1 = require("../hooks");
6
- const useFocusEffect_1 = require("../useFocusEffect");
7
- /**
8
- * Redirects to the `href` as soon as the component is mounted.
9
- *
10
- * @example
11
- * ```tsx
12
- * import { View, Text } from 'react-native';
13
- * import { Redirect } from 'expo-router';
14
- *
15
- * export default function Page() {
16
- * const { user } = useAuth();
17
- *
18
- * if (!user) {
19
- * return <Redirect href="/login" />;
20
- * }
21
- *
22
- * return (
23
- * <View>
24
- * <Text>Welcome Back!</Text>
25
- * </View>
26
- * );
27
- * }
28
- * ```
29
- */
30
- function Redirect({ href, relativeToDirectory, withAnchor }) {
31
- const router = (0, hooks_1.useRouter)();
32
- (0, useFocusEffect_1.useFocusEffect)(() => {
33
- try {
34
- router.replace(href, { relativeToDirectory, withAnchor });
35
- }
36
- catch (error) {
37
- console.error(error);
38
- }
39
- });
40
- return null;
41
- }
42
- exports.default = Redirect;
43
- //# sourceMappingURL=Redirect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Redirect.js","sourceRoot":"","sources":["../../src/link/Redirect.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AA+Db,4BAUC;AAxED,oCAAqC;AAErC,sDAAmD;AAqCnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAiB;IAC/E,MAAM,MAAM,GAAG,IAAA,iBAAS,GAAE,CAAC;IAC3B,IAAA,+BAAc,EAAC,GAAG,EAAE;QAClB,IAAI,CAAC;YACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,mBAAmB,EAAE,UAAU,EAAE,CAAC,CAAC;QAC5D,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC;AAED,kBAAe,QAAQ,CAAC","sourcesContent":["'use client';\nimport { useRouter } from '../hooks';\nimport type { Href } from '../types';\nimport { useFocusEffect } from '../useFocusEffect';\n\nexport type RedirectProps = {\n /**\n * The path of the route to navigate to. It can either be:\n * - **string**: A full path like `/profile/settings` or a relative path like `../settings`.\n * - **object**: An object with a `pathname` and optional `params`. The `pathname` can be\n * a full path like `/profile/settings` or a relative path like `../settings`. The\n * params can be an object of key-value pairs.\n *\n * @example\n * ```tsx Dynamic\n * import { Redirect } from 'expo-router';\n *\n * export default function RedirectToAbout() {\n * return (\n * <Redirect href=\"/about\" />\n * );\n *}\n * ```\n */\n href: Href;\n\n /**\n * Relative URL references are either relative to the directory or the document.\n * By default, relative paths are relative to the document.\n *\n * @see [Resolving relative references in Mozilla's documentation](https://developer.mozilla.org/en-US/docs/Web/API/URL_API/Resolving_relative_references).\n */\n relativeToDirectory?: boolean;\n\n /**\n * Replaces the initial screen with the current route.\n */\n withAnchor?: boolean;\n};\n\n/**\n * Redirects to the `href` as soon as the component is mounted.\n *\n * @example\n * ```tsx\n * import { View, Text } from 'react-native';\n * import { Redirect } from 'expo-router';\n *\n * export default function Page() {\n * const { user } = useAuth();\n *\n * if (!user) {\n * return <Redirect href=\"/login\" />;\n * }\n *\n * return (\n * <View>\n * <Text>Welcome Back!</Text>\n * </View>\n * );\n * }\n * ```\n */\nexport function Redirect({ href, relativeToDirectory, withAnchor }: RedirectProps) {\n const router = useRouter();\n useFocusEffect(() => {\n try {\n router.replace(href, { relativeToDirectory, withAnchor });\n } catch (error) {\n console.error(error);\n }\n });\n return null;\n}\n\nexport default Redirect;\n"]}
@@ -1,5 +0,0 @@
1
- import type { NavigationState } from '@react-navigation/native';
2
- export declare function isRoutePreloadedInStack(navigationState: NavigationState | undefined, route: {
3
- key: string;
4
- }): boolean;
5
- //# sourceMappingURL=stack.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stack.d.ts","sourceRoot":"","sources":["../../src/utils/stack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AAElC,wBAAgB,uBAAuB,CACrC,eAAe,EAAE,eAAe,GAAG,SAAS,EAC5C,KAAK,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GACrB,OAAO,CAOT"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isRoutePreloadedInStack = isRoutePreloadedInStack;
4
- function isRoutePreloadedInStack(navigationState, route) {
5
- if (!navigationState || navigationState.type !== 'stack') {
6
- return false;
7
- }
8
- return navigationState.preloadedRoutes.some((preloaded) => preloaded.key === route.key);
9
- }
10
- //# sourceMappingURL=stack.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stack.js","sourceRoot":"","sources":["../../src/utils/stack.ts"],"names":[],"mappings":";;AAMA,0DAUC;AAVD,SAAgB,uBAAuB,CACrC,eAA4C,EAC5C,KAAsB;IAEtB,IAAI,CAAC,eAAe,IAAI,eAAe,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;QACzD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAQ,eAAuD,CAAC,eAAe,CAAC,IAAI,CAClF,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,KAAK,KAAK,CAAC,GAAG,CAC3C,CAAC;AACJ,CAAC","sourcesContent":["import type {\n NavigationState,\n ParamListBase,\n StackNavigationState,\n} from '@react-navigation/native';\n\nexport function isRoutePreloadedInStack(\n navigationState: NavigationState | undefined,\n route: { key: string }\n): boolean {\n if (!navigationState || navigationState.type !== 'stack') {\n return false;\n }\n return (navigationState as StackNavigationState<ParamListBase>).preloadedRoutes.some(\n (preloaded) => preloaded.key === route.key\n );\n}\n"]}
@@ -1,3 +0,0 @@
1
- import { useLayoutEffect } from 'react';
2
- export declare const useSafeLayoutEffect: typeof useLayoutEffect;
3
- //# sourceMappingURL=useSafeLayoutEffect.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSafeLayoutEffect.d.ts","sourceRoot":"","sources":["../../src/views/useSafeLayoutEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAExC,eAAO,MAAM,mBAAmB,wBAAmE,CAAC"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useSafeLayoutEffect = void 0;
4
- const react_1 = require("react");
5
- exports.useSafeLayoutEffect = typeof window !== 'undefined' ? react_1.useLayoutEffect : function () { };
6
- //# sourceMappingURL=useSafeLayoutEffect.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSafeLayoutEffect.js","sourceRoot":"","sources":["../../src/views/useSafeLayoutEffect.ts"],"names":[],"mappings":";;;AAAA,iCAAwC;AAE3B,QAAA,mBAAmB,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,uBAAe,CAAC,CAAC,CAAC,cAAa,CAAC,CAAC","sourcesContent":["import { useLayoutEffect } from 'react';\n\nexport const useSafeLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : function () {};\n"]}
@@ -1 +0,0 @@
1
- {"root":["./src/index.ts"],"version":"5.8.3"}