@ogygia/core 0.12.3 → 0.13.0
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/dist/LateIsland.svelte +3 -2
- package/dist/LateIslandAwait.svelte +6 -2
- package/dist/Region.svelte +22 -33
- package/dist/boundary.d.ts +0 -2
- package/dist/boundary.js +8 -6
- package/dist/compiler/debarrel/barrel.d.ts +15 -8
- package/dist/compiler/debarrel/barrel.js +92 -45
- package/dist/compiler/debarrel/plugin.js +41 -17
- package/dist/compiler/dev/dev-hmr.d.ts +3 -0
- package/dist/compiler/dev/dev-hmr.js +3 -0
- package/dist/compiler/driver.js +11 -4
- package/dist/compiler/flags.js +21 -7
- package/dist/compiler/fouc-css.js +5 -1
- package/dist/compiler/kit.js +5 -1
- package/dist/compiler/link/build-output.js +12 -3
- package/dist/compiler/macros/bake.js +18 -4
- package/dist/compiler/macros/dollar.js +6 -1
- package/dist/compiler/macros/source.js +6 -1
- package/dist/compiler/macros/store.js +10 -2
- package/dist/compiler/macros/wire.js +6 -1
- package/dist/compiler/parse/scan.js +10 -3
- package/dist/compiler/region/transform.js +188 -74
- package/dist/context-bridge.js +13 -5
- package/dist/context.d.ts +9 -0
- package/dist/context.js +30 -1
- package/dist/document.d.ts +1 -1
- package/dist/document.js +7 -1
- package/dist/early-holes-head.d.ts +5 -0
- package/dist/early-holes-head.js +20 -0
- package/dist/early-holes.d.ts +34 -0
- package/dist/early-holes.js +51 -0
- package/dist/entry-hydrate.js +9 -12
- package/dist/events/bus.js +7 -2
- package/dist/events/schema.d.ts +2 -2
- package/dist/fn-transport.js +4 -3
- package/dist/hooks.js +94 -163
- package/dist/insights/page-assets.js +11 -3
- package/dist/insights/page-insights.d.ts +0 -2
- package/dist/insights/page-insights.js +14 -10
- package/dist/insights/session-insights.js +2 -2
- package/dist/internal-instruments.d.ts +3 -1
- package/dist/internal-instruments.js +3 -1
- package/dist/internal-server.d.ts +3 -2
- package/dist/internal-server.js +3 -2
- package/dist/internal.d.ts +1 -2
- package/dist/internal.js +1 -2
- package/dist/keep-fallback.d.ts +0 -2
- package/dist/keep-fallback.js +4 -5
- package/dist/live-transport.js +3 -2
- package/dist/messages/build.d.ts +585 -0
- package/dist/messages/build.js +800 -0
- package/dist/messages/core.d.ts +464 -0
- package/dist/messages/core.js +843 -0
- package/dist/messages/define.d.ts +62 -0
- package/dist/messages/define.js +49 -0
- package/dist/messages/index.d.ts +6 -0
- package/dist/messages/index.js +6 -0
- package/dist/messages/island.d.ts +4 -0
- package/dist/messages/island.js +34 -0
- package/dist/messages/lazy.d.ts +3 -0
- package/dist/messages/lazy.js +22 -0
- package/dist/messages/prose.d.ts +15 -0
- package/dist/messages/prose.js +43 -0
- package/dist/messages/server.d.ts +142 -0
- package/dist/messages/server.js +246 -0
- package/dist/nested.d.ts +3 -0
- package/dist/nested.js +8 -1
- package/dist/plugin/css.js +14 -13
- package/dist/plugin/facts.d.ts +2 -0
- package/dist/plugin/facts.js +10 -6
- package/dist/plugin/hooks.d.ts +7 -17
- package/dist/plugin/hooks.js +32 -4
- package/dist/plugin/index.d.ts +9 -2
- package/dist/plugin/request-scope.d.ts +20 -0
- package/dist/plugin/request-scope.js +149 -0
- package/dist/plugin/server.d.ts +20 -2
- package/dist/plugin/server.js +98 -28
- package/dist/plugin/testing.d.ts +6 -0
- package/dist/plugin/testing.js +14 -2
- package/dist/policies.d.ts +21 -0
- package/dist/policies.js +66 -0
- package/dist/preference.js +6 -1
- package/dist/preload.js +6 -9
- package/dist/ref-watch.d.ts +0 -10
- package/dist/ref-watch.js +14 -1
- package/dist/ref.js +17 -5
- package/dist/region-snippet.js +9 -3
- package/dist/region.js +2 -1
- package/dist/report-thrown.d.ts +9 -0
- package/dist/report-thrown.js +15 -0
- package/dist/rules.d.ts +17 -0
- package/dist/rules.js +57 -0
- package/dist/runtime/beacon.d.ts +0 -4
- package/dist/runtime/beacon.js +58 -43
- package/dist/runtime/boot-link.js +19 -2
- package/dist/runtime/client-hooks.js +2 -1
- package/dist/runtime/concurrency.d.ts +16 -5
- package/dist/runtime/concurrency.js +123 -7
- package/dist/runtime/core.d.ts +3 -1
- package/dist/runtime/core.js +718 -384
- package/dist/runtime/devalue-lane.d.ts +13 -0
- package/dist/runtime/devalue-lane.js +49 -0
- package/dist/runtime/disclose-version.d.ts +1 -0
- package/dist/runtime/disclose-version.js +14 -0
- package/dist/runtime/early-holes.d.ts +4 -0
- package/dist/runtime/early-holes.js +40 -0
- package/dist/runtime/entry-locations.js +40 -49
- package/dist/runtime/foreign-props.d.ts +0 -7
- package/dist/runtime/foreign-props.js +2 -1
- package/dist/runtime/form-continuity.d.ts +2 -2
- package/dist/runtime/form-continuity.js +30 -8
- package/dist/runtime/frame-nav.d.ts +7 -1
- package/dist/runtime/frame-nav.js +84 -18
- package/dist/runtime/frame-store.d.ts +25 -16
- package/dist/runtime/frame-store.js +124 -98
- package/dist/runtime/frames.js +8 -4
- package/dist/runtime/hole-facts.js +6 -7
- package/dist/runtime/hole-fetch.d.ts +17 -0
- package/dist/runtime/hole-fetch.js +47 -0
- package/dist/runtime/hydrate-core.d.ts +4 -4
- package/dist/runtime/hydrate-core.js +80 -64
- package/dist/runtime/import-again.d.ts +33 -0
- package/dist/runtime/import-again.js +217 -0
- package/dist/runtime/interaction-replay.d.ts +5 -3
- package/dist/runtime/interaction-replay.js +6 -6
- package/dist/runtime/interaction.d.ts +14 -3
- package/dist/runtime/interaction.js +46 -23
- package/dist/runtime/kit-page-thread.svelte.d.ts +2 -1
- package/dist/runtime/kit-page-thread.svelte.js +44 -20
- package/dist/runtime/lakes.d.ts +1 -1
- package/dist/runtime/lakes.js +18 -5
- package/dist/runtime/live.d.ts +1 -2
- package/dist/runtime/live.js +6 -8
- package/dist/runtime/load-scheduler.d.ts +29 -18
- package/dist/runtime/load-scheduler.js +236 -136
- package/dist/runtime/nav-handle.js +25 -6
- package/dist/runtime/navigation.d.ts +24 -0
- package/dist/runtime/navigation.js +24 -0
- package/dist/runtime/ownership.d.ts +1 -1
- package/dist/runtime/page-defer.js +3 -3
- package/dist/runtime/parse-html.d.ts +15 -4
- package/dist/runtime/parse-html.js +24 -5
- package/dist/runtime/pushable-props.svelte.d.ts +21 -0
- package/dist/runtime/pushable-props.svelte.js +37 -0
- package/dist/runtime/region-endpoint-url.js +4 -6
- package/dist/runtime/region-machines.d.ts +111 -0
- package/dist/runtime/region-machines.js +97 -0
- package/dist/runtime/region-sheets.d.ts +31 -0
- package/dist/runtime/region-sheets.js +49 -0
- package/dist/runtime/restore-report.d.ts +1 -0
- package/dist/runtime/restore-report.js +36 -0
- package/dist/runtime/restore.d.ts +5 -2
- package/dist/runtime/restore.js +33 -14
- package/dist/runtime/router-nav.d.ts +32 -12
- package/dist/runtime/router-nav.js +320 -228
- package/dist/runtime/router.d.ts +83 -19
- package/dist/runtime/router.js +297 -129
- package/dist/runtime/rules.d.ts +35 -0
- package/dist/runtime/rules.js +137 -0
- package/dist/runtime/schedule.d.ts +6 -3
- package/dist/runtime/schedule.js +172 -57
- package/dist/runtime/seeds.d.ts +5 -1
- package/dist/runtime/seeds.js +11 -5
- package/dist/runtime/session.d.ts +46 -7
- package/dist/runtime/session.js +78 -10
- package/dist/runtime/slots.d.ts +53 -20
- package/dist/runtime/slots.js +2 -3
- package/dist/runtime/soft-refresh.d.ts +16 -0
- package/dist/runtime/soft-refresh.js +14 -0
- package/dist/runtime/svelte-warnings.d.ts +4 -10
- package/dist/runtime/svelte-warnings.js +7 -4
- package/dist/runtime/wire-classes.js +21 -8
- package/dist/runtime/wire-format.js +6 -3
- package/dist/script.js +8 -7
- package/dist/seed-ref-reviver.d.ts +0 -9
- package/dist/seed-ref-reviver.js +2 -1
- package/dist/seed-refs.d.ts +46 -36
- package/dist/seed-refs.js +131 -92
- package/dist/server/document-tail.d.ts +6 -0
- package/dist/server/document-tail.js +7 -1
- package/dist/server/early-holes-csp.d.ts +14 -0
- package/dist/server/early-holes-csp.js +73 -0
- package/dist/server/page-facts.d.ts +4 -1
- package/dist/server/page-facts.js +4 -1
- package/dist/server/page-seed.d.ts +2 -2
- package/dist/server/page-seed.js +104 -11
- package/dist/server/page-stream.d.ts +14 -1
- package/dist/server/page-stream.js +119 -2
- package/dist/server/personal-response.d.ts +0 -5
- package/dist/server/personal-response.js +6 -2
- package/dist/server/props-wire.js +5 -1
- package/dist/server/region-endpoint.js +10 -2
- package/dist/server/render-cache.d.ts +24 -20
- package/dist/server/render-cache.js +99 -40
- package/dist/server/render-page.js +46 -15
- package/dist/server/request-stats.d.ts +10 -8
- package/dist/server/request-stats.js +20 -12
- package/dist/server/rules.d.ts +11 -0
- package/dist/server/rules.js +64 -0
- package/dist/server/signing-key.js +31 -18
- package/dist/server/stream-regions.d.ts +14 -1
- package/dist/server/stream-regions.js +38 -2
- package/dist/shared-state.js +5 -1
- package/dist/shims/app-navigation.js +3 -2
- package/dist/shims/page-store.svelte.js +16 -2
- package/dist/source.js +7 -2
- package/dist/store-transport.js +12 -5
- package/dist/transport.js +3 -2
- package/dist/vite/index.js +17 -10
- package/dist/vite/kit-dirs.js +7 -1
- package/dist/vite/options.d.ts +2 -1
- package/dist/vite/options.js +11 -20
- package/dist/vite/package-files.js +13 -3
- package/dist/vite/paths.d.ts +2 -0
- package/dist/vite/paths.js +4 -4
- package/dist/vite/plugin-api.js +42 -14
- package/dist/vite/style-preprocess.js +10 -3
- package/package.json +8 -1
- package/dist/KeepHost.svelte +0 -19
- package/dist/KeepHost.svelte.d.ts +0 -10
- package/dist/LiveHost.svelte +0 -19
- package/dist/LiveHost.svelte.d.ts +0 -10
- package/dist/NestedProvider.svelte +0 -13
- package/dist/NestedProvider.svelte.d.ts +0 -8
- package/dist/runtime/page-cache.d.ts +0 -23
- package/dist/runtime/page-cache.js +0 -74
package/dist/runtime/router.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { FetchedPage } from "./router-nav.js";
|
|
2
|
+
import { Navigation } from "./navigation.js";
|
|
1
3
|
/**
|
|
2
4
|
* The `<a>` a pointer event is about — through SHADOW ROOTS. A click inside a web component's
|
|
3
5
|
* shadow tree (a web component such as `<x-link>`, `<x-button href>`, a breadcrumb item)
|
|
@@ -60,24 +62,63 @@ export declare function same_document_link(url: URL, current: URL, in_flight: st
|
|
|
60
62
|
export declare function document_key(url: URL): string;
|
|
61
63
|
/** Instant scroll to a hash target (or top). Ignores CSS `scroll-behavior: smooth`. */
|
|
62
64
|
export declare function jump_to_hash(hash: string): void;
|
|
65
|
+
/** One entry of the visitor's history the router made (or took over): its address, and where the
|
|
66
|
+
* page was when the visitor left it: its scroll, and the id of the element that had focus. */
|
|
67
|
+
export interface HistoryEntry {
|
|
68
|
+
readonly id: string;
|
|
69
|
+
url: URL;
|
|
70
|
+
scroll: {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
} | null;
|
|
74
|
+
focus: string | null;
|
|
75
|
+
}
|
|
76
|
+
/** How a navigation writes history: a new entry, the current one's address, or the entry a back or
|
|
77
|
+
* forward step is already on. */
|
|
78
|
+
export type HistoryMove = "push" | "replace" | "pop";
|
|
79
|
+
export declare class RouterHistory {
|
|
80
|
+
#private;
|
|
81
|
+
/** The entry of the page on screen. */
|
|
82
|
+
get current(): HistoryEntry;
|
|
83
|
+
/** Takes over the entry the browser is on as the router starts: its state names it now. */
|
|
84
|
+
start(): void;
|
|
85
|
+
/** The entry a history state names: this model's, `'foreign'` (another document's), or null
|
|
86
|
+
* (no id: an entry the browser or the app made). */
|
|
87
|
+
find(state: unknown): HistoryEntry | "foreign" | null;
|
|
88
|
+
/** The page on screen is being left: keep where it is. */
|
|
89
|
+
leave(): void;
|
|
90
|
+
/** A page goes in at `url` (the browser's entry is written now). `push`: a new entry after the
|
|
91
|
+
* one left; `replace`: the current one at a new address; `pop`: `to`, the entry a back or
|
|
92
|
+
* forward step is on. */
|
|
93
|
+
commit(url: URL, move: HistoryMove, to?: HistoryEntry): HistoryEntry;
|
|
94
|
+
/** The entry the browser stepped to, which no id names: this model's from now on. */
|
|
95
|
+
adopt(url: URL): HistoryEntry;
|
|
96
|
+
}
|
|
63
97
|
export declare class SpaRouter {
|
|
64
98
|
#private;
|
|
65
|
-
/** href of the navigation in flight (set before the fetch, cleared when applied or aborted) */
|
|
66
|
-
nav_target: string | null;
|
|
67
|
-
/** The in-flight navigation's cancel handle: router-nav bumps `nav_gen` and sets `nav_abort` for
|
|
68
|
-
* each navigation it starts, and stops at its next step once `nav_gen` moved on. */
|
|
69
|
-
nav_gen: number;
|
|
70
|
-
nav_abort: AbortController | null;
|
|
71
|
-
/** pathname+search of the document currently in the DOM (hash ignored). */
|
|
72
|
-
doc_key: string;
|
|
73
99
|
/**
|
|
74
|
-
*
|
|
100
|
+
* THE NAVIGATION, one machine (./navigation.ts): idle, claimed (the click, while the navigation
|
|
101
|
+
* chunk loads), loading (its fetch through its swap), settling (swapped: the last steps run). A
|
|
102
|
+
* new click is a new visit, so whatever the old one still had in flight sees it is not current
|
|
103
|
+
* (`nav.now !== mine`) and stops, and its fetch is aborted. It was three fields kept by hand; two
|
|
104
|
+
* clicks during the first chunk load once held the same generation and the last one was lost.
|
|
105
|
+
*/
|
|
106
|
+
readonly nav: Navigation;
|
|
107
|
+
/** href of the router's navigation in flight (claimed or loading; cleared once it applied,
|
|
108
|
+
* ended, or went to the browser: `hand_off`) */
|
|
109
|
+
get nav_target(): string | null;
|
|
110
|
+
/** The visitor's history, as the router keeps it (`RouterHistory`): the rest is read from it. */
|
|
111
|
+
readonly history: RouterHistory;
|
|
112
|
+
/**
|
|
113
|
+
* Full URL of the page on screen: its history entry's. `navigate()` uses this as its `from`
|
|
75
114
|
* instead of `location.href`, because on a `popstate` (back/forward) the browser has ALREADY
|
|
76
115
|
* changed `location` to the target — so `location.href` would equal the target and the
|
|
77
116
|
* same-document guard would wrongly bail into the hash-only branch, never swapping the body
|
|
78
117
|
* (browser back left the old page's DOM in place). POP-FROM.
|
|
79
118
|
*/
|
|
80
|
-
current_url: URL
|
|
119
|
+
get current_url(): URL;
|
|
120
|
+
/** pathname+search of the page on screen (hash ignored). */
|
|
121
|
+
get doc_key(): string;
|
|
81
122
|
beforeNavigate(fn: BeforeNavigateCallback): () => boolean;
|
|
82
123
|
afterNavigate(fn: AfterNavigateCallback): () => boolean;
|
|
83
124
|
/**
|
|
@@ -88,15 +129,38 @@ export declare class SpaRouter {
|
|
|
88
129
|
* swapping left the URL on the old page and `/plain` in the DOM).
|
|
89
130
|
*/
|
|
90
131
|
supersede(): void;
|
|
132
|
+
/**
|
|
133
|
+
* GIVE `visit`'s NAVIGATION TO THE BROWSER — a page the router will not render (a csr=true Kit
|
|
134
|
+
* page, a page that is not ogygia's, another build), or one it could not fetch or load its code
|
|
135
|
+
* for: a document navigation to `url`, from the document on screen (`from`).
|
|
136
|
+
*
|
|
137
|
+
* It ENDS the visit, on every path: from here on the navigation is the browser's, never the
|
|
138
|
+
* router's in flight. The browser may well keep this page on screen (a file download, a 204, a
|
|
139
|
+
* body it does not show), and then nothing else ends it: left `loading`, every later click on the
|
|
140
|
+
* link joined it and was swallowed (#266). A visit already left (a newer click took over, or back
|
|
141
|
+
* to the page on screen) hands nothing off: the browser never goes where the visitor no longer is.
|
|
142
|
+
*
|
|
143
|
+
* The router writes an entry only when a page goes in, so a click handed off has none: the
|
|
144
|
+
* browser's navigation is a new entry of its own, and one it keeps the page on screen for adds
|
|
145
|
+
* none (#297). A back or forward step is already on its entry, and a refresh on the one on
|
|
146
|
+
* screen: the browser's navigation REPLACES it, so its document holds the entry alone, never
|
|
147
|
+
* shares it with the router's page (back from a csr=true page then loads the router page, #259).
|
|
148
|
+
* So does a commit that failed after it wrote the entry (the address is already `url`).
|
|
149
|
+
*
|
|
150
|
+
* `error`: the navigation failed part way (its devalue did not load, its swap threw, #276). It
|
|
151
|
+
* is said (the page's error handler, as an uncaught throw would be), and the browser loads the
|
|
152
|
+
* page whole.
|
|
153
|
+
*/
|
|
154
|
+
hand_off(url: URL, visit: Navigation["now"], move: HistoryMove, error?: unknown): void;
|
|
91
155
|
bust_page_cache(): void;
|
|
92
|
-
|
|
93
|
-
fetch_page
|
|
156
|
+
/** The page at `href`, or `null` when there is none to have: the fetch failed (./router-nav.ts
|
|
157
|
+
* `fetch_page`), or the navigation code itself did not load. The prefetches (a hover, a
|
|
158
|
+
* viewport link, `preloadData`) start it and never wait on it: a rejection here was uncaught. */
|
|
159
|
+
fetch_page(href: string, signal?: AbortSignal, purpose?: "nav" | "prefetch" | "history"): Promise<FetchedPage | null>;
|
|
94
160
|
navigate(url: URL, opts?: {
|
|
95
161
|
push?: boolean;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
y: number;
|
|
99
|
-
} | null;
|
|
162
|
+
/** the entry a back or forward step is on */
|
|
163
|
+
pop?: HistoryEntry;
|
|
100
164
|
type?: string;
|
|
101
165
|
replace?: boolean;
|
|
102
166
|
}): Promise<void>;
|
|
@@ -122,7 +186,9 @@ export declare class SpaRouter {
|
|
|
122
186
|
* After start + every navigation, in IDLE: eager links warm now; viewport links get observed.
|
|
123
187
|
* Only anchors under a preload-marked element are read — an unmarked anchor has no trigger. Idle,
|
|
124
188
|
* because the scan competes with the freshly swapped page's own islands for the main thread and
|
|
125
|
-
* a warm is speculation by definition.
|
|
189
|
+
* a warm is speculation by definition. The scan and its observer are the page visit's
|
|
190
|
+
* (./session.ts `PageVisit`): the next page's swap disconnects it, so the anchors of a page left
|
|
191
|
+
* behind are never held, and a scan still waiting for idle time when its page is left never runs.
|
|
126
192
|
*/
|
|
127
193
|
scan_preload_links(): void;
|
|
128
194
|
}
|
|
@@ -140,8 +206,6 @@ export declare function beforeNavigate(fn: BeforeNavigateCallback): () => boolea
|
|
|
140
206
|
export declare function afterNavigate(fn: AfterNavigateCallback): () => boolean;
|
|
141
207
|
/** Drop all warmed page HTML (call after mutations / auth changes). */
|
|
142
208
|
export declare function bust_page_cache(): void;
|
|
143
|
-
/** Test helper — current warmed entry count. */
|
|
144
|
-
export declare function _page_cache_size(): number;
|
|
145
209
|
/**
|
|
146
210
|
* Programmatic same-origin navigation. Mirrors Kit's `goto()` subset.
|
|
147
211
|
* @param url - Absolute or relative URL (http(s) only).
|