reroute-js 0.42.1 → 0.43.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/cli/bin.d.ts +1 -1
- package/cli/bin.js +124 -31
- package/cli/bin.js.map +8 -8
- package/cli/index.d.ts +1 -1
- package/cli/index.js +4 -4
- package/cli/index.js.map +1 -1
- package/cli/src/cli.d.ts +1 -1
- package/cli/src/commands/analyze.d.ts +1 -1
- package/cli/src/commands/build.d.ts +1 -1
- package/cli/src/commands/dev.d.ts +1 -1
- package/cli/src/commands/gen.d.ts +1 -1
- package/cli/src/commands/gen.d.ts.map +1 -1
- package/cli/src/commands/index.d.ts +1 -1
- package/cli/src/commands/init.d.ts +1 -1
- package/cli/src/commands/lib/assets.d.ts +1 -1
- package/cli/src/commands/lib/bundler.d.ts +1 -1
- package/cli/src/commands/lib/command.d.ts +1 -1
- package/cli/src/commands/lib/env.d.ts +1 -1
- package/cli/src/commands/lib/index.d.ts +1 -1
- package/cli/src/commands/lib/log.d.ts +1 -1
- package/cli/src/commands/lib/markdown/availability.d.ts +1 -1
- package/cli/src/commands/lib/markdown/index.d.ts +1 -1
- package/cli/src/commands/lib/markdown/processor.d.ts +1 -1
- package/cli/src/commands/lib/production.d.ts +1 -1
- package/cli/src/commands/lib/server.d.ts +1 -1
- package/cli/src/commands/lib/streaming/analyzer.d.ts +1 -1
- package/cli/src/commands/lib/streaming/suspense.d.ts +1 -1
- package/cli/src/commands/lib/streaming/suspense.d.ts.map +1 -1
- package/cli/src/commands/lib/tailwind.d.ts +1 -1
- package/cli/src/commands/lib/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/version.d.ts +1 -1
- package/cli/src/commands/og.d.ts +1 -1
- package/cli/src/commands/start.d.ts +1 -1
- package/cli/src/index.d.ts +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +107 -6
- package/core/index.js.map +6 -6
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +81 -5
- package/core/src/config.d.ts.map +1 -1
- package/core/src/content/discovery.d.ts +1 -1
- package/core/src/content/index.d.ts +1 -1
- package/core/src/content/metadata.d.ts +1 -1
- package/core/src/index.d.ts +1 -1
- package/core/src/llms/extractor.d.ts +1 -1
- package/core/src/llms/formatter.d.ts +1 -1
- package/core/src/llms/full-generator.d.ts +1 -1
- package/core/src/llms/index-generator.d.ts +1 -1
- package/core/src/llms/index.d.ts +1 -1
- package/core/src/og/discovery.d.ts +1 -1
- package/core/src/og/index.d.ts +1 -1
- package/core/src/og/meta.d.ts +1 -1
- package/core/src/og/render.d.ts +1 -1
- package/core/src/og/types.d.ts +1 -1
- package/core/src/robots/discovery.d.ts +1 -1
- package/core/src/robots/generator.d.ts +1 -1
- package/core/src/robots/index.d.ts +1 -1
- package/core/src/robots/policies.d.ts +1 -1
- package/core/src/rss/discovery.d.ts +1 -1
- package/core/src/rss/generator.d.ts +1 -1
- package/core/src/rss/index.d.ts +1 -1
- package/core/src/sitemap/discovery.d.ts +1 -1
- package/core/src/sitemap/generator.d.ts +1 -1
- package/core/src/sitemap/index.d.ts +1 -1
- package/core/src/ssr/index.d.ts +1 -1
- package/core/src/ssr/lib/cache.d.ts +1 -1
- package/core/src/ssr/lib/collections.d.ts +1 -1
- package/core/src/ssr/lib/compression.d.ts +1 -1
- package/core/src/ssr/lib/compute/content.d.ts +1 -1
- package/core/src/ssr/lib/compute/index.d.ts +1 -1
- package/core/src/ssr/lib/compute/layouts.d.ts +1 -1
- package/core/src/ssr/lib/compute/routes.d.ts +1 -1
- package/core/src/ssr/lib/data.d.ts +1 -1
- package/core/src/ssr/lib/html.d.ts +1 -1
- package/core/src/ssr/lib/imports.d.ts +1 -1
- package/core/src/ssr/lib/index.d.ts +1 -1
- package/core/src/ssr/lib/layouts.d.ts +1 -1
- package/core/src/ssr/lib/metadata.d.ts +1 -1
- package/core/src/ssr/lib/metadata.d.ts.map +1 -1
- package/core/src/ssr/lib/mime.d.ts +1 -1
- package/core/src/ssr/lib/modules.d.ts +1 -1
- package/core/src/ssr/lib/path.d.ts +1 -1
- package/core/src/ssr/lib/preload.d.ts +1 -1
- package/core/src/ssr/lib/scripts/collections.d.ts +1 -1
- package/core/src/ssr/lib/scripts/data.d.ts +1 -1
- package/core/src/ssr/lib/scripts/escape.d.ts +1 -1
- package/core/src/ssr/lib/scripts/feeds.d.ts +1 -1
- package/core/src/ssr/lib/scripts/index.d.ts +1 -1
- package/core/src/ssr/lib/seed.d.ts +1 -1
- package/core/src/ssr/lib/serialize.d.ts +1 -1
- package/core/src/ssr/lib/setup.d.ts +4 -1
- package/core/src/ssr/lib/setup.d.ts.map +1 -1
- package/core/src/ssr/lib/styles.d.ts +1 -1
- package/core/src/ssr/lib/template.d.ts +1 -1
- package/core/src/ssr/lib/types.d.ts +3 -1
- package/core/src/ssr/lib/types.d.ts.map +1 -1
- package/core/src/ssr/render.d.ts +1 -1
- package/core/src/ssr/stream.d.ts +1 -1
- package/core/src/ssr/stream.d.ts.map +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +224 -72
- package/elysia/index.js.map +11 -11
- package/elysia/src/index.d.ts +1 -1
- package/elysia/src/libs/assets.d.ts +1 -1
- package/elysia/src/libs/cache.d.ts +1 -1
- package/elysia/src/libs/caching.d.ts +1 -1
- package/elysia/src/libs/http.d.ts +1 -1
- package/elysia/src/libs/image.d.ts +1 -1
- package/elysia/src/libs/index.d.ts +1 -1
- package/elysia/src/libs/llms.d.ts +1 -1
- package/elysia/src/libs/response.d.ts +1 -1
- package/elysia/src/libs/serving.d.ts +1 -1
- package/elysia/src/plugin.d.ts +1 -1
- package/elysia/src/plugin.d.ts.map +1 -1
- package/elysia/src/routes/artifacts.d.ts +1 -1
- package/elysia/src/routes/artifacts.d.ts.map +1 -1
- package/elysia/src/routes/content.d.ts +1 -1
- package/elysia/src/routes/image.d.ts +1 -1
- package/elysia/src/routes/index.d.ts +1 -1
- package/elysia/src/routes/internal.d.ts +2 -2
- package/elysia/src/routes/internal.d.ts.map +1 -1
- package/elysia/src/routes/llms.d.ts +1 -1
- package/elysia/src/routes/og.d.ts +1 -1
- package/elysia/src/routes/og.d.ts.map +1 -1
- package/elysia/src/routes/redirects.d.ts +1 -1
- package/elysia/src/routes/robots.d.ts +1 -1
- package/elysia/src/routes/rss.d.ts +1 -1
- package/elysia/src/routes/search.d.ts +1 -1
- package/elysia/src/routes/sitemap.d.ts +1 -1
- package/elysia/src/routes/ssr.d.ts +6 -3
- package/elysia/src/routes/ssr.d.ts.map +1 -1
- package/elysia/src/routes/static.d.ts +1 -1
- package/elysia/src/types.d.ts +1 -1
- package/package.json +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.js +75 -20
- package/react/index.js.map +6 -6
- package/react/src/components/ClientOnly.d.ts +1 -1
- package/react/src/components/ContentRoute.d.ts +1 -1
- package/react/src/components/Image.d.ts +1 -1
- package/react/src/components/LazyRoute.d.ts +1 -1
- package/react/src/components/Link.d.ts +3 -3
- package/react/src/components/Link.d.ts.map +1 -1
- package/react/src/components/Markdown.d.ts +1 -1
- package/react/src/components/Outlet.d.ts +1 -1
- package/react/src/components/index.d.ts +1 -1
- package/react/src/hooks/index.d.ts +1 -1
- package/react/src/hooks/useContent.d.ts +1 -1
- package/react/src/hooks/useData.d.ts +1 -1
- package/react/src/hooks/useData.d.ts.map +1 -1
- package/react/src/hooks/useFeed.d.ts +1 -1
- package/react/src/hooks/useLayoutData.d.ts +1 -1
- package/react/src/hooks/useLayoutData.d.ts.map +1 -1
- package/react/src/hooks/useLlms.d.ts +1 -1
- package/react/src/hooks/useNavigate.d.ts +1 -1
- package/react/src/hooks/useParams.d.ts +1 -1
- package/react/src/hooks/useRouter.d.ts +1 -1
- package/react/src/hooks/useSearch.d.ts +1 -1
- package/react/src/hooks/useSearchParams.d.ts +1 -1
- package/react/src/hooks/useToc.d.ts +1 -1
- package/react/src/index.d.ts +1 -1
- package/react/src/lib/collection.d.ts +1 -1
- package/react/src/lib/content.d.ts +1 -1
- package/react/src/lib/head.d.ts +1 -1
- package/react/src/lib/index.d.ts +1 -1
- package/react/src/lib/lazy-route.d.ts +1 -1
- package/react/src/lib/route-loader.d.ts +1 -1
- package/react/src/providers/ContentProvider.d.ts +1 -1
- package/react/src/providers/RerouteProvider.d.ts +1 -1
- package/react/src/providers/RouterProvider.d.ts +1 -1
- package/react/src/providers/RouterProvider.d.ts.map +1 -1
- package/react/src/providers/index.d.ts +1 -1
- package/react/src/types/any.d.ts +1 -1
- package/react/src/types/index.d.ts +1 -1
- package/react/src/types/router.d.ts +1 -1
- package/telemetry/react.d.ts +1 -1
- package/telemetry/react.js +2 -2
- package/telemetry/react.js.map +1 -1
- package/telemetry/server.d.ts +1 -1
- package/telemetry/server.js +2 -2
- package/telemetry/server.js.map +6 -6
- package/telemetry/src/react/api.d.ts +1 -1
- package/telemetry/src/react/context.d.ts +1 -1
- package/telemetry/src/react/index.d.ts +1 -1
- package/telemetry/src/react/telemetry.d.ts +1 -1
- package/telemetry/src/server/context.d.ts +1 -1
- package/telemetry/src/server/headers/extractor.d.ts +1 -1
- package/telemetry/src/server/headers/index.d.ts +1 -1
- package/telemetry/src/server/headers/presets.d.ts +1 -1
- package/telemetry/src/server/index.d.ts +1 -1
- package/telemetry/src/server/instrumentation.d.ts +1 -1
- package/telemetry/src/server/plugin.d.ts +1 -1
- package/telemetry/src/server/sourcemap.d.ts +1 -1
package/elysia/src/index.d.ts
CHANGED
package/elysia/src/plugin.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/elysia/src/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAqBrC,QAAA,MAAM,OAAO,SAGL,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/elysia/src/plugin.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAqBrC,QAAA,MAAM,OAAO,SAGL,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;GAshBjB,CAAC;AAEH,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/routes/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGtD,KAAK,gBAAgB,GAAG;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,EACrC,OAAO,EAAE,gBAAgB,GACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"artifacts.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/routes/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAQ,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGtD,KAAK,gBAAgB,GAAG;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,EACrC,OAAO,EAAE,gBAAgB,GACvB,MAAM,CA4FR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js v0.
|
|
2
|
+
* reroute-js v0.43.1
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Built with Bun <3
|
|
9
9
|
*/
|
|
10
10
|
import type { Elysia } from 'elysia';
|
|
11
|
-
import {
|
|
11
|
+
import type { LRUCache } from 'reroute-js/core';
|
|
12
12
|
type InternalRouteOptions = {
|
|
13
13
|
clientDir: string;
|
|
14
14
|
cwd: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/routes/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/routes/internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAIhD,KAAK,oBAAoB,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAmBF;;;;GAIG;AACH,wBAAgB,sBAAsB,CACrC,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,oBAAoB,GACxB,MAAM,CA8OR;AAED;;GAEG;AACH,KAAK,eAAe,GAAG;IACtB,OAAO,EAAE,GAAG,CAAC,+BAA+B,CAAC,CAAC;IAC9C,aAAa,EAAE,OAAO,CAAC;CACvB,CAAC;AAuKF;;GAEG;AACH,wBAAgB,wBAAwB,CACvC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,eAAe,GACpB,MAAM,CA2DR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"og.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/routes/og.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAIN,KAAK,QAAQ,EAGb,KAAK,cAAc,EAEnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,gBAAgB,EAAc,MAAM,iBAAiB,CAAC;AAGpE,KAAK,cAAc,GAAG;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC5C,CAAC;AAmUF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"og.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/routes/og.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAIN,KAAK,QAAQ,EAGb,KAAK,cAAc,EAEnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,gBAAgB,EAAc,MAAM,iBAAiB,CAAC;AAGpE,KAAK,cAAc,GAAG;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC5C,CAAC;AAmUF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,CA6O7E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js v0.
|
|
2
|
+
* reroute-js v0.43.1
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -23,8 +23,11 @@ type SSRRouteOptions = {
|
|
|
23
23
|
head?: string;
|
|
24
24
|
lang?: string;
|
|
25
25
|
appId?: string;
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
serverCacheEnabled?: boolean;
|
|
27
|
+
serverMaxAge?: number;
|
|
28
|
+
browserCacheEnabled?: boolean;
|
|
29
|
+
browserMaxAge?: number;
|
|
30
|
+
browserDirective?: string;
|
|
28
31
|
compression?: boolean;
|
|
29
32
|
streamingEnabled?: boolean;
|
|
30
33
|
streamingTimeout?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/routes/ssr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,SAAS,EAGd,MAAM,iBAAiB,CAAC;AAoCzB,KAAK,eAAe,GAAG;IACtB,aAAa,EAAE,YAAY,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACzD,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACtC,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/routes/ssr.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAGN,KAAK,cAAc,EACnB,KAAK,SAAS,EAGd,MAAM,iBAAiB,CAAC;AAoCzB,KAAK,eAAe,GAAG;IACtB,aAAa,EAAE,YAAY,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IACzD,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACtC,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,iBAAS,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,MAAM,CA0mBxE;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
package/elysia/src/types.d.ts
CHANGED
package/package.json
CHANGED
package/react/index.d.ts
CHANGED
package/react/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js v0.
|
|
2
|
+
* reroute-js v0.43.1
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -1277,6 +1277,9 @@ function RouterProvider({
|
|
|
1277
1277
|
useEffect4(() => {
|
|
1278
1278
|
setViewTransitionsEnabled(viewTransitions);
|
|
1279
1279
|
setScrollRestorationEnabled(scrollRestoration);
|
|
1280
|
+
if (isBrowser2 && "scrollRestoration" in window.history) {
|
|
1281
|
+
window.history.scrollRestoration = "manual";
|
|
1282
|
+
}
|
|
1280
1283
|
}, [viewTransitions, scrollRestoration]);
|
|
1281
1284
|
const serverSnapshotRef = React.useRef(null);
|
|
1282
1285
|
if (!serverSnapshotRef.current) {
|
|
@@ -1481,15 +1484,27 @@ function RouterProvider({
|
|
|
1481
1484
|
} catch {}
|
|
1482
1485
|
try {
|
|
1483
1486
|
const ssr = route.ssr;
|
|
1484
|
-
if (ssr?.head)
|
|
1485
|
-
|
|
1487
|
+
if (ssr?.head) {
|
|
1488
|
+
if (typeof ssr.head === "function") {
|
|
1489
|
+
const g = globalThis;
|
|
1490
|
+
const ssrData = g.__REROUTE_DATA__ || {};
|
|
1491
|
+
const routeData = ssrData[pathname];
|
|
1492
|
+
if (routeData && typeof routeData !== "object") {
|
|
1493
|
+
applyRouteHead(ssr.head({ data: routeData }));
|
|
1494
|
+
} else if (routeData && typeof routeData === "object" && !("then" in routeData)) {
|
|
1495
|
+
applyRouteHead(ssr.head({ data: routeData }));
|
|
1496
|
+
}
|
|
1497
|
+
} else {
|
|
1498
|
+
applyRouteHead(ssr.head);
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1486
1501
|
if (ssr?.lang)
|
|
1487
1502
|
applyLang(ssr.lang);
|
|
1488
1503
|
} catch {}
|
|
1489
1504
|
return () => {
|
|
1490
1505
|
applyRouteHead(undefined);
|
|
1491
1506
|
};
|
|
1492
|
-
}, [target]);
|
|
1507
|
+
}, [target, pathname]);
|
|
1493
1508
|
const notFoundResolver = useCallback4((pathname2) => {
|
|
1494
1509
|
try {
|
|
1495
1510
|
const list = Array.isArray(notFoundRoutes) ? notFoundRoutes : [];
|
|
@@ -1700,9 +1715,8 @@ function useData(key) {
|
|
|
1700
1715
|
if (pending[pathToFetch]) {
|
|
1701
1716
|
return;
|
|
1702
1717
|
}
|
|
1703
|
-
pending[pathToFetch] = true;
|
|
1704
1718
|
const fetchPath = pathToFetch === pathname ? pathname : pathToFetch;
|
|
1705
|
-
fetch(`/__reroute_data?path=${encodeURIComponent(fetchPath)}`, {
|
|
1719
|
+
const fetchPromise = fetch(`/__reroute_data?path=${encodeURIComponent(fetchPath)}`, {
|
|
1706
1720
|
headers: { Accept: "application/json" },
|
|
1707
1721
|
credentials: "same-origin"
|
|
1708
1722
|
}).then((r) => r.ok ? r.json() : null).then((j) => {
|
|
@@ -1713,6 +1727,7 @@ function useData(key) {
|
|
|
1713
1727
|
const keys = [];
|
|
1714
1728
|
for (const [key2, value] of Object.entries(payload)) {
|
|
1715
1729
|
if (key2 !== "__reroute_multiple__") {
|
|
1730
|
+
console.log("[useData MUTATION 1] Setting", key2, "to", value, "payload is:", payload);
|
|
1716
1731
|
w.__REROUTE_DATA__[key2] = value;
|
|
1717
1732
|
keys.push(key2);
|
|
1718
1733
|
}
|
|
@@ -1726,11 +1741,13 @@ function useData(key) {
|
|
|
1726
1741
|
const keys = [];
|
|
1727
1742
|
for (const [key2, value] of Object.entries(payload)) {
|
|
1728
1743
|
if (key2 !== "__reroute_flattened__" && key2 !== "__flatten__") {
|
|
1744
|
+
console.log("[useData MUTATION 2] Setting", key2, "to", value);
|
|
1729
1745
|
w.__REROUTE_DATA__[key2] = value;
|
|
1730
1746
|
keys.push(key2);
|
|
1731
1747
|
}
|
|
1732
1748
|
}
|
|
1733
1749
|
if (isLikelyDataKey) {
|
|
1750
|
+
console.log("[useData MUTATION 3] Setting pathname", pathname, "to payload");
|
|
1734
1751
|
w.__REROUTE_DATA__[pathname] = payload;
|
|
1735
1752
|
}
|
|
1736
1753
|
try {
|
|
@@ -1745,6 +1762,7 @@ function useData(key) {
|
|
|
1745
1762
|
const keys = [];
|
|
1746
1763
|
for (const [key2, value] of Object.entries(payload)) {
|
|
1747
1764
|
if (key2.startsWith("__layout:")) {
|
|
1765
|
+
console.log("[useData MUTATION 4] Setting layout key", key2, "to", value);
|
|
1748
1766
|
w.__REROUTE_DATA__[key2] = value;
|
|
1749
1767
|
keys.push(key2);
|
|
1750
1768
|
}
|
|
@@ -1752,6 +1770,7 @@ function useData(key) {
|
|
|
1752
1770
|
if (!isLikelyDataKey && layoutKeys.length === Object.keys(payload).length) {
|
|
1753
1771
|
if (layoutKeys.length === 1) {
|
|
1754
1772
|
const layoutValue = payload[layoutKeys[0]];
|
|
1773
|
+
console.log("[useData MUTATION 5] Setting pathname", pathname, "to layoutValue", layoutValue, "payload:", payload);
|
|
1755
1774
|
w.__REROUTE_DATA__[pathname] = layoutValue;
|
|
1756
1775
|
keys.push(pathname);
|
|
1757
1776
|
} else {
|
|
@@ -1763,6 +1782,7 @@ function useData(key) {
|
|
|
1763
1782
|
}
|
|
1764
1783
|
}
|
|
1765
1784
|
if (Object.keys(mergedLayoutData).length > 0) {
|
|
1785
|
+
console.log("[useData MUTATION 6] Setting pathname", pathname, "to mergedLayoutData", mergedLayoutData);
|
|
1766
1786
|
w.__REROUTE_DATA__[pathname] = mergedLayoutData;
|
|
1767
1787
|
keys.push(pathname);
|
|
1768
1788
|
}
|
|
@@ -1777,6 +1797,7 @@ function useData(key) {
|
|
|
1777
1797
|
}
|
|
1778
1798
|
}
|
|
1779
1799
|
const targetKey = isLikelyDataKey ? pathToFetch : k;
|
|
1800
|
+
console.log("[useData MUTATION 7] Setting targetKey", targetKey, "to payload", payload, "k:", k, "pathToFetch:", pathToFetch);
|
|
1780
1801
|
w.__REROUTE_DATA__[targetKey] = payload;
|
|
1781
1802
|
try {
|
|
1782
1803
|
w.dispatchEvent(new CustomEvent("__reroute_data__", {
|
|
@@ -1792,12 +1813,38 @@ function useData(key) {
|
|
|
1792
1813
|
delete w.__REROUTE_DATA_PENDING__[pathToFetch];
|
|
1793
1814
|
} catch {}
|
|
1794
1815
|
});
|
|
1816
|
+
pending[pathToFetch] = fetchPromise;
|
|
1795
1817
|
} catch {}
|
|
1796
1818
|
}, [k, pathname]);
|
|
1797
1819
|
return useMemo5(() => {
|
|
1798
1820
|
try {
|
|
1799
1821
|
const source = typeof window === "undefined" ? globalThis.__REROUTE_DATA__ : window.__REROUTE_DATA__;
|
|
1800
1822
|
let value = source?.[k];
|
|
1823
|
+
if (value === undefined && typeof window !== "undefined") {
|
|
1824
|
+
const w = window;
|
|
1825
|
+
const pending = w.__REROUTE_DATA_PENDING__;
|
|
1826
|
+
const pendingPromise = pending?.[k] || pending?.[pathname];
|
|
1827
|
+
if (pendingPromise && typeof pendingPromise !== "boolean") {
|
|
1828
|
+
throw pendingPromise;
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
if (typeof value === "object" && value !== null && value === source) {
|
|
1832
|
+
if (typeof source === "object" && source !== null && k in source) {
|
|
1833
|
+
value = source[k];
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
if (typeof value === "object" && value !== null && typeof k === "string" && k.startsWith("/") && typeof source === "object" && source !== null) {
|
|
1837
|
+
const valueKeys = Object.keys(value);
|
|
1838
|
+
const hasLayoutKeys = valueKeys.some((key2) => key2.startsWith("__layout:"));
|
|
1839
|
+
const hasPathnameKey = k in value;
|
|
1840
|
+
if (hasLayoutKeys && hasPathnameKey) {
|
|
1841
|
+
console.warn("[useData] BUG DETECTED: value contains both layout and pathname keys, extracting pathname data for:", k);
|
|
1842
|
+
const extractedValue = value[k];
|
|
1843
|
+
if (extractedValue !== undefined) {
|
|
1844
|
+
value = extractedValue;
|
|
1845
|
+
}
|
|
1846
|
+
}
|
|
1847
|
+
}
|
|
1801
1848
|
if (typeof value === "object" && value !== null && typeof window !== "undefined") {
|
|
1802
1849
|
const keys = Object.keys(value);
|
|
1803
1850
|
const layoutKeys = keys.filter((key2) => key2.startsWith("__layout:"));
|
|
@@ -1868,7 +1915,7 @@ function useData(key) {
|
|
|
1868
1915
|
}
|
|
1869
1916
|
return;
|
|
1870
1917
|
}
|
|
1871
|
-
}, [k, _tick]);
|
|
1918
|
+
}, [k, _tick, pathname]);
|
|
1872
1919
|
}
|
|
1873
1920
|
// packages/react/src/hooks/useFeed.ts
|
|
1874
1921
|
import { useMemo as useMemo6 } from "react";
|
|
@@ -2001,7 +2048,10 @@ function useLayoutData() {
|
|
|
2001
2048
|
return useMemo7(() => {
|
|
2002
2049
|
try {
|
|
2003
2050
|
const source = typeof window === "undefined" ? globalThis.__REROUTE_DATA__ : window.__REROUTE_DATA__;
|
|
2004
|
-
|
|
2051
|
+
let value = source?.[layoutKey];
|
|
2052
|
+
if (value === undefined && layoutKey !== "__layout:/") {
|
|
2053
|
+
value = source?.["__layout:/"];
|
|
2054
|
+
}
|
|
2005
2055
|
if (typeof value === "object" && value !== null && value.__lazy__ === true) {
|
|
2006
2056
|
const fetchUrl = value.__fetch__;
|
|
2007
2057
|
if (typeof fetchUrl === "string" && typeof window !== "undefined") {
|
|
@@ -2709,7 +2759,7 @@ function dispatchDataEvent(detail) {
|
|
|
2709
2759
|
window.dispatchEvent(new CustomEvent("__reroute_data__", { detail }));
|
|
2710
2760
|
} catch {}
|
|
2711
2761
|
}
|
|
2712
|
-
function storeAndDispatchData(path, payload) {
|
|
2762
|
+
function storeAndDispatchData(path, payload, silent = false) {
|
|
2713
2763
|
if (!payload || typeof payload !== "object")
|
|
2714
2764
|
return;
|
|
2715
2765
|
const store = getRerouteDataStore();
|
|
@@ -2718,17 +2768,20 @@ function storeAndDispatchData(path, payload) {
|
|
|
2718
2768
|
for (const key of keys) {
|
|
2719
2769
|
store[key] = payload[key];
|
|
2720
2770
|
}
|
|
2721
|
-
|
|
2771
|
+
if (!silent)
|
|
2772
|
+
dispatchDataEvent({ keys });
|
|
2722
2773
|
} else if (payload.__flatten__ === true || payload.__reroute_flattened__ === true) {
|
|
2723
2774
|
const keys = Object.keys(payload).filter((k) => k !== "__flatten__" && k !== "__reroute_flattened__");
|
|
2724
2775
|
for (const key of keys) {
|
|
2725
2776
|
store[key] = payload[key];
|
|
2726
2777
|
}
|
|
2727
2778
|
store[path] = payload;
|
|
2728
|
-
|
|
2779
|
+
if (!silent)
|
|
2780
|
+
dispatchDataEvent({ keys: [...keys, path] });
|
|
2729
2781
|
} else {
|
|
2730
2782
|
store[path] = payload;
|
|
2731
|
-
|
|
2783
|
+
if (!silent)
|
|
2784
|
+
dispatchDataEvent({ key: path });
|
|
2732
2785
|
}
|
|
2733
2786
|
}
|
|
2734
2787
|
function needsDataPrefetch(path, inferred, matchRoute) {
|
|
@@ -2740,8 +2793,10 @@ function needsDataPrefetch(path, inferred, matchRoute) {
|
|
|
2740
2793
|
if (store[path] !== undefined)
|
|
2741
2794
|
return false;
|
|
2742
2795
|
const route = matchRoute?.(path)?.route;
|
|
2743
|
-
const
|
|
2744
|
-
|
|
2796
|
+
const hasSSRData = !!(route?.ssr && typeof route.ssr === "object" && typeof route.ssr.data === "function");
|
|
2797
|
+
if (hasSSRData)
|
|
2798
|
+
return false;
|
|
2799
|
+
return isDynamic;
|
|
2745
2800
|
}
|
|
2746
2801
|
async function fetchRouteData(path, signal) {
|
|
2747
2802
|
try {
|
|
@@ -2770,10 +2825,10 @@ async function fetchRouteData(path, signal) {
|
|
|
2770
2825
|
return null;
|
|
2771
2826
|
}
|
|
2772
2827
|
}
|
|
2773
|
-
function prefetchRouteData(path) {
|
|
2828
|
+
function prefetchRouteData(path, silent = false) {
|
|
2774
2829
|
fetchRouteData(path).then((payload) => {
|
|
2775
2830
|
if (payload)
|
|
2776
|
-
storeAndDispatchData(path, payload);
|
|
2831
|
+
storeAndDispatchData(path, payload, silent);
|
|
2777
2832
|
});
|
|
2778
2833
|
}
|
|
2779
2834
|
async function prefetchRouteDataWithTimeout(path, timeoutMs = 350) {
|
|
@@ -2846,7 +2901,7 @@ function Link({
|
|
|
2846
2901
|
if (options?.withTimeout) {
|
|
2847
2902
|
prefetchRouteDataWithTimeout(localUrl.path);
|
|
2848
2903
|
} else {
|
|
2849
|
-
prefetchRouteData(localUrl.path);
|
|
2904
|
+
prefetchRouteData(localUrl.path, options?.silent);
|
|
2850
2905
|
}
|
|
2851
2906
|
} else if (inferred?.module) {
|
|
2852
2907
|
prefetchContent(inferred);
|
|
@@ -2887,7 +2942,7 @@ function Link({
|
|
|
2887
2942
|
if (prefetch) {
|
|
2888
2943
|
const localUrl = parseLocalUrl(String(to));
|
|
2889
2944
|
if (localUrl)
|
|
2890
|
-
triggerPrefetch(localUrl);
|
|
2945
|
+
triggerPrefetch(localUrl, { silent: true });
|
|
2891
2946
|
}
|
|
2892
2947
|
onMouseEnter?.(e);
|
|
2893
2948
|
}, [prefetch, to, triggerPrefetch, onMouseEnter]);
|
|
@@ -2895,7 +2950,7 @@ function Link({
|
|
|
2895
2950
|
if (prefetch) {
|
|
2896
2951
|
const localUrl = parseLocalUrl(String(to));
|
|
2897
2952
|
if (localUrl)
|
|
2898
|
-
triggerPrefetch(localUrl);
|
|
2953
|
+
triggerPrefetch(localUrl, { silent: true });
|
|
2899
2954
|
}
|
|
2900
2955
|
onFocus?.(e);
|
|
2901
2956
|
}, [prefetch, to, triggerPrefetch, onFocus]);
|
|
@@ -3086,4 +3141,4 @@ export {
|
|
|
3086
3141
|
ClientOnly
|
|
3087
3142
|
};
|
|
3088
3143
|
|
|
3089
|
-
//# debugId=
|
|
3144
|
+
//# debugId=4F9F3ACDEA89FC2A64756E2164756E21
|