@real-router/react 0.37.0 → 0.37.1
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/README.md +1 -1
- package/dist/cjs/RouterProvider-29CNS0pw.js.map +1 -1
- package/dist/cjs/{RouterProvider-Cwy46Oyd.d.ts → RouterProvider-BNztePvZ.d.ts} +5 -5
- package/dist/cjs/RouterProvider-BNztePvZ.d.ts.map +1 -0
- package/dist/cjs/RouterProviderCore-ClTv62BJ.js.map +1 -1
- package/dist/cjs/createHttpStatusSink-DT-Ec9Jq.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/ink.js.map +1 -1
- package/dist/cjs/legacy.d.ts +1 -1
- package/dist/cjs/ssr.js.map +1 -1
- package/dist/cjs/useRoute-D2vAzKWM.js.map +1 -1
- package/dist/cjs/useRouterTransition-aiJ9iE62.d.ts.map +1 -1
- package/dist/esm/RouterProvider-BDUET4Ke.mjs.map +1 -1
- package/dist/esm/{RouterProvider-BixslYdB.d.mts → RouterProvider-BhOgl2jd.d.mts} +5 -5
- package/dist/esm/RouterProvider-BhOgl2jd.d.mts.map +1 -0
- package/dist/esm/RouterProviderCore-BQA-I4NQ.mjs.map +1 -1
- package/dist/esm/createHttpStatusSink-D3tbAjzC.mjs.map +1 -1
- package/dist/esm/index.d.mts +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/ink.mjs.map +1 -1
- package/dist/esm/legacy.d.mts +1 -1
- package/dist/esm/ssr.mjs.map +1 -1
- package/dist/esm/useRoute-5MF3j-9P.mjs.map +1 -1
- package/dist/esm/useRouterTransition-YvPtN5pW.d.mts.map +1 -1
- package/package.json +2 -2
- package/dist/cjs/RouterProvider-Cwy46Oyd.d.ts.map +0 -1
- package/dist/esm/RouterProvider-BixslYdB.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRoute-5MF3j-9P.mjs","names":[],"sources":["../../src/context.ts","../../src/constants.ts","../../src/hooks/useRoute.tsx"],"sourcesContent":["import { createContext } from \"react\";\n\nimport type { RouteContext as RouteContextType } from \"./types\";\nimport type { Router, Navigator } from \"@real-router/core\";\n\n// All three contexts use the `<T | null>` shape with a `null` default. Hooks\n// (useRouter / useRoute / useNavigator) treat a `null` read as\n// \"RouterProvider missing\" and throw — this surfaces wiring mistakes loudly\n// instead of letting consumers chase an undefined router instance.\nexport const RouteContext = createContext<RouteContextType | null>(null);\n\nexport const RouterContext = createContext<Router | null>(null);\n\nexport const NavigatorContext = createContext<Navigator | null>(null);\n","export const EMPTY_PARAMS = Object.freeze({});\n\nexport const EMPTY_OPTIONS = Object.freeze({});\n\n// Singleton forever-pending promise — module-scope so `useDeferred(unknownKey)`\n// returns a stable reference across calls (Suspense boundary doesn't retry).\nexport const NEVER_PROMISE = new Promise<never>(() => {\n // Intentionally never resolves — surfaces a forever-pending Suspense boundary\n // when a key is requested that the loader never declared.\n});\n","import { useContext } from \"react\";\n\nimport { RouteContext } from \"../context\";\n\nimport type { RouteContext as RouteContextType } from \"../types\";\nimport type { Params, State } from \"@real-router/core\";\n\n/**\n * Return shape of `useRoute<P>()` — the context with `route` narrowed to\n * `State<P>` (non-nullable). Promoting the intersection to a named alias\n * keeps the function signature and the cast site in sync.\n */\ntype RouteHookResult<P extends Params = Params> = Omit<\n RouteContextType<P>,\n \"route\"\n> & { route: State<P> };\n\nexport const useRoute = <P extends Params = Params>(): RouteHookResult<P> => {\n const routeContext = useContext(RouteContext);\n\n if (!routeContext) {\n throw new Error(\"useRoute must be used within a RouterProvider\");\n }\n\n if (!routeContext.route) {\n throw new Error(\n \"useRoute called with no active route. Did you forget to await router.start() before rendering, or is the router stopped/disposed?\",\n );\n }\n\n return routeContext as RouteHookResult<P>;\n};\n"],"mappings":"sDASA,
|
|
1
|
+
{"version":3,"file":"useRoute-5MF3j-9P.mjs","names":["RouteContext","createContext","RouterContext","NavigatorContext","EMPTY_PARAMS","EMPTY_OPTIONS","NEVER_PROMISE","useRoute","routeContext","useContext"],"sources":["../../src/context.ts","../../src/constants.ts","../../src/hooks/useRoute.tsx"],"sourcesContent":["import { createContext } from \"react\";\n\nimport type { RouteContext as RouteContextType } from \"./types\";\nimport type { Router, Navigator } from \"@real-router/core\";\n\n// All three contexts use the `<T | null>` shape with a `null` default. Hooks\n// (useRouter / useRoute / useNavigator) treat a `null` read as\n// \"RouterProvider missing\" and throw — this surfaces wiring mistakes loudly\n// instead of letting consumers chase an undefined router instance.\nexport const RouteContext = createContext<RouteContextType | null>(null);\n\nexport const RouterContext = createContext<Router | null>(null);\n\nexport const NavigatorContext = createContext<Navigator | null>(null);\n","export const EMPTY_PARAMS = Object.freeze({});\n\nexport const EMPTY_OPTIONS = Object.freeze({});\n\n// Singleton forever-pending promise — module-scope so `useDeferred(unknownKey)`\n// returns a stable reference across calls (Suspense boundary doesn't retry).\nexport const NEVER_PROMISE = new Promise<never>(() => {\n // Intentionally never resolves — surfaces a forever-pending Suspense boundary\n // when a key is requested that the loader never declared.\n});\n","import { useContext } from \"react\";\n\nimport { RouteContext } from \"../context\";\n\nimport type { RouteContext as RouteContextType } from \"../types\";\nimport type { Params, State } from \"@real-router/core\";\n\n/**\n * Return shape of `useRoute<P>()` — the context with `route` narrowed to\n * `State<P>` (non-nullable). Promoting the intersection to a named alias\n * keeps the function signature and the cast site in sync.\n */\ntype RouteHookResult<P extends Params = Params> = Omit<\n RouteContextType<P>,\n \"route\"\n> & { route: State<P> };\n\nexport const useRoute = <P extends Params = Params>(): RouteHookResult<P> => {\n const routeContext = useContext(RouteContext);\n\n if (!routeContext) {\n throw new Error(\"useRoute must be used within a RouterProvider\");\n }\n\n if (!routeContext.route) {\n throw new Error(\n \"useRoute called with no active route. Did you forget to await router.start() before rendering, or is the router stopped/disposed?\",\n );\n }\n\n return routeContext as RouteHookResult<P>;\n};\n"],"mappings":"sDASA,MAAaA,EAAeC,EAAuC,IAAI,EAE1DC,EAAgBD,EAA6B,IAAI,EAEjDE,EAAmBF,EAAgC,IAAI,ECbvDG,EAAe,OAAO,OAAO,CAAC,CAAC,EAE/BC,EAAgB,OAAO,OAAO,CAAC,CAAC,EAIhCC,EAAgB,IAAI,YAAqB,CAGtD,CAAC,ECQYC,MAAgE,CAC3E,IAAMC,EAAeC,EAAWT,CAAY,EAE5C,GAAI,CAACQ,EACH,MAAU,MAAM,+CAA+C,EAGjE,GAAI,CAACA,EAAa,MAChB,MAAU,MACR,mIACF,EAGF,OAAOA,CACT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouterTransition-YvPtN5pW.d.mts","names":[],"sources":["../../src/hooks/useRouter.tsx","../../src/hooks/useNavigator.tsx","../../src/hooks/useRouteUtils.tsx","../../src/hooks/useRoute.tsx","../../src/hooks/useRouteNode.tsx","../../src/hooks/useRouterTransition.tsx"],"mappings":";;;;;cAMa,iBAAgB;;;cCAhB,oBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;cCwBnB,qBAAoB;;;;;;;;KClB5B,gBAAgB,UAAU,SAAS,UAAU,
|
|
1
|
+
{"version":3,"file":"useRouterTransition-YvPtN5pW.d.mts","names":["RouteContextType"],"sources":["../../src/hooks/useRouter.tsx","../../src/hooks/useNavigator.tsx","../../src/hooks/useRouteUtils.tsx","../../src/hooks/useRoute.tsx","../../src/hooks/useRouteNode.tsx","../../src/hooks/useRouterTransition.tsx"],"mappings":";;;;;cAMa,iBAAgB;;;cCAhB,oBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;cCwBnB,qBAAoB;;;;;;;;KClB5B,gBAAgB,UAAU,SAAS,UAAU,KAChDA,aAAiB;EAEb,OAAO,MAAM;;cAEN,WAAY,UAAU,SAAS,aAAW,gBAAgB;;;iBCTvD,aAAa,mBAAmB;;;iBCDhC,uBAAuB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@real-router/react",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "React integration for Real-Router",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"@real-router/sources": "^0.15.0"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
|
-
"@real-router/browser-plugin": "^0.
|
|
122
|
+
"@real-router/browser-plugin": "^0.26.0",
|
|
123
123
|
"@real-router/core": "^0.148.0",
|
|
124
124
|
"@real-router/validation-plugin": "^0.30.0",
|
|
125
125
|
"@testing-library/dom": "~10.4.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RouterProvider-Cwy46Oyd.d.ts","names":[],"sources":["../../src/components/Link.tsx","../../../../shared/dom-utils/direction-tracker.ts","../../../../shared/dom-utils/route-announcer.ts","../../../../shared/dom-utils/scroll-restore.ts","../../../../shared/dom-utils/scroll-spy.ts","../../src/RouterProvider.tsx"],"mappings":";;;;cAmKa,MAAM,GAAG;;;UC9JL;EACf;;;;;;;;;;;;;;;;;;;;;;;iBA8Bc,uBAAuB,QAAQ,SAAS;;;UC3BvC;EACf;EACA,uBAAuB,OAAO;;;;KCUpB;UAEK;EACf,OAAO;EACP;EACA,yBAAyB;;;;;;;;;;;;;EAazB,WAAW;;;;;;;;EAQX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCLe;;;;;;EAMf;;;;;;EAOA;;;;;;;;;;EAWA,yBAAyB;;;;UChDV;EACf,QAAQ;EACR,UAAU;EACV,+BAA+B;EAC/B,oBAAoB;EACpB,YAAY;EACZ;;;;;;;;;cAUW,gBAAgB,GAAG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RouterProvider-BixslYdB.d.mts","names":[],"sources":["../../src/components/Link.tsx","../../../../shared/dom-utils/direction-tracker.ts","../../../../shared/dom-utils/route-announcer.ts","../../../../shared/dom-utils/scroll-restore.ts","../../../../shared/dom-utils/scroll-spy.ts","../../src/RouterProvider.tsx"],"mappings":";;;;cAmKa,MAAM,GAAG;;;UC9JL;EACf;;;;;;;;;;;;;;;;;;;;;;;iBA8Bc,uBAAuB,QAAQ,SAAS;;;UC3BvC;EACf;EACA,uBAAuB,OAAO;;;;KCUpB;UAEK;EACf,OAAO;EACP;EACA,yBAAyB;;;;;;;;;;;;;EAazB,WAAW;;;;;;;;EAQX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UCLe;;;;;;EAMf;;;;;;EAOA;;;;;;;;;;EAWA,yBAAyB;;;;UChDV;EACf,QAAQ;EACR,UAAU;EACV,+BAA+B;EAC/B,oBAAoB;EACpB,YAAY;EACZ;;;;;;;;;cAUW,gBAAgB,GAAG"}
|