We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29d5979 commit eac1314Copy full SHA for eac1314
.changeset/polite-spies-beg.md
@@ -0,0 +1,5 @@
1
+---
2
+'gitbook': patch
3
4
+
5
+Lazy load iframely script to make page more responsive
packages/gitbook/src/components/DocumentView/Embed.tsx
@@ -1,5 +1,4 @@
import * as gitbookAPI from '@gitbook/api';
-import { headers } from 'next/headers';
import Script from 'next/script';
import ReactDOM from 'react-dom';
@@ -32,7 +31,11 @@ export async function Embed(props: BlockProps<gitbookAPI.DocumentBlockEmbed>) {
32
31
}}
33
data-visual-test="blackout"
34
/>
35
- <Script src="https://cdn.iframe.ly/embed.js" nonce={nonce} />
+ <Script
+ strategy="lazyOnload"
36
+ src="https://cdn.iframe.ly/embed.js"
37
+ nonce={nonce}
38
+ />
39
</>
40
) : embed.type === 'integration' ? (
41
<IntegrationBlock
0 commit comments