next.js
9150f1b7 - fix(next): properly pass layout-level `maxDuration` config to the children page segments on build (#68793)

Commit
1 year ago
fix(next): properly pass layout-level `maxDuration` config to the children page segments on build (#68793) > [!NOTE] > This PR is recommended to [hide whitespace](https://github.blog/news-insights/product-news/ignore-white-space-in-code-review/) when reviewing. ### What? Fixed layouts to properly pass route segment config `maxDuration` to their children page segments. ```tsx // layout.tsx export const maxDuration = 5 ``` ### Why? - We separately handle the route segment configs on different places. - `maxDuration` was missing logic to get value from the layouts unlike [other route segment configs](https://github.com/vercel/next.js/blob/canary/packages/next/src/build/utils.ts#L1636-L1652). ### How? - Instead of explicit logic for the `maxDuration`, get the route segment configs from the layout on the page's static info. - Ensure to inherit the value from the layout only if is a page segment. #### See Changes by Commits - current: 522b9537d5d249e39e606f4f69459ac9f9519ded - expected: 12496d445703bb23dc4beb14ed13dcbec458a539 - fix: 196e0e86ee11b9319c899123e16d3a632dbbe37c Fixes NDX-196
Author
Parents
Loading