This is an experiment to see if we can pass data from a page to the layout via React.cache in next@14. It doesn't look like we can - it looks like they may render in parallel, not sequence like vercel/next.js#53026 indicates.
With a simple shellManager implementation, the page starts rendering, then the layout starts rendering, then the page finishes rendering, then the layout finishes rendering. This means we can't use this to pass data from the page to the layout.
rendering IdPage
rendering RootLayout
rendered RootLayout
rendered IdPageWith a more complex shellManager implementation (ie. putting a promise to get the data in the shellManager before the first await), this does work.
rendering IdPage
shellManager setup complete
rendering RootLayout
rendered IdPage
rendered RootLayoutThis is a Next.js project bootstrapped with create-next-app.
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 with your browser to see the result.