Skip to content

Commit 43a116b

Browse files
committed
Review feedback
1 parent b894478 commit 43a116b

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

src/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ interface PerformanceEntryMap {
5858

5959
// Update built-in types to be more accurate.
6060
declare global {
61-
// https://wicg.github.io/nav-speculation/prerendering.html#document-prerendering
6261
interface Document {
63-
prerendering?: boolean
62+
// https://wicg.github.io/nav-speculation/prerendering.html#document-prerendering
63+
prerendering?: boolean;
64+
// https://github.com/WICG/page-lifecycle/blob/main/README.md
65+
wasDiscarded?: boolean;
6466
}
6567

6668
interface Performance {

src/types/base.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,3 @@ export interface ReportOpts {
105105
* loading. This is equivalent to the corresponding `readyState` value.
106106
*/
107107
export type LoadState = 'loading' | 'dom-interactive' | 'dom-content-loaded' | 'complete';
108-
109-
/**
110-
* Extend the document with the new wasDiscarded boolean which is not supported
111-
* in typescript yet
112-
* https://github.com/WICG/page-lifecycle/blob/main/README.md
113-
*/
114-
declare global {
115-
interface Document { wasDiscarded?: boolean; }
116-
}

test/views/layout.njk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
*/
106106
self.__stubWasDiscarded = () => {
107107
return new Promise((resolve) => {
108-
const navEntry = performance.getEntriesByType('navigation')[0];
109108
// Only stub if the page isn't actually discarded.
110109
if (!document.wasDiscarded) {
111110
Object.defineProperty(document, 'wasDiscarded', {

0 commit comments

Comments
 (0)