@decocms/start 0.28.2 → 0.28.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -414,24 +414,6 @@ function mergeSections(resolved: ResolvedSection[], deferred: DeferredSection[])
|
|
|
414
414
|
// DecoPageRenderer — renders top-level resolved sections from a CMS page
|
|
415
415
|
// ---------------------------------------------------------------------------
|
|
416
416
|
|
|
417
|
-
// ---------------------------------------------------------------------------
|
|
418
|
-
// IdleHydrationBoundary — delays hydration of below-fold sections until idle
|
|
419
|
-
// ---------------------------------------------------------------------------
|
|
420
|
-
|
|
421
|
-
function IdleHydrationBoundary({ children }: { children: ReactNode }) {
|
|
422
|
-
const [ready, setReady] = useState(typeof document === "undefined"); // SSR: always ready
|
|
423
|
-
useEffect(() => {
|
|
424
|
-
if (typeof requestIdleCallback === "function") {
|
|
425
|
-
const id = requestIdleCallback(() => setReady(true));
|
|
426
|
-
return () => cancelIdleCallback(id);
|
|
427
|
-
}
|
|
428
|
-
// Fallback for browsers without requestIdleCallback
|
|
429
|
-
const id = setTimeout(() => setReady(true), 50);
|
|
430
|
-
return () => clearTimeout(id);
|
|
431
|
-
}, []);
|
|
432
|
-
// Before ready, return null — React preserves SSR HTML via Suspense fallback={null}
|
|
433
|
-
return ready ? <>{children}</> : null;
|
|
434
|
-
}
|
|
435
417
|
|
|
436
418
|
interface Props {
|
|
437
419
|
sections: ResolvedSection[];
|
|
@@ -503,8 +485,6 @@ export function DecoPageRenderer({
|
|
|
503
485
|
// registerSectionsSync.
|
|
504
486
|
const LazyComponent = getLazyComponent(section.component);
|
|
505
487
|
if (!LazyComponent) return null;
|
|
506
|
-
|
|
507
|
-
const isAboveFold = item.originalIndex < 3;
|
|
508
488
|
const content = (
|
|
509
489
|
<Suspense fallback={null}>
|
|
510
490
|
<LazyComponent {...section.props} />
|
|
@@ -514,7 +494,7 @@ export function DecoPageRenderer({
|
|
|
514
494
|
return (
|
|
515
495
|
<section key={`${section.key}-${index}`} id={sectionId} data-manifest-key={section.key}>
|
|
516
496
|
<SectionErrorBoundary sectionKey={section.key} fallback={errFallback}>
|
|
517
|
-
{
|
|
497
|
+
{content}
|
|
518
498
|
</SectionErrorBoundary>
|
|
519
499
|
</section>
|
|
520
500
|
);
|