From e230d7708045ed4f361ae9b6f077e7c5f0000f03 Mon Sep 17 00:00:00 2001 From: "typescript-automation[bot]" <290192711+typescript-automation[bot]@users.noreply.github.com> Date: Mon, 6 Jul 2026 09:34:10 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20Update=20CODEOWNERS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/CODEOWNERS | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 161584c715bba2..89d1e76d007d78 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1216,7 +1216,7 @@ /types/current-git-branch/ @maxbogus /types/curtainsjs/ @Blakeinstein /types/custom-error-generator/ @thmiceli -/types/custom-functions-runtime/ @OfficeDev @davidchesnut @AlexJerabek @ElizabethSamuel-MSFT @alison-mk +/types/custom-functions-runtime/ @OfficeDev @AlexJerabek @ElizabethSamuel-MSFT @alison-mk /types/customize-cra/ @k-yle /types/cvss/ @himynameisdave /types/cwd/ @BendingBender @@ -5033,6 +5033,7 @@ /types/name-all-modules-plugin/ @peterblazejewicz /types/name-initials/ @atlowChemi /types/named-routes/ @qqilihq +/types/namespace-emitter/ @remcohaszing /types/namespace-js/ @kuromoka /types/nano-cache/ @rcoundon /types/nano-equal/ @1cheese @@ -5391,9 +5392,9 @@ /types/obsolete-web/ @peterblazejewicz /types/oclazyload/ @rolandzwaga /types/ofe/ @Morfent -/types/office-js/ @OfficeDev @davidchesnut @AlexJerabek @ElizabethSamuel-MSFT @samantharamon -/types/office-js-preview/ @OfficeDev @davidchesnut @AlexJerabek @ElizabethSamuel-MSFT @samantharamon -/types/office-runtime/ @OfficeDev @davidchesnut @AlexJerabek @ElizabethSamuel-MSFT @alison-mk +/types/office-js/ @OfficeDev @AlexJerabek @ElizabethSamuel-MSFT @samantharamon +/types/office-js-preview/ @OfficeDev @AlexJerabek @ElizabethSamuel-MSFT @samantharamon +/types/office-runtime/ @OfficeDev @AlexJerabek @ElizabethSamuel-MSFT @alison-mk /types/offline-js/ @cgwrench /types/offscreen-canvas/ @peterblazejewicz /types/offscreencanvas/ @kayahr @ova2 @capnmidnight @@ -7221,7 +7222,7 @@ /types/shallowequal/v0/ @seansfkelley /types/shapefile/ @DenisCarriere @Thw0rted /types/share-api-polyfill/ @jnv -/types/sharedb/ @soney @ericyhwang @pxpeterxu @alecgibson @pypmannetjies @craigbeck +/types/sharedb/ @soney @ericyhwang @pxpeterxu @alecgibson @pypmannetjies @craigbeck @dawidreedsy /types/sharepoint/ @gandjustas @andrei-markeev @teroarvola @dennispg @SPWizard01 @betlgtu /types/sharetribe-flex-integration-sdk/ @jayenashar @venmartin /types/sharetribe-flex-sdk/ @jayenashar @venmartin @@ -7812,8 +7813,6 @@ /types/throttle-debounce/ @czbuchi @franklixuefei @oddsund @seiyab /types/throttleit/ @ifiokjr /types/through/ @AndrewGaspar -/types/through2/ @Bartvds @valotas @TeamworkGuy2 @Alorel -/types/through2/v0/ @Bartvds /types/through2-concurrent/ @Alorel /types/through2-map/ @LucasHill /types/throw-empty/ @ChocolateLoverRaj @@ -8419,6 +8418,7 @@ /types/whois-json/ @hwaien /types/whois-parsed/ @uchilaka /types/whoops/ @ffflorian +/types/wicg-cross-origin-storage/ @tomayac @christianliebel /types/wicg-entries-api/ @HenningCash @RReverser /types/wicg-file-system-access/ @RReverser /types/wicg-js-self-profiling/ @NotWoods From 31d3bcefc99c532e72d46cd229d8976787111610 Mon Sep 17 00:00:00 2001 From: Alexander Brandon Coles Date: Mon, 6 Jul 2026 10:38:32 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#75214=20[hotwi?= =?UTF-8?q?red=5F=5Fturbo]=20Add=20session.view=20types=20by=20@myabc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hotwired__turbo/hotwired__turbo-tests.ts | 45 +++++++++++++++++ types/hotwired__turbo/index.d.ts | 49 +++++++++++++++++++ 2 files changed, 94 insertions(+) diff --git a/types/hotwired__turbo/hotwired__turbo-tests.ts b/types/hotwired__turbo/hotwired__turbo-tests.ts index 98c550bb627ab4..e034450042b191 100644 --- a/types/hotwired__turbo/hotwired__turbo-tests.ts +++ b/types/hotwired__turbo/hotwired__turbo-tests.ts @@ -7,10 +7,13 @@ import { disconnectStreamSource, navigator, NavigatorDelegate, + PageSnapshot, + PageView, ProgressBar, registerAdapter, renderStreamMessage, session, + SnapshotCache, start, StreamActions, StreamMessage, @@ -354,3 +357,45 @@ session.restorationIdentifier; session.started; // $ExpectType boolean session.enabled; + +// Test PageView via session.view +// PageView and SnapshotCache are not runtime exports of @hotwired/turbo, only types +// @ts-expect-error +new PageView(session, document.documentElement); +// @ts-expect-error +new SnapshotCache(10); +// $ExpectType PageView +session.view; +// $ExpectType PageView +Turbo.session.view; +// @ts-expect-error - view cannot be reassigned +session.view = session.view; +// $ExpectType URL +session.view.lastRenderedLocation; +session.view.lastRenderedLocation = new URL("https://example.com"); +// $ExpectType HTMLElement +session.view.element; +// $ExpectType boolean +session.view.forceReloaded; +// $ExpectType PageSnapshot +session.view.snapshot; +// $ExpectType Promise +session.view.cacheSnapshot(); +session.view.cacheSnapshot(PageSnapshot.fromHTMLString("")); +// $ExpectType PageSnapshot | undefined +session.view.getCachedSnapshotForLocation(new URL("https://example.com")); +session.view.clearSnapshotCache(); + +// Test SnapshotCache via session.view.snapshotCache +// $ExpectType SnapshotCache +session.view.snapshotCache; +// $ExpectType boolean +session.view.snapshotCache.has(new URL("https://example.com")); +// $ExpectType PageSnapshot | undefined +session.view.snapshotCache.get(new URL("https://example.com")); +// $ExpectType PageSnapshot +session.view.snapshotCache.put( + new URL("https://example.com"), + PageSnapshot.fromHTMLString(""), +); +session.view.snapshotCache.clear(); diff --git a/types/hotwired__turbo/index.d.ts b/types/hotwired__turbo/index.d.ts index df503b48ebe9a3..c3d2463e3c7e95 100644 --- a/types/hotwired__turbo/index.d.ts +++ b/types/hotwired__turbo/index.d.ts @@ -292,8 +292,57 @@ export interface TurboHistory { replace(location: URL, restorationIdentifier?: string): void; } +export class PageSnapshot { + static fromHTMLString(html?: string): PageSnapshot; + static fromElement(element: Element): PageSnapshot; + static fromDocument(document: Pick): PageSnapshot; + + readonly headElement: HTMLHeadElement; + readonly isCacheable: boolean; + readonly isPreviewable: boolean; + readonly isVisitable: boolean; + readonly lang: string | null; + readonly rootLocation: URL; + clone(): PageSnapshot; +} + +/** + * An LRU cache of page snapshots, keyed by location. + * + * Note that Turbo does not export the `SnapshotCache` class at runtime — + * obtain the instance via `session.view.snapshotCache`. + */ +export interface SnapshotCache { + has(location: URL): boolean; + get(location: URL): PageSnapshot | undefined; + put(location: URL, snapshot: PageSnapshot): PageSnapshot; + clear(): void; +} + +/** + * The session's view of the current page. + * + * Note that Turbo does not export the `PageView` class at runtime — + * obtain the instance via `session.view`. + */ +export interface PageView { + element: HTMLElement; + snapshotCache: SnapshotCache; + /** + * The location of the last rendered page. Keys the snapshot cache and + * page-refresh detection. + */ + lastRenderedLocation: URL; + forceReloaded: boolean; + readonly snapshot: PageSnapshot; + cacheSnapshot(snapshot?: PageSnapshot): Promise; + getCachedSnapshotForLocation(location: URL): PageSnapshot | undefined; + clearSnapshotCache(): void; +} + export interface TurboSession { readonly history: TurboHistory; + readonly view: PageView; adapter: Adapter; readonly enabled: boolean; readonly started: boolean;