From 2c19204349a8fb724e70d6e695a5e88cb70a8f12 Mon Sep 17 00:00:00 2001 From: Nathaniel Tucker Date: Sun, 23 Jun 2024 12:44:37 +0200 Subject: [PATCH] docs: Load post faster --- website/src/components/Playground/Preview.tsx | 5 +---- website/src/components/Playground/PreviewBlock.tsx | 8 +++++++- website/src/fixtures/posts.ts | 4 ---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/website/src/components/Playground/Preview.tsx b/website/src/components/Playground/Preview.tsx index 195358fccfce..1c105b9d52f5 100644 --- a/website/src/components/Playground/Preview.tsx +++ b/website/src/components/Playground/Preview.tsx @@ -75,7 +75,7 @@ function Preview({ [styles.hidden]: hiddenResult, })} > - }> + @@ -86,9 +86,6 @@ function Preview({ } export default memo(Preview); -function LivePreviewLoader() { - return
Loading...
; -} const PreviewBlockLazy = lazy( () => import( diff --git a/website/src/components/Playground/PreviewBlock.tsx b/website/src/components/Playground/PreviewBlock.tsx index 139210c52c60..23fa1625a89c 100644 --- a/website/src/components/Playground/PreviewBlock.tsx +++ b/website/src/components/Playground/PreviewBlock.tsx @@ -1,13 +1,19 @@ import React from 'react'; import { LiveError, LivePreview } from 'react-live'; +import Boundary from './Boundary'; import styles from './styles.module.css'; export default function PreviewBlock() { return ( <> - + }> + + ); } +function LivePreviewLoader() { + return
Loading...
; +} diff --git a/website/src/fixtures/posts.ts b/website/src/fixtures/posts.ts index 5dd68f9234a2..bb342cc52051 100644 --- a/website/src/fixtures/posts.ts +++ b/website/src/fixtures/posts.ts @@ -90,8 +90,6 @@ const entities = { export const getInitialInterceptorData = () => ({ entities: {} }); -const delay = 150; - export const postFixtures = [ { endpoint: PostResource.get, @@ -102,7 +100,6 @@ export const postFixtures = [ ...entities[id], }; }, - delay, }, { endpoint: PostResource.getList, @@ -114,7 +111,6 @@ export const postFixtures = [ } return Object.values(entities); }, - delay, }, { endpoint: PostResource.vote,