reroute-js 1.0.0-alpha.21 → 1.0.0-alpha.23
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 -0
- package/cli/bin.d.ts +1 -1
- package/cli/bin.js +651 -248
- package/cli/bin.js.map +13 -10
- package/cli/index.d.ts +1 -1
- package/cli/index.js +14 -7
- package/cli/index.js.map +5 -5
- 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/build.d.ts.map +1 -1
- package/cli/src/commands/dev.d.ts +1 -1
- package/cli/src/commands/dev.d.ts.map +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/images.d.ts +12 -0
- package/cli/src/commands/lib/images.d.ts.map +1 -0
- 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 +3 -3
- package/cli/src/commands/lib/production.d.ts.map +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/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/theme.d.ts +1 -1
- package/cli/src/commands/lib/version.d.ts +1 -1
- package/cli/src/commands/lib/watch.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 +61 -2
- package/core/index.js.map +6 -5
- package/core/src/app-paths.d.ts +1 -1
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +41 -2
- 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/i18n/catalog.d.ts +1 -1
- package/core/src/i18n/discover.d.ts +1 -1
- package/core/src/i18n/index.d.ts +1 -1
- package/core/src/i18n/messages.d.ts +1 -1
- package/core/src/i18n/negotiate.d.ts +1 -1
- package/core/src/i18n/pathname.d.ts +1 -1
- package/core/src/i18n/resolve.d.ts +1 -1
- package/core/src/i18n/types.d.ts +1 -1
- package/core/src/image.d.ts +29 -0
- package/core/src/image.d.ts.map +1 -0
- package/core/src/index.d.ts +2 -1
- package/core/src/index.d.ts.map +1 -1
- package/core/src/llms/discovery.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/cleanup.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/content-path.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/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/route-match.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 +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 +1 -1
- package/core/src/ssr/render.d.ts +1 -1
- package/core/src/ssr/stream.d.ts +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +295 -135
- package/elysia/index.js.map +7 -6
- package/elysia/src/index.d.ts +2 -1
- package/elysia/src/index.d.ts.map +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/i18n.d.ts +1 -1
- package/elysia/src/libs/image.d.ts +30 -1
- package/elysia/src/libs/image.d.ts.map +1 -1
- package/elysia/src/libs/index.d.ts +2 -2
- package/elysia/src/libs/index.d.ts.map +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/routes/artifacts.d.ts +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 +1 -1
- package/elysia/src/routes/liveReloadClient.d.ts +1 -1
- package/elysia/src/routes/llms.d.ts +1 -1
- package/elysia/src/routes/og.d.ts +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 +1 -1
- package/elysia/src/routes/static.d.ts +1 -1
- package/elysia/src/routes/themeCssRefresh.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 +54 -17
- package/react/index.js.map +4 -4
- 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 +5 -1
- package/react/src/components/Image.d.ts.map +1 -1
- package/react/src/components/LazyRoute.d.ts +1 -1
- package/react/src/components/Link.d.ts +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/useFeed.d.ts +1 -1
- package/react/src/hooks/useLayoutData.d.ts +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/i18n/LocaleProvider.d.ts +1 -1
- package/react/src/i18n/helpers.d.ts +1 -1
- package/react/src/i18n/index.d.ts +1 -1
- package/react/src/index.d.ts +1 -1
- package/react/src/lib/bundle.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 +9 -2
- package/react/src/lib/lazy-route.d.ts.map +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/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 +6 -2
- package/telemetry/server.js.map +4 -4
- 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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js v1.0.0-alpha.
|
|
2
|
+
* reroute-js v1.0.0-alpha.23
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Built with Bun <3
|
|
9
9
|
*/
|
|
10
|
+
export { imageCacheIdentity, initImageCache, isImageFile, optimizeImage, preprocessConcurrency, preprocessImages, } from './libs/image';
|
|
10
11
|
export * from './plugin';
|
|
11
12
|
export * from './types';
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/elysia/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../packages/elysia/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,cAAc,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js v1.0.0-alpha.
|
|
2
|
+
* reroute-js v1.0.0-alpha.23
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Built with Bun <3
|
|
9
9
|
*/
|
|
10
|
+
import type { ImagePreprocessFormat } from 'reroute-js/core';
|
|
10
11
|
interface ImageTransformOptions {
|
|
11
12
|
width?: number;
|
|
12
13
|
height?: number;
|
|
@@ -26,10 +27,38 @@ interface ImageOptimizationResult {
|
|
|
26
27
|
* Initialize disk cache directory
|
|
27
28
|
*/
|
|
28
29
|
export declare function initImageCache(cacheDir: string): void;
|
|
30
|
+
/**
|
|
31
|
+
* Identity used in the disk-cache key. Local files are keyed by their
|
|
32
|
+
* `/assets/…` suffix so `src/client/assets` and `.reroute/assets` share
|
|
33
|
+
* the same entries after build-time preprocess.
|
|
34
|
+
*/
|
|
35
|
+
export declare function imageCacheIdentity(imagePath: string): string;
|
|
29
36
|
export declare function optimizeImage(imagePath: string, options: ImageTransformOptions, acceptHeader?: string): Promise<ImageOptimizationResult>;
|
|
30
37
|
/**
|
|
31
38
|
* Check if path is an image file
|
|
32
39
|
*/
|
|
33
40
|
export declare function isImageFile(path: string): boolean;
|
|
41
|
+
type ImagePreprocessRunOptions = {
|
|
42
|
+
assetsDir: string;
|
|
43
|
+
cacheDir: string;
|
|
44
|
+
widths: number[];
|
|
45
|
+
formats: ImagePreprocessFormat[];
|
|
46
|
+
quality: number;
|
|
47
|
+
qualities?: number[];
|
|
48
|
+
concurrency?: number;
|
|
49
|
+
};
|
|
50
|
+
type ImagePreprocessResult = {
|
|
51
|
+
sources: number;
|
|
52
|
+
generated: number;
|
|
53
|
+
cached: number;
|
|
54
|
+
jobs: number;
|
|
55
|
+
concurrency: number;
|
|
56
|
+
};
|
|
57
|
+
export declare function preprocessConcurrency(override?: number): number;
|
|
58
|
+
/**
|
|
59
|
+
* Bake width × format variants into the Sharp disk cache so the first
|
|
60
|
+
* `/__reroute_image` request does not encode on the hot path.
|
|
61
|
+
*/
|
|
62
|
+
export declare function preprocessImages(options: ImagePreprocessRunOptions): Promise<ImagePreprocessResult>;
|
|
34
63
|
export {};
|
|
35
64
|
//# sourceMappingURL=image.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/libs/image.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/libs/image.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAG7D,UAAU,qBAAqB;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;IACnD,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;CAC1D;AAED,UAAU,uBAAuB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACb;AASD;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,QAE9C;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAQ5D;AAgLD,wBAAsB,aAAa,CAClC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,qBAAqB,EAC9B,YAAY,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,uBAAuB,CAAC,CAyElC;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAIjD;AAwBD,KAAK,yBAAyB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,OAAO,EAAE,qBAAqB,EAAE,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACpB,CAAC;AA2EF,wBAAgB,qBAAqB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAK/D;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,yBAAyB,GAChC,OAAO,CAAC,qBAAqB,CAAC,CAoChC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* reroute-js v1.0.0-alpha.
|
|
2
|
+
* reroute-js v1.0.0-alpha.23
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -15,7 +15,7 @@ export { resolveClientDir } from './assets';
|
|
|
15
15
|
export { getEncoding } from './cache';
|
|
16
16
|
export { type BufferCacheEntry, type CacheEntry, type ContentCacheEntry, encodedKey, getIfValid, getOrCompute, isValid, namespacedKey, setWithTTL, type TextCacheEntry, toTTL, type XmlCacheEntry, } from './caching';
|
|
17
17
|
export { jsonError, jsonWithCache } from './http';
|
|
18
|
-
export { isImageFile, optimizeImage } from './image';
|
|
18
|
+
export { imageCacheIdentity, initImageCache, isImageFile, optimizeImage, preprocessConcurrency, preprocessImages, } from './image';
|
|
19
19
|
export { buildLlmsCacheKey, buildLlmsFullCacheKey, buildLlmsIndexCacheKey, type CollectionMeta, type ContentNegotiationConfig, calculateLlmsDefaults, capitalize, cleanPathname, formatByteSize, getCollectionLlmsRoutes, getCollectionMeta, getFormatFromAccept, getRootLlmsRoutes, isLlmsSpecificRoute, type LlmsConfigDefaults, type ParsedContentFormat, parseAcceptHeader, parseContentFormat, shouldEnableContentNegotiation, } from './llms';
|
|
20
20
|
export { buildCacheControl, buildDevCacheControl, type ContentType, createResponse, feedResponse, htmlResponse, jsResponse, markdownResponse, pngResponse, type ResponseOptions, textResponse, xmlResponse, } from './response';
|
|
21
21
|
export { type CachedFileData, getAssetCacheControl, getHashedFileCacheControl, type ServeFileOptions, serveFile, } from './serving';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/libs/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,OAAO,EACP,aAAa,EACb,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,EACL,KAAK,aAAa,GAClB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/elysia/src/libs/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EACN,KAAK,gBAAgB,EACrB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,UAAU,EACV,UAAU,EACV,YAAY,EACZ,OAAO,EACP,aAAa,EACb,UAAU,EACV,KAAK,cAAc,EACnB,KAAK,EACL,KAAK,aAAa,GAClB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,EACN,kBAAkB,EAClB,cAAc,EACd,WAAW,EACX,aAAa,EACb,qBAAqB,EACrB,gBAAgB,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EACN,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,qBAAqB,EACrB,UAAU,EACV,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACxB,iBAAiB,EACjB,kBAAkB,EAClB,8BAA8B,GAC9B,MAAM,QAAQ,CAAC;AAEhB,OAAO,EACN,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,WAAW,EAChB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,KAAK,eAAe,EACpB,YAAY,EACZ,WAAW,GACX,MAAM,YAAY,CAAC;AAEpB,OAAO,EACN,KAAK,cAAc,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,gBAAgB,EACrB,SAAS,GACT,MAAM,WAAW,CAAC"}
|
package/elysia/src/plugin.d.ts
CHANGED
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 v1.0.0-alpha.
|
|
2
|
+
* reroute-js v1.0.0-alpha.23
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -3152,8 +3152,30 @@ import {
|
|
|
3152
3152
|
} from "react";
|
|
3153
3153
|
import { jsx as jsx7, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
3154
3154
|
var DEFAULT_DEVICE_SIZES = [640, 750, 828, 1080, 1200, 1920, 2048, 3840];
|
|
3155
|
+
var DEFAULT_IMAGE_QUALITY = 75;
|
|
3156
|
+
function readImageRuntime() {
|
|
3157
|
+
const value = globalThis.__REROUTE_IMAGE__;
|
|
3158
|
+
if (!value || typeof value !== "object") {
|
|
3159
|
+
return;
|
|
3160
|
+
}
|
|
3161
|
+
const record = value;
|
|
3162
|
+
if (!Array.isArray(record.sizes) || record.sizes.some((size) => typeof size !== "number")) {
|
|
3163
|
+
return;
|
|
3164
|
+
}
|
|
3165
|
+
return {
|
|
3166
|
+
sizes: record.sizes,
|
|
3167
|
+
quality: typeof record.quality === "number" ? record.quality : DEFAULT_IMAGE_QUALITY
|
|
3168
|
+
};
|
|
3169
|
+
}
|
|
3170
|
+
function getImageDeviceSizes() {
|
|
3171
|
+
return readImageRuntime()?.sizes ?? [...DEFAULT_DEVICE_SIZES];
|
|
3172
|
+
}
|
|
3173
|
+
function getImageQuality() {
|
|
3174
|
+
return readImageRuntime()?.quality ?? DEFAULT_IMAGE_QUALITY;
|
|
3175
|
+
}
|
|
3155
3176
|
function generateSrcSet(src, width, quality, format, loader) {
|
|
3156
|
-
const
|
|
3177
|
+
const deviceSizes = getImageDeviceSizes();
|
|
3178
|
+
const sizes = width ? deviceSizes.filter((size) => size <= width * 2) : deviceSizes;
|
|
3157
3179
|
if (sizes.length === 0 || !width) {
|
|
3158
3180
|
return "";
|
|
3159
3181
|
}
|
|
@@ -3187,7 +3209,7 @@ function Image({
|
|
|
3187
3209
|
src,
|
|
3188
3210
|
width,
|
|
3189
3211
|
height,
|
|
3190
|
-
quality
|
|
3212
|
+
quality,
|
|
3191
3213
|
format = "auto",
|
|
3192
3214
|
sizes,
|
|
3193
3215
|
priority = false,
|
|
@@ -3215,7 +3237,7 @@ function Image({
|
|
|
3215
3237
|
const imgRef = useRef2(null);
|
|
3216
3238
|
const numWidth = typeof width === "string" ? parseInt(width, 10) : width;
|
|
3217
3239
|
const numHeight = typeof height === "string" ? parseInt(height, 10) : height;
|
|
3218
|
-
const numQuality = typeof quality === "string" ? parseInt(quality, 10) : quality
|
|
3240
|
+
const numQuality = typeof quality === "string" ? parseInt(quality, 10) : quality ?? getImageQuality();
|
|
3219
3241
|
const imageUrl = loader ? loader({ src, width: numWidth || 0, quality: numQuality, format }) : numWidth ? defaultLoader({ src, width: numWidth, quality: numQuality, format }) : src;
|
|
3220
3242
|
useEffect9(() => {
|
|
3221
3243
|
const img = imgRef.current;
|
|
@@ -3771,14 +3793,22 @@ function getCapturedRouteHtml() {
|
|
|
3771
3793
|
return null;
|
|
3772
3794
|
}
|
|
3773
3795
|
}
|
|
3774
|
-
function
|
|
3796
|
+
function shouldReuseCapturedRouteHtml() {
|
|
3797
|
+
if (!isBrowser3)
|
|
3798
|
+
return false;
|
|
3775
3799
|
try {
|
|
3776
|
-
|
|
3800
|
+
const g = globalThis;
|
|
3801
|
+
if (!g.__REROUTE_INITIAL_HYDRATION__)
|
|
3802
|
+
return false;
|
|
3803
|
+
const ssrPath = g.__REROUTE_SSR_PATHNAME__;
|
|
3804
|
+
if (typeof ssrPath !== "string")
|
|
3805
|
+
return false;
|
|
3806
|
+
return window.location.pathname === ssrPath;
|
|
3777
3807
|
} catch {
|
|
3778
3808
|
return false;
|
|
3779
3809
|
}
|
|
3780
3810
|
}
|
|
3781
|
-
function createLazyRoute(lazyImport, routePattern, serverComponent) {
|
|
3811
|
+
function createLazyRoute(lazyImport, routePattern, serverComponent, Fallback) {
|
|
3782
3812
|
if (!isBrowser3) {
|
|
3783
3813
|
let ServerRoute = function(props) {
|
|
3784
3814
|
return createElement("div", {
|
|
@@ -3798,8 +3828,6 @@ function createLazyRoute(lazyImport, routePattern, serverComponent) {
|
|
|
3798
3828
|
const LazyComp = lazy(lazyImport);
|
|
3799
3829
|
function ClientRoute(props) {
|
|
3800
3830
|
const [Resolved, setResolved] = useState10(null);
|
|
3801
|
-
const initialHydration = isInitialHydration3();
|
|
3802
|
-
const capturedHtml = initialHydration ? getCapturedRouteHtml() : null;
|
|
3803
3831
|
useEffect10(() => {
|
|
3804
3832
|
let alive = true;
|
|
3805
3833
|
lazyImport().then((mod) => {
|
|
@@ -3813,13 +3841,19 @@ function createLazyRoute(lazyImport, routePattern, serverComponent) {
|
|
|
3813
3841
|
if (Resolved) {
|
|
3814
3842
|
return createElement(Resolved, props);
|
|
3815
3843
|
}
|
|
3816
|
-
if (
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3844
|
+
if (shouldReuseCapturedRouteHtml()) {
|
|
3845
|
+
const capturedHtml = getCapturedRouteHtml();
|
|
3846
|
+
if (capturedHtml) {
|
|
3847
|
+
return createElement("div", {
|
|
3848
|
+
"data-reroute-route": "ssr",
|
|
3849
|
+
style: { display: "contents" },
|
|
3850
|
+
suppressHydrationWarning: true,
|
|
3851
|
+
dangerouslySetInnerHTML: { __html: capturedHtml }
|
|
3852
|
+
});
|
|
3853
|
+
}
|
|
3854
|
+
}
|
|
3855
|
+
if (Fallback) {
|
|
3856
|
+
return createElement(Fallback);
|
|
3823
3857
|
}
|
|
3824
3858
|
return createElement(Suspense, { fallback: null }, createElement(LazyComp, props));
|
|
3825
3859
|
}
|
|
@@ -3854,6 +3888,8 @@ export {
|
|
|
3854
3888
|
createTranslator,
|
|
3855
3889
|
dispatchDataEvent,
|
|
3856
3890
|
fetchRouteData,
|
|
3891
|
+
getImageDeviceSizes,
|
|
3892
|
+
getImageQuality,
|
|
3857
3893
|
getRerouteDataStore,
|
|
3858
3894
|
isModifiedClick,
|
|
3859
3895
|
localizeContentHref,
|
|
@@ -3872,6 +3908,7 @@ export {
|
|
|
3872
3908
|
readInjectedBundle,
|
|
3873
3909
|
readServerBundle,
|
|
3874
3910
|
resolveBundleField,
|
|
3911
|
+
shouldReuseCapturedRouteHtml,
|
|
3875
3912
|
shouldSkipInterception,
|
|
3876
3913
|
storeAndDispatchData,
|
|
3877
3914
|
t,
|
|
@@ -3895,4 +3932,4 @@ export {
|
|
|
3895
3932
|
useToc
|
|
3896
3933
|
};
|
|
3897
3934
|
|
|
3898
|
-
//# debugId=
|
|
3935
|
+
//# debugId=671BEE3857AA622464756E2164756E21
|