@absolutejs/absolute 0.20.0-beta.169 → 0.20.0-beta.170
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/CHANGELOG.md +80 -0
- package/README.md +232 -0
- package/changelog.json +228 -0
- package/dist/angular/browser.js +7 -8
- package/dist/angular/browser.js.map +6 -5
- package/dist/angular/components/core/streamingSlotRegistrar.js +6 -2
- package/dist/angular/components/core/streamingSlotRegistry.js +7 -3
- package/dist/angular/index.js +555 -156
- package/dist/angular/index.js.map +29 -23
- package/dist/angular/server.js +555 -156
- package/dist/angular/server.js.map +29 -23
- package/dist/build/buildWorker.js +14 -8
- package/dist/build.js +4949 -1941
- package/dist/build.js.map +72 -42
- package/dist/cli/{add-7azr0c83.js → add-6a7pjkn9.js} +11 -7
- package/dist/cli/{analyze-3cyek6v3.js → analyze-606fshwa.js} +1 -1
- package/dist/cli/{build-25rz8v25.js → build-g81xqbb9.js} +1 -1
- package/dist/cli/{compile-4jnfxts9.js → compile-9y1w9zpj.js} +3 -3
- package/dist/cli/config/server.js +10699 -1538
- package/dist/cli/{dev-9tk5hn2e.js → dev-hyeb89hp.js} +5 -1
- package/dist/cli/{doctor-4nv2c2j3.js → doctor-h55y9hj1.js} +1 -1
- package/dist/cli/{generate-v75p2fct.js → generate-20x1pkf7.js} +4 -4
- package/dist/cli/{htmx-427swtdz.js → htmx-6mz2h7k1.js} +2 -2
- package/dist/cli/{index-bhbs6d5z.js → index-32ge2w1f.js} +12 -4
- package/dist/cli/{index-a4ws2jwd.js → index-3wz3mktm.js} +1 -1
- package/dist/cli/{index-b7hjgknf.js → index-9sksd8c8.js} +13 -4
- package/dist/cli/{index-eyzwc7gz.js → index-qbrzvmh9.js} +4 -2
- package/dist/cli/index-qw98g1p6.js +269 -0
- package/dist/cli/{index-434b7j4a.js → index-vtp20gwf.js} +69 -1
- package/dist/cli/{index-h7qhz02e.js → index-wk0pyxrg.js} +3 -0
- package/dist/cli/{index-k3y8cb6c.js → index-z6f43b20.js} +1 -1
- package/dist/cli/index.js +16 -16
- package/dist/cli/{islands-8sgky9gh.js → islands-dc54e5y1.js} +1 -1
- package/dist/cli/{ls-4m4yqwww.js → ls-b6zz24nt.js} +1 -1
- package/dist/cli/{mobile-hcxjr2gf.js → mobile-ajnnvqtv.js} +3 -3
- package/dist/cli/prerender-fqpp0m1j.js +10 -0
- package/dist/cli/{remove-1ycjx85k.js → remove-t8x1mrxg.js} +4 -4
- package/dist/cli/{start-mbaejxhm.js → start-d6p831ny.js} +3 -3
- package/dist/cli/{typecheck-dr068pmh.js → typecheck-stbt0qt5.js} +6 -1
- package/dist/cli/{workspace-1sycp9g1.js → workspace-61hh6jq1.js} +1 -1
- package/dist/client/chunks/index-6b66nzyf.js +381 -0
- package/dist/client/chunks/index-6b66nzyf.js.map +11 -0
- package/dist/client/chunks/{islands-rc28k5sx.js → islands-s2ta5ajb.js} +5 -2
- package/dist/client/chunks/{islands-rc28k5sx.js.map → islands-s2ta5ajb.js.map} +7 -6
- package/dist/client/index.js +160 -3
- package/dist/client/index.js.map +6 -4
- package/dist/client/navigation.js +764 -0
- package/dist/client/navigation.js.map +10 -0
- package/dist/client/prefetch.js +33 -375
- package/dist/client/prefetch.js.map +3 -4
- package/dist/core/streamingSlotRegistrar.js +5 -2
- package/dist/core/streamingSlotRegistrar.js.map +5 -4
- package/dist/core/streamingSlotRegistry.js +5 -2
- package/dist/core/streamingSlotRegistry.js.map +5 -4
- package/dist/dev/client/cspNonce.ts +28 -0
- package/dist/dev/client/handlers/html.ts +4 -3
- package/dist/dev/client/handlers/htmx.ts +3 -2
- package/dist/dev/client/handlers/svelte.ts +15 -90
- package/dist/dev/client/syncDevtools.ts +2 -1
- package/dist/dev/serverBootstrap.js +11 -4
- package/dist/i18n/index.js +543 -0
- package/dist/i18n/index.js.map +15 -0
- package/dist/index.js +6339 -2233
- package/dist/index.js.map +89 -54
- package/dist/islands/index.js +282 -40
- package/dist/islands/index.js.map +14 -10
- package/dist/mobile/browser.js +7 -2
- package/dist/mobile/browser.js.map +5 -4
- package/dist/mobile/index.js +7 -2
- package/dist/mobile/index.js.map +5 -4
- package/dist/mobile/remoteMacAgentEntry.js +1 -1
- package/dist/react/components/browser/index.js +94 -4
- package/dist/react/components/index.js +150 -10
- package/dist/react/components/index.js.map +15 -10
- package/dist/react/hooks/index.js +479 -13
- package/dist/react/hooks/index.js.map +12 -4
- package/dist/react/index.js +769 -166
- package/dist/react/index.js.map +32 -21
- package/dist/react/router/browser.js +21 -4
- package/dist/react/router/browser.js.map +5 -4
- package/dist/react/router/index.js +21 -4
- package/dist/react/router/index.js.map +5 -4
- package/dist/react/server.js +597 -203
- package/dist/react/server.js.map +25 -15
- package/dist/src/angular/zoneRuntime.d.ts +5 -0
- package/dist/src/build/buildReactServerComponents.d.ts +22 -0
- package/dist/src/build/downlevelAsyncForZone.d.ts +1 -0
- package/dist/src/build/fileRoutes.d.ts +65 -0
- package/dist/src/build/fonts/buildFonts.d.ts +25 -0
- package/dist/src/build/fonts/fallbackMetrics.d.ts +13 -0
- package/dist/src/build/fonts/googleFonts.d.ts +18 -0
- package/dist/src/build/fonts/injectFontTags.d.ts +7 -0
- package/dist/src/build/fonts/parseFontMetrics.d.ts +4 -0
- package/dist/src/build/generateReactIndexes.d.ts +7 -1
- package/dist/src/build/htmlIncludes.d.ts +16 -0
- package/dist/src/build/inlineSourceMapComment.d.ts +1 -0
- package/dist/src/build/scanConventions.d.ts +3 -0
- package/dist/src/build/vitals.d.ts +21 -0
- package/dist/src/client/formActions.d.ts +29 -0
- package/dist/src/client/index.d.ts +2 -0
- package/dist/src/client/navigation.d.ts +16 -0
- package/dist/src/client/prefetch.d.ts +2 -30
- package/dist/src/core/build.d.ts +2 -2
- package/dist/src/core/cspNonce.d.ts +12 -0
- package/dist/src/core/fileRouteAdapter.d.ts +15 -0
- package/dist/src/core/fileRoutes.d.ts +5 -0
- package/dist/src/core/formActionFlash.d.ts +25 -0
- package/dist/src/core/formActions.d.ts +249 -0
- package/dist/src/core/index.d.ts +5 -0
- package/dist/src/core/partialPrerender.d.ts +28 -0
- package/dist/src/core/partialPrerenderServe.d.ts +24 -0
- package/dist/src/core/precompressed.d.ts +11 -1
- package/dist/src/core/prerenderNonce.d.ts +9 -0
- package/dist/src/core/productionRuntime.d.ts +4 -2
- package/dist/src/core/serverOnlyStaticFiles.d.ts +8 -0
- package/dist/src/core/staticHtmlNonce.d.ts +2 -0
- package/dist/src/core/vitals.d.ts +108 -0
- package/dist/src/dev/angular/fastHmrCompiler.d.ts +1 -1
- package/dist/src/dev/client/cspNonce.d.ts +2 -0
- package/dist/src/dev/fileRouteRefresher.d.ts +5 -0
- package/dist/src/dev/importCost/instrument.d.ts +1 -1
- package/dist/src/dev/reactServerComponentsRebuild.d.ts +3 -0
- package/dist/src/i18n/defineMessages.d.ts +5 -0
- package/dist/src/i18n/formatMessage.d.ts +26 -0
- package/dist/src/i18n/index.d.ts +6 -0
- package/dist/src/i18n/intlCache.d.ts +5 -0
- package/dist/src/i18n/routing.d.ts +28 -0
- package/dist/src/i18n/translator.d.ts +11 -0
- package/dist/src/mobile/androidRelease.d.ts +2 -2
- package/dist/src/mobile/iosRelease.d.ts +4 -4
- package/dist/src/mobile/materializedBundle.d.ts +1 -1
- package/dist/src/mobile/mobileInspect.d.ts +1 -1
- package/dist/src/mobile/releaseArtifact.d.ts +2 -2
- package/dist/src/mobile/remoteMacProtocol.d.ts +2 -2
- package/dist/src/plugins/i18n.d.ts +30 -0
- package/dist/src/plugins/index.d.ts +2 -1
- package/dist/src/plugins/secureHeaders.d.ts +48 -0
- package/dist/src/react/components/Head.d.ts +1 -1
- package/dist/src/react/components/StreamSlot.browser.d.ts +1 -0
- package/dist/src/react/components/StreamSlot.d.ts +5 -1
- package/dist/src/react/components/SuspenseSlot.browser.d.ts +2 -0
- package/dist/src/react/components/SuspenseSlot.d.ts +12 -0
- package/dist/src/react/fileRoute.d.ts +18 -0
- package/dist/src/react/hooks/index.d.ts +4 -0
- package/dist/src/react/hooks/useFormAction.d.ts +42 -0
- package/dist/src/react/hooks/useI18n.d.ts +15 -0
- package/dist/src/react/index.d.ts +2 -0
- package/dist/src/react/server.d.ts +2 -0
- package/dist/src/react/serverComponents/constants.d.ts +11 -0
- package/dist/src/react/serverComponents/flightPayload.d.ts +2 -0
- package/dist/src/react/serverComponents/pageHandler.d.ts +14 -0
- package/dist/src/svelte/browser.d.ts +1 -0
- package/dist/src/svelte/fileRoute.d.ts +15 -0
- package/dist/src/svelte/i18n.d.ts +8 -0
- package/dist/src/svelte/index.d.ts +2 -0
- package/dist/src/svelte/lowerAwaitSlotSyntax.d.ts +5 -1
- package/dist/src/svelte/renderToReadableStream.d.ts +10 -2
- package/dist/src/svelte/router/browser.d.ts +3 -1
- package/dist/src/svelte/router/goto.d.ts +13 -10
- package/dist/src/svelte/router/guards.d.ts +43 -0
- package/dist/src/svelte/router/index.d.ts +3 -1
- package/dist/src/svelte/router/lazy.d.ts +17 -0
- package/dist/src/svelte/router/lazyModule.d.ts +29 -0
- package/dist/src/svelte/router/navigation.d.ts +55 -0
- package/dist/src/svelte/router/pushState.d.ts +4 -2
- package/dist/src/svelte/router/scroll.d.ts +34 -0
- package/dist/src/svelte/routerSsr.d.ts +9 -0
- package/dist/src/svelte/server.d.ts +1 -0
- package/dist/src/utils/cspNonceRef.d.ts +8 -0
- package/dist/src/utils/fontAssets.d.ts +17 -0
- package/dist/src/utils/formActionProtocol.d.ts +10 -0
- package/dist/src/utils/generateHeadElement.d.ts +1 -1
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/inlinePageCss.d.ts +18 -0
- package/dist/src/utils/loadConfig.d.ts +5 -0
- package/dist/src/utils/localeRef.d.ts +10 -0
- package/dist/src/utils/resolveConvention.d.ts +6 -1
- package/dist/src/utils/streamingSlots.d.ts +5 -0
- package/dist/src/vue/browser.d.ts +2 -0
- package/dist/src/vue/components/Image.d.ts +2 -2
- package/dist/src/vue/index.d.ts +2 -0
- package/dist/src/vue/serverDataPayload.d.ts +32 -0
- package/dist/src/vue/serverDataState.d.ts +9 -0
- package/dist/src/vue/useServerData.browser.d.ts +6 -0
- package/dist/src/vue/useServerData.d.ts +24 -0
- package/dist/svelte/browser.js +330 -3
- package/dist/svelte/browser.js.map +8 -4
- package/dist/svelte/components/AwaitSlot.svelte +5 -0
- package/dist/svelte/components/Head.svelte +50 -0
- package/dist/svelte/components/JsonLd.svelte +9 -1
- package/dist/svelte/components/StreamSlot.svelte +5 -0
- package/dist/svelte/index.js +1017 -117
- package/dist/svelte/index.js.map +38 -24
- package/dist/svelte/router/Link.svelte +40 -8
- package/dist/svelte/router/Route.svelte +157 -12
- package/dist/svelte/router/Route.svelte.d.ts +39 -5
- package/dist/svelte/router/Router.svelte +140 -25
- package/dist/svelte/router/Router.svelte.d.ts +5 -1
- package/dist/svelte/router/browser.ts +10 -0
- package/dist/svelte/router/goto.ts +15 -86
- package/dist/svelte/router/guards.ts +112 -0
- package/dist/svelte/router/index.ts +10 -0
- package/dist/svelte/router/lazy.ts +82 -0
- package/dist/svelte/router/lazyModule.ts +74 -0
- package/dist/svelte/router/navigation.ts +412 -0
- package/dist/svelte/router/pushState.ts +7 -4
- package/dist/svelte/router/scroll.ts +286 -0
- package/dist/svelte/server.js +747 -252
- package/dist/svelte/server.js.map +30 -20
- package/dist/types/angular.d.ts +2 -0
- package/dist/types/build.d.ts +37 -0
- package/dist/types/conventions.d.ts +3 -0
- package/dist/types/fileRoutes.d.ts +72 -0
- package/dist/types/fonts.d.ts +86 -0
- package/dist/types/formAction.d.ts +54 -0
- package/dist/types/globals.d.ts +10 -0
- package/dist/types/i18n.d.ts +185 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/metadata.d.ts +11 -0
- package/dist/types/navigation.d.ts +37 -0
- package/dist/types/prefetch.d.ts +10 -0
- package/dist/types/sitemap.d.ts +4 -0
- package/dist/types/svelteRouter.d.ts +89 -2
- package/dist/types/svelteRouter.ts +112 -2
- package/dist/types/vue.d.ts +46 -1
- package/dist/utils/iconVersion.ts +34 -0
- package/dist/vue/browser.js +107 -11
- package/dist/vue/browser.js.map +7 -4
- package/dist/vue/components/index.js +5 -2
- package/dist/vue/components/index.js.map +5 -4
- package/dist/vue/index.js +712 -158
- package/dist/vue/index.js.map +32 -23
- package/dist/vue/server.js +310 -79
- package/dist/vue/server.js.map +20 -15
- package/package.json +9 -1
- package/dist/cli/prerender-mfnwsvyt.js +0 -7
- package/dist/src/plugins/pageRouter.d.ts +0 -1
- /package/dist/cli/{index-j7m8pq48.js → index-rervww4p.js} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Component } from 'svelte';
|
|
2
|
+
export type LazyComponent = Component<Record<string, unknown>>;
|
|
3
|
+
/** `globalThis` record of `route pattern → module` that the hydration
|
|
4
|
+
* entry fills before it hydrates a page whose server render included lazy
|
|
5
|
+
* routes. Compiled client modules fill a sibling registry,
|
|
6
|
+
* `Symbol.for('absolutejs.svelte.lazy-modules')`, of `source id →
|
|
7
|
+
* () => import(chunk)` for every `.svelte` file they import dynamically
|
|
8
|
+
* (see {@link lazyModuleRegistration}). */
|
|
9
|
+
export declare const LAZY_RESOLVED_KEY: unique symbol;
|
|
10
|
+
/** Export (and component property) the Svelte compiler adds to every
|
|
11
|
+
* compiled component: the component's source path, relative to the
|
|
12
|
+
* project root. The server records it for each lazy route it rendered so
|
|
13
|
+
* the browser can load the same module before hydrating. */
|
|
14
|
+
export declare const LAZY_SOURCE_EXPORT = "__ABSOLUTE_SVELTE_SOURCE__";
|
|
15
|
+
/** The component a loader resolved to: a module namespace's `default`, or
|
|
16
|
+
* the value itself when the loader already unwrapped it. */
|
|
17
|
+
export declare const toLazyComponent: (value: unknown) => LazyComponent | undefined;
|
|
18
|
+
/** The statement a compiled client module appends for each `.svelte` file
|
|
19
|
+
* it imports dynamically, registering `source id → () => import(chunk)`,
|
|
20
|
+
* so the hydration entry can load the module a lazy route rendered on the
|
|
21
|
+
* server before it hydrates. Used by the build (compileSvelte) and the dev
|
|
22
|
+
* module server. */
|
|
23
|
+
export declare const lazyModuleRegistration: (sourceId: string, specifier: string) => string;
|
|
24
|
+
/** The compiler-stamped source id of a loader result, from the module
|
|
25
|
+
* namespace or from the component itself. */
|
|
26
|
+
export declare const readLazySource: (value: unknown) => string | undefined;
|
|
27
|
+
/** The module the hydration entry loaded for `pattern` before hydrating,
|
|
28
|
+
* if any. */
|
|
29
|
+
export declare const readSeededLazy: (pattern: string) => LazyComponent | undefined;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { GotoOptions, NavigationOutcome, NavigationType, RouteGuard, RouterMode, ScrollPosition } from '../../../types/svelteRouter';
|
|
2
|
+
import { type GuardEntry } from './guards';
|
|
3
|
+
export type RouterNavigationHandle = {
|
|
4
|
+
/** Guards that apply when navigating to `url`, outermost first. */
|
|
5
|
+
guardsFor: (url: URL) => GuardEntry[];
|
|
6
|
+
/** Whether one of this router's routes matches `url`. */
|
|
7
|
+
matches: (url: URL) => boolean;
|
|
8
|
+
/** Start loading the lazy route `url` would render, if any. */
|
|
9
|
+
preload: (url: URL) => void;
|
|
10
|
+
};
|
|
11
|
+
/** @internal Router.svelte: make a router's guards and lazy routes
|
|
12
|
+
* visible to navigation. Returns the deregistration. */
|
|
13
|
+
export declare const registerRouter: (handle: RouterNavigationHandle) => () => void;
|
|
14
|
+
/** @internal Router.svelte: which URL strategy goto() writes. */
|
|
15
|
+
export declare const setRouterMode: (mode: RouterMode) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Run `guard` before every client-side navigation (`<Link>`, `goto()`,
|
|
18
|
+
* back/forward). Return `false` to cancel, a URL (or `redirect(...)`) to
|
|
19
|
+
* redirect, nothing to allow. Called during component initialisation it
|
|
20
|
+
* is removed when the component is destroyed; otherwise call the returned
|
|
21
|
+
* function to remove it.
|
|
22
|
+
*
|
|
23
|
+
* Browser-only: it doesn't run during the server render. Put checks the
|
|
24
|
+
* server must enforce (auth, a 302 on the first request) on
|
|
25
|
+
* `<Router guard>` or `<Route guard>` instead.
|
|
26
|
+
*/
|
|
27
|
+
export declare const beforeNavigate: (guard: RouteGuard) => () => void;
|
|
28
|
+
/** Start loading the lazy route component `href` would render, through
|
|
29
|
+
* every mounted router. Used by `<Link>` prefetching. */
|
|
30
|
+
export declare const preloadRoute: (href: string) => void;
|
|
31
|
+
/**
|
|
32
|
+
* @internal Link.svelte: whether a click on `href` belongs to cross-framework
|
|
33
|
+
* document navigation rather than this router. True only when
|
|
34
|
+
* `enableNavigation()` is active, the router uses history mode, and no
|
|
35
|
+
* mounted `<Router>` has a route for the URL: the link points at another
|
|
36
|
+
* page (possibly another framework's), so `<Link>` leaves the click to the
|
|
37
|
+
* browser and the navigation layer swaps that page in.
|
|
38
|
+
*/
|
|
39
|
+
export declare const belongsToDocumentNavigation: (href: string) => boolean;
|
|
40
|
+
/** @internal `goto()` and `<Link>`: guarded client-side navigation. */
|
|
41
|
+
export declare const navigate: (target: string, options: GotoOptions, type: NavigationType) => Promise<NavigationOutcome>;
|
|
42
|
+
/** @internal Router.svelte (hash mode): guards for the first client
|
|
43
|
+
* render, which the server could not run because it never sees the
|
|
44
|
+
* hash. A redirect replaces the entry; a cancel is ignored (there is no
|
|
45
|
+
* previous page to stay on). */
|
|
46
|
+
export declare const enterInitialRoute: (url: URL) => Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* @internal Router.svelte: a `popstate` landed. `url` is the routable URL
|
|
49
|
+
* of the entry it landed on (hash mode already resolved). Runs the guards;
|
|
50
|
+
* a cancel puts the previous URL back, a redirect replaces the entry.
|
|
51
|
+
*/
|
|
52
|
+
export declare const handleTraversal: (state: unknown, url: URL) => Promise<void>;
|
|
53
|
+
/** @internal Router.svelte: restore the position saved in the entry the
|
|
54
|
+
* page loaded on (reload, or back/forward into this document). */
|
|
55
|
+
export declare const restoreInitialScroll: (position: ScrollPosition) => Promise<void>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shallow routing: update the URL bar and `page.state` without re-running
|
|
3
|
-
* `<Route>` matching. Useful for modals / drawers /
|
|
4
|
-
* shareable URL without swapping the active route's
|
|
3
|
+
* `<Route>` matching, guards or scrolling. Useful for modals / drawers /
|
|
4
|
+
* overlays that want a shareable URL without swapping the active route's
|
|
5
|
+
* content. The scroll position of the entry being left is saved, so
|
|
6
|
+
* going back restores it.
|
|
5
7
|
*
|
|
6
8
|
* Mirrors SvelteKit's `pushState` from `$app/navigation`.
|
|
7
9
|
*/
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { RouterHistoryMeta, ScrollPosition } from '../../../types/svelteRouter';
|
|
2
|
+
export declare const readHistoryMeta: (state: unknown) => RouterHistoryMeta | undefined;
|
|
3
|
+
/** The state the application stored (via `goto({ state })`, `pushState`,
|
|
4
|
+
* …), without the router's bookkeeping. */
|
|
5
|
+
export declare const readUserState: (state: unknown) => unknown;
|
|
6
|
+
/** Adopt the entry a `popstate` landed on as the current one. Entries the
|
|
7
|
+
* router didn't write (a plain `<a href="#x">` click, say) get stamped. */
|
|
8
|
+
export declare const adoptHistoryEntry: (state: unknown) => RouterHistoryMeta;
|
|
9
|
+
/** The full URL (hash included) of the entry the router currently shows. */
|
|
10
|
+
export declare const currentCommittedHref: () => string | undefined;
|
|
11
|
+
/** The entry the router currently shows. */
|
|
12
|
+
export declare const currentHistoryEntry: () => RouterHistoryMeta | undefined;
|
|
13
|
+
/** Record the live scroll position for the current entry, in memory and in
|
|
14
|
+
* the entry's `history.state`, so it survives a reload. */
|
|
15
|
+
export declare const persistScroll: () => void;
|
|
16
|
+
/** Record the live scroll position for the current entry (in memory). */
|
|
17
|
+
export declare const rememberScroll: () => void;
|
|
18
|
+
/** Where the user was when they last left `meta`'s entry, if known. */
|
|
19
|
+
export declare const savedScrollFor: (meta: RouterHistoryMeta) => ScrollPosition | undefined;
|
|
20
|
+
/** Make sure the entry the page loaded on carries router bookkeeping, and
|
|
21
|
+
* adopt it as the current one. Returns its meta. */
|
|
22
|
+
export declare const stampInitialEntry: () => RouterHistoryMeta;
|
|
23
|
+
/** Write a new entry (`push`) or replace the current one, saving the
|
|
24
|
+
* scroll position of the entry being left first. */
|
|
25
|
+
export declare const writeHistoryEntry: (href: string, user: unknown, mode: "push" | "replace") => RouterHistoryMeta;
|
|
26
|
+
/** Take over scroll restoration from the browser while a router is
|
|
27
|
+
* mounted: `history.scrollRestoration = 'manual'`, track the scroll
|
|
28
|
+
* position of the current entry, and persist it on `pagehide`. Returns
|
|
29
|
+
* the cleanup that hands control back. */
|
|
30
|
+
export declare const activateScrollRestoration: () => () => void;
|
|
31
|
+
/** Scroll the `#hash` target into view. Returns whether one was found —
|
|
32
|
+
* `#` and `#top` scroll to the top, as browsers do. */
|
|
33
|
+
export declare const scrollToHash: (hash: string) => boolean;
|
|
34
|
+
export declare const scrollToPosition: (position: ScrollPosition) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Context key the router reads (Router.svelte / Route.svelte use the
|
|
2
|
+
* same `Symbol.for` name). */
|
|
3
|
+
export declare const SVELTE_ROUTER_SSR_CONTEXT_KEY: unique symbol;
|
|
4
|
+
export declare const createSvelteRouterSsr: (request: Request | undefined) => {
|
|
5
|
+
bootstrapScript: () => string;
|
|
6
|
+
context: Map<unknown, unknown>;
|
|
7
|
+
response: () => Response | undefined;
|
|
8
|
+
settle: () => Promise<boolean>;
|
|
9
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** ` nonce="…"` for an inline <script>/<style> tag, or '' without one. */
|
|
2
|
+
export declare const nonceAttr: (nonce?: string | undefined) => string;
|
|
3
|
+
/** Adds the nonce to the <style id="svelte-…"> tags Svelte renders into the
|
|
4
|
+
* head for components compiled with injected CSS. Only those: a <style>
|
|
5
|
+
* that arrived through {@html} stays without one. */
|
|
6
|
+
export declare const nonceSvelteHeadStyles: (head: string, nonce?: string | undefined) => string;
|
|
7
|
+
export declare const readCspNonce: () => string | undefined;
|
|
8
|
+
export declare const registerCspNonceGetter: (getter: () => string | undefined) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FontAssets } from '../../types/fonts';
|
|
2
|
+
export declare const FONT_PRELOAD_MANIFEST_PREFIX = "AbsoluteFontPreload";
|
|
3
|
+
export declare const FONTS_CSS_MANIFEST_KEY = "AbsoluteFontsCSS";
|
|
4
|
+
export declare const FONTS_REMOTE_CSS_MANIFEST_PREFIX = "AbsoluteFontsRemoteCSS";
|
|
5
|
+
/** The font stylesheet(s) and preloads the build produced from the `fonts`
|
|
6
|
+
* config, read from the manifest. Pass the result to `Head`'s or
|
|
7
|
+
* `generateHeadElement`'s `fonts` option. Empty when no fonts are
|
|
8
|
+
* configured. Plain data, safe to pass as a page prop. */
|
|
9
|
+
export declare const fontAssets: (manifest: Record<string, string>) => FontAssets;
|
|
10
|
+
export declare const fontMimeType: (href: string) => string;
|
|
11
|
+
/** Origins a font stylesheet loads from, for `preconnect` hints. Only
|
|
12
|
+
* remote (fallback) stylesheets need them. */
|
|
13
|
+
export declare const fontPreconnectOrigins: (fonts: FontAssets) => string[];
|
|
14
|
+
/** `<link>` tags for a page's `<head>`: preconnects (remote fallback only),
|
|
15
|
+
* font preloads, then the stylesheets. All linked, never inline, so they
|
|
16
|
+
* work under a strict Content-Security-Policy. */
|
|
17
|
+
export declare const renderFontTags: (fonts: FontAssets) => string[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ActionResult } from '../../types/formAction';
|
|
2
|
+
export declare const ACTION_ERROR_ATTRIBUTE = "data-action-error";
|
|
3
|
+
export declare const ACTION_FORM_ATTRIBUTE = "data-absolute-action";
|
|
4
|
+
export declare const ACTION_MESSAGE_ATTRIBUTE = "data-action-message";
|
|
5
|
+
export declare const ACTION_REQUEST_HEADER = "x-absolute-action";
|
|
6
|
+
export declare const ACTION_STATUS_ATTRIBUTE = "data-action-status";
|
|
7
|
+
export declare const ACTION_SUCCESS_ATTRIBUTE = "data-action-success";
|
|
8
|
+
/** True for a well-formed action result. The type parameters let callers
|
|
9
|
+
* name the action's data and fields; only the shape is checked. */
|
|
10
|
+
export declare const isActionResult: <Data = unknown, Fields extends string = string>(value: unknown) => value is ActionResult<Data, Fields>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Metadata, SpeculationRules } from '../../types/metadata';
|
|
2
|
-
export declare const generateHeadElement: ({ cssPath, title, description, font, icon, canonical, openGraph, twitter, robots, meta, jsonLd, preload, speculationRules }?: Metadata) => `<head>
|
|
2
|
+
export declare const generateHeadElement: ({ cssPath, title, description, font, fonts, icon, canonical, alternates, openGraph, twitter, robots, meta, jsonLd, preload, speculationRules }?: Metadata) => `<head>
|
|
3
3
|
${string}
|
|
4
4
|
</head>`;
|
|
5
5
|
/** Serialize declarative speculation rules to the JSON body of a
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/** Read the per-page compiled CSS sidecar that the build emitted next to
|
|
2
|
+
* the SSR JS, and splice it into the SSR head as an inline <style>
|
|
3
|
+
* block. Used by each framework's page handler so scoped/per-page
|
|
4
|
+
* styles are present on first paint instead of loading client-side
|
|
5
|
+
* after hydration (which produces a one-frame flash of unstyled
|
|
6
|
+
* chrome — sidebar/logo/cards).
|
|
7
|
+
*
|
|
8
|
+
* The CSS sidecar is written by `core/build.ts` after the server and
|
|
9
|
+
* CSS Bun.build passes finish: for each SSR JS output, a `.css` file
|
|
10
|
+
* with the same basename + hash is placed beside it. The handler
|
|
11
|
+
* derives the sidecar path from the SSR JS path it already has
|
|
12
|
+
* (`pagePath` / `index`) so there's no manifest lookup, no extra
|
|
13
|
+
* argument the user must thread through, and no chance of getting
|
|
14
|
+
* the URL hash wrong.
|
|
15
|
+
*
|
|
16
|
+
* Content-hashed filenames mean the sidecar is immutable for the
|
|
17
|
+
* lifetime of a build, so the read is memoised by absolute path and
|
|
18
|
+
* the handler hits `readFile` at most once per page per process. */
|
|
1
19
|
/** Drop every memoised sibling-CSS read (including cached misses). The dev
|
|
2
20
|
* server calls this after rebuilding page bundles: a request landing
|
|
3
21
|
* mid-rebuild can otherwise cache '' for a freshly hashed path whose
|
|
@@ -10,9 +10,11 @@ export declare const loadConfig: (configPath?: string) => Promise<{
|
|
|
10
10
|
bootstrap?: string;
|
|
11
11
|
};
|
|
12
12
|
reactDirectory?: string;
|
|
13
|
+
reactServerComponentsDirectory?: string;
|
|
13
14
|
vueDirectory?: string;
|
|
14
15
|
angularDirectory?: string;
|
|
15
16
|
angular?: {
|
|
17
|
+
changeDetection?: import("..").AngularChangeDetection;
|
|
16
18
|
providers?: ReadonlyArray<import("@angular/core").Provider | import("@angular/core").EnvironmentProviders>;
|
|
17
19
|
};
|
|
18
20
|
astroDirectory?: string;
|
|
@@ -53,7 +55,10 @@ export declare const loadConfig: (configPath?: string) => Promise<{
|
|
|
53
55
|
static?: import("..").StaticConfig;
|
|
54
56
|
compile?: import("..").CompileConfig;
|
|
55
57
|
images?: import("..").ImageConfig;
|
|
58
|
+
fonts?: import("..").FontsConfig;
|
|
59
|
+
vitals?: import("..").VitalsConfig;
|
|
56
60
|
sitemap?: import("..").SitemapConfig;
|
|
61
|
+
fileRoutes?: boolean | import("..").FileRoutesConfig;
|
|
57
62
|
openapi?: boolean | import("..").OpenApiConfig;
|
|
58
63
|
telemetry?: boolean | import("..").OtelConfig;
|
|
59
64
|
sourcemaps?: "external" | "inline" | boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TextDirection } from '../../types/i18n';
|
|
2
|
+
export type RequestLocale = {
|
|
3
|
+
locale: string;
|
|
4
|
+
dir: TextDirection;
|
|
5
|
+
};
|
|
6
|
+
/** ` lang="…" dir="…"` for the request's locale, or ` lang="<fallback>"`
|
|
7
|
+
* when no i18n plugin resolved one. */
|
|
8
|
+
export declare const htmlLangAttributes: (fallback?: string) => string;
|
|
9
|
+
export declare const readRequestLocale: () => RequestLocale | undefined;
|
|
10
|
+
export declare const registerRequestLocaleGetter: (getter: () => RequestLocale | undefined) => void;
|
|
@@ -7,4 +7,9 @@ export declare const resolveNotFoundConventionPath: (framework: keyof Convention
|
|
|
7
7
|
export declare const setConventions: (map: ConventionsMap) => void;
|
|
8
8
|
export declare const renderConventionError: (framework: keyof ConventionsMap, pageName: string, error: unknown) => Promise<Response | null>;
|
|
9
9
|
export declare const renderConventionNotFound: (framework: keyof ConventionsMap) => Promise<Response | null>;
|
|
10
|
-
|
|
10
|
+
/** Renders the first available not-found convention. An HTMX request
|
|
11
|
+
* (`HX-Request` header) tries the HTMX pages directory's not-found.html
|
|
12
|
+
* first, so an HTMX swap gets HTMX markup. */
|
|
13
|
+
export declare const renderFirstNotFound: (options?: {
|
|
14
|
+
preferHtmx?: boolean;
|
|
15
|
+
}) => Promise<Response | null>;
|
|
@@ -29,6 +29,11 @@ type StreamingSlotPolicyValue = {
|
|
|
29
29
|
onSlotMetric?: StreamingSlotMetricHandler;
|
|
30
30
|
};
|
|
31
31
|
export type StreamingSlot = {
|
|
32
|
+
/** Resolve this slot on every request, even when the page is
|
|
33
|
+
* pre-rendered: the cached shell keeps the fallback and the content
|
|
34
|
+
* streams in per request (partial prerendering). Off by default, so a
|
|
35
|
+
* pre-rendered page bakes the slot's content into its HTML. */
|
|
36
|
+
dynamic?: boolean;
|
|
32
37
|
errorHtml?: unknown;
|
|
33
38
|
fallbackHtml?: unknown;
|
|
34
39
|
id: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { Island } from './Island.browser';
|
|
2
2
|
export { createTypedIsland } from './createIsland.browser';
|
|
3
3
|
export { useIslandStore } from './useIslandStore';
|
|
4
|
+
export { useServerData } from './useServerData.browser';
|
|
5
|
+
export type { ServerData, ServerDataFetcher, ServerDataOptions } from '../../types/vue';
|
|
4
6
|
export { captureSsrTextBaselines, prepareBrowserTranslationHydration, preserveBrowserTranslation } from './browserTranslation';
|
|
5
7
|
export { defineRoutes, defineVueSetupApp } from './defineVuePage';
|
|
6
8
|
export { applyVueRouterRedirect } from './routerRedirectProviders';
|
|
@@ -51,16 +51,16 @@ export declare const Image: import("vue").DefineComponent<{
|
|
|
51
51
|
fetchPriority?: "high" | "low" | "auto" | undefined;
|
|
52
52
|
overrideSrc?: string | undefined;
|
|
53
53
|
}> & Readonly<{}>, {
|
|
54
|
-
style: Record<string, any>;
|
|
55
54
|
fill: boolean;
|
|
55
|
+
style: Record<string, any>;
|
|
56
56
|
loader: Function;
|
|
57
57
|
loading: string;
|
|
58
58
|
onError: Function;
|
|
59
59
|
height: number;
|
|
60
60
|
width: number;
|
|
61
61
|
placeholder: string;
|
|
62
|
-
onLoad: Function;
|
|
63
62
|
className: string;
|
|
63
|
+
onLoad: Function;
|
|
64
64
|
quality: number;
|
|
65
65
|
unoptimized: boolean;
|
|
66
66
|
sizes: string;
|
package/dist/src/vue/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { captureSsrTextBaselines, prepareBrowserTranslationHydration, preserveBr
|
|
|
9
9
|
export { Image } from './components/Image';
|
|
10
10
|
export { StreamSlot, SuspenseSlot } from './components';
|
|
11
11
|
export { useResource } from './useResource';
|
|
12
|
+
export { useServerData } from './useServerData';
|
|
13
|
+
export type { ServerData, ServerDataFetcher, ServerDataOptions } from '../../types/vue';
|
|
12
14
|
export { Link } from './router/Link';
|
|
13
15
|
export { usePrefetch } from './usePrefetch';
|
|
14
16
|
export type { UsePrefetchOptions } from './usePrefetch';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ServerDataCollector } from '../../types/vue';
|
|
2
|
+
/** Property on the Vue `SSRContext` that carries the request's collector.
|
|
3
|
+
* A plain string (not a symbol) so it survives a page bundle that ends up
|
|
4
|
+
* with its own copy of this module. */
|
|
5
|
+
export declare const SERVER_DATA_CONTEXT_KEY = "__absoluteServerData";
|
|
6
|
+
/** Reserves `key` for this request and returns whether the caller owns it.
|
|
7
|
+
* Two components using one key would overwrite each other's payload and
|
|
8
|
+
* hydrate from the wrong value, so a repeated key is refused. Outside
|
|
9
|
+
* production the collector records an error that fails the page once
|
|
10
|
+
* rendering ends (throwing from `setup()` would leave Vue's SSR state
|
|
11
|
+
* half-reset); in production a warning is logged and the repeated call
|
|
12
|
+
* loads in the browser. */
|
|
13
|
+
export declare const claimServerDataKey: (collector: ServerDataCollector, key: string) => boolean;
|
|
14
|
+
export declare const createServerDataCollector: () => ServerDataCollector;
|
|
15
|
+
export declare const isServerDataCollector: (value: unknown) => value is ServerDataCollector;
|
|
16
|
+
/** The inline script that hands `useServerData` results to the browser, or
|
|
17
|
+
* an empty string when the page loaded none. Every inline script for this
|
|
18
|
+
* payload is written here, so attributes such as a CSP nonce belong in
|
|
19
|
+
* this one place. The JSON is escaped so no value can close the script
|
|
20
|
+
* element or break the JavaScript around it. */
|
|
21
|
+
export declare const serializeServerDataScript: (collector: ServerDataCollector | null) => string;
|
|
22
|
+
/** Records a failed load and returns the error to render with: the one the
|
|
23
|
+
* browser receives, with its message replaced in production. */
|
|
24
|
+
export declare const storeServerDataError: (collector: ServerDataCollector, key: string, cause: unknown) => Error;
|
|
25
|
+
/** Serializes the value now so an unserializable result (a cycle, a
|
|
26
|
+
* BigInt) becomes this key's error state instead of breaking the page.
|
|
27
|
+
* Returns the error when serialization failed. */
|
|
28
|
+
export declare const storeServerDataValue: (collector: ServerDataCollector, key: string, value: unknown) => Error | null;
|
|
29
|
+
/** Throws the error a render recorded (a repeated key in development), so
|
|
30
|
+
* the page handler fails the response instead of serving a page whose
|
|
31
|
+
* payload is ambiguous. */
|
|
32
|
+
export declare const throwServerDataFailure: (collector: ServerDataCollector) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ServerData, ServerDataErrorEntry, ServerDataFetcher } from '../../types/vue';
|
|
2
|
+
/** Refs plus an abortable `refresh`, shared by the server and browser
|
|
3
|
+
* builds of `useServerData`. */
|
|
4
|
+
export declare const createServerDataState: <T>(fetcher: ServerDataFetcher<T>, initiallyPending: boolean) => ServerData<T>;
|
|
5
|
+
export declare const errorFromEntry: ({ error }: ServerDataErrorEntry) => Error;
|
|
6
|
+
/** The page payload for a key was produced by this same fetcher on the
|
|
7
|
+
* server, so its value has the fetcher's result type. This predicate
|
|
8
|
+
* records that contract for the compiler; JSON cannot carry the type. */
|
|
9
|
+
export declare const isFetcherResult: <T>(_fetcher: ServerDataFetcher<T>, _value: unknown) => _value is T;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ServerDataFetcher, ServerDataOptions } from '../../types/vue';
|
|
2
|
+
/** Browser build of `useServerData`: hydrates from the value the server
|
|
3
|
+
* wrote into the page without calling the fetcher, and calls the fetcher
|
|
4
|
+
* when the page carries no value for `key`. See the server build for the
|
|
5
|
+
* full contract. */
|
|
6
|
+
export declare const useServerData: <T>(key: string, fetcher: ServerDataFetcher<T>, _options?: ServerDataOptions) => import("./browser").ServerData<T>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ServerData, ServerDataFetcher, ServerDataOptions } from '../../types/vue';
|
|
2
|
+
/** Loads data while the page renders on the server and hands it to the
|
|
3
|
+
* browser with the page, so hydration reuses it instead of fetching again.
|
|
4
|
+
* When no server value exists (a client-side route change, `server: false`,
|
|
5
|
+
* or a page whose shell is not server-rendered) it loads in the browser.
|
|
6
|
+
*
|
|
7
|
+
* Call it in a component's `setup()`. `key` must be unique among the
|
|
8
|
+
* `useServerData` calls of one request; the result must be JSON
|
|
9
|
+
* serializable.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* const loadProfile = async (signal: AbortSignal): Promise<Profile> => {
|
|
13
|
+
* const response = await fetch('https://api.example.com/me', { signal });
|
|
14
|
+
*
|
|
15
|
+
* return response.json();
|
|
16
|
+
* };
|
|
17
|
+
* const { data, error, pending, refresh } = useServerData(
|
|
18
|
+
* 'profile',
|
|
19
|
+
* loadProfile
|
|
20
|
+
* );
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* This is the server build; the browser build reads the page payload. */
|
|
24
|
+
export declare const useServerData: <T>(key: string, fetcher: ServerDataFetcher<T>, options?: ServerDataOptions) => ServerData<T>;
|