Next.js Discord

Discord Forum

Layout suspense boundries

Unanswered
Lukas posted this in #help-forum
Open in Discord
If I have a file structure like this:
test/
├── layout.tsx
└── test2/
    ├── layout.tsx
    ├── page.tsx
    └── loading.tsx

Then I have an async page.tsx and suspense boundaries inside of my two layouts, will these all be triggered at the same time and suspended, or will it waterfall each request?

2 Replies

I guess I'll share a bit more about my use case so this is less or an XY problem. I have a main website sidebar (honestly looks a bit like discords), then I have a page layout that loads specific resources for that page that are user specific. Then I have the page itself, which is (mostly) "static" content that I'm going to use revalidatePath on. There are one or two things on that page that might need to be user-specific as well (in my case showing the status of upcoming assignments for each individual user), which I'll wrap a suspense around. (ideally, I would be able to fetch this in parallel as well, but I'm fine if this has to be waterfalled).
here's my 10/10 diagram from ms paint