File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import { AdminToolbar } from '@/components/AdminToolbar';
8
8
import { CookiesToast } from '@/components/Cookies' ;
9
9
import { LoadIntegrations } from '@/components/Integrations' ;
10
10
import { SpaceLayout } from '@/components/SpaceLayout' ;
11
+ import { api } from '@/lib/api' ;
12
+ import { assetsDomain } from '@/lib/assets' ;
11
13
import { buildVersion } from '@/lib/build' ;
12
14
import { getContentSecurityPolicyNonce } from '@/lib/csp' ;
13
15
import { absoluteHref , baseUrl } from '@/lib/links' ;
@@ -39,6 +41,11 @@ export default async function ContentLayout(props: { children: React.ReactNode }
39
41
scripts,
40
42
} = await fetchSpaceData ( ) ;
41
43
44
+ ReactDOM . preconnect ( api ( ) . endpoint ) ;
45
+ if ( assetsDomain ) {
46
+ ReactDOM . preconnect ( assetsDomain ) ;
47
+ }
48
+
42
49
scripts . forEach ( ( { script } ) => {
43
50
ReactDOM . preload ( script , {
44
51
as : 'script' ,
Original file line number Diff line number Diff line change 1
1
import * as gitbookAPI from '@gitbook/api' ;
2
2
import Script from 'next/script' ;
3
+ import ReactDOM from 'react-dom' ;
3
4
4
5
import { Card } from '@/components/primitives' ;
5
6
import { api } from '@/lib/api' ;
@@ -11,6 +12,8 @@ import { IntegrationBlock } from './Integration';
11
12
12
13
export async function Embed ( props : BlockProps < gitbookAPI . DocumentBlockEmbed > ) {
13
14
const { block, context, ...otherProps } = props ;
15
+
16
+ ReactDOM . preconnect ( 'https://cdn.iframe.ly' ) ;
14
17
15
18
const { data : embed } = await ( context . content
16
19
? api ( ) . spaces . getEmbedByUrlInSpace ( context . content . spaceId , { url : block . data . url } )
You can’t perform that action at this time.
0 commit comments