From 82ea3e60a782e0995231ddab8db928f7b8f978a2 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 7 Oct 2023 22:48:42 -0500 Subject: [PATCH 1/3] SoapboxMount: add Suspense boundaries --- src/init/soapbox-mount.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/init/soapbox-mount.tsx b/src/init/soapbox-mount.tsx index bbc911691..ed7f70c47 100644 --- a/src/init/soapbox-mount.tsx +++ b/src/init/soapbox-mount.tsx @@ -76,15 +76,24 @@ const SoapboxMount = () => { } + render={(props) => ( + + + + )} /> {renderBody()} - - + + + + + + +
Date: Sat, 7 Oct 2023 22:51:48 -0500 Subject: [PATCH 2/3] Layout.Aside: add Suspense boundary for the whole component --- src/components/ui/layout/layout.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/ui/layout/layout.tsx b/src/components/ui/layout/layout.tsx index 459febef2..0ede77e6b 100644 --- a/src/components/ui/layout/layout.tsx +++ b/src/components/ui/layout/layout.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx'; -import React from 'react'; +import React, { Suspense } from 'react'; import StickyBox from 'react-sticky-box'; interface ISidebar { @@ -52,7 +52,9 @@ const Main: React.FC> = ({ children, classN const Aside: React.FC = ({ children }) => ( ); From 78884a424840736b25c7efeb22aeec5b351ea261 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 7 Oct 2023 22:57:43 -0500 Subject: [PATCH 3/3] UI: wrap StatusHoverCard with Suspense boundary --- src/features/report/components/status-check-box.tsx | 4 ++-- src/features/ui/index.tsx | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/features/report/components/status-check-box.tsx b/src/features/report/components/status-check-box.tsx index b8cb48015..96df936a2 100644 --- a/src/features/report/components/status-check-box.tsx +++ b/src/features/report/components/status-check-box.tsx @@ -1,5 +1,5 @@ import noop from 'lodash/noop'; -import React from 'react'; +import React, { Suspense } from 'react'; import { toggleStatusReport } from 'soapbox/actions/reports'; import StatusContent from 'soapbox/components/status-content'; @@ -73,7 +73,7 @@ const StatusCheckBox: React.FC = ({ id, disabled }) => {
- {media} + {media}
diff --git a/src/features/ui/index.tsx b/src/features/ui/index.tsx index fcd411dc7..943cd6d3c 100644 --- a/src/features/ui/index.tsx +++ b/src/features/ui/index.tsx @@ -515,7 +515,9 @@ const UI: React.FC = ({ children }) => { - + + +