- 16 Nov, 2023 33 commits
-
-
vercel-release-bot authored
-
Gonzalo Pozzo authored
Update wrong link
-
Shu Ding authored
The code comments added in https://github.com/vercel/next.js/commit/2dc0ba4bd9712e2b5931eb6e00156761384ff44d are missing somehow. These are very necessary to understand the code as it looks confusing.
-
vercel-release-bot authored
-
Zack Tanner authored
### What? When using a `Request` object with fetch, we'll log a warning indicating that using the `cache` property in addition to `revalidate` is unsupported. ### Why? `Request` sets some defaults on the request init, such as `cache: "default"`. This makes the warning confusing and there's no way to avoid it aside from switching the resource argument to be a URL string instead. ### How? This keeps existing behavior but omits the log in the case where a request object is used and no explicit cache overrides are specified. Fixes #58109
-
Jiachi Liu authored
### Issue In the client components world, when you're using `next/dynamic` with `ssr: false` to split chunks in pages of edge runtime, you could get the dynamic imported module still bundled in the server bundle for edge runtime. This could easily hit the bundle limit on edge runtime if you're loading a large size of non-SSR module. This is caused by the whole chunk is still being included when we're creating the client entry. Since the client entry is imported eagerily, webpack will bundle all the modules under it, unless it's explicitly marked not being included. ### Fix For client components, SSR rendering layer of bundle, non-SSR `next/dynamic` calls, we're transform the result of `dynamic()` call from to conditional import the dynamic loaded module. From ```js dynamic(() => import(...)) ``` To ```js dynamic(() => { require.resolveWeak(...) }, { ssr: false }) ``` This will only be applied to SSR layer bundle client components non-SSR `next/dynamic` calls and only when webpack is bundling since turbopack doesn't need this. In this way, the server side will be stripped but it can still enter the module graph since we need to traverse if there's SA in client modules with using webpack API `require.resolveWeak`. And for client side bundle will still include the actual module. Close NEXT-1703 -
Andrew Clark authored
I'm working on a refactor to seed the CacheNodes as soon as the Flight payload is received, rather than lazily during the render phase. This means we no longer need to pass a child element prop to LayoutRouter via childProp. ChildProp includes two fields: a segment and a child element. The child element is the part that will soon be removed, because we'll instead always read from the cache nodes. But even after this refactor, we still need to pass the segment to LayoutRouter. So as an incremental step, I've inlined both fields into separate props: - childProp.current -> initialChildNode. This will be removed in a later step in favor of reading from the cache nodes. In fact, we already always read from the cache nodes — childProp is ignored completely once the cache node is populated, hence the updated name. - childProp.segment -> childPropSegment. This probably isn't the best name anymore but I'll leave renaming until later once more of this refactor has settled. --------- Co-authored-by:kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
Tom Milewski authored
Co-authored-by:
@BRKalow <bryce@clerk.dev> ### What? A number of our customers have been experiencing issues stemming from an `x-forwarded-host` header that doesn't match the `host` header. ### Why? [This PR](https://github.com/vercel/next.js/pull/57815) removes functionality which sets `x-forwarded-host` to `req.headers['host']` and relies solely on the server's hostname and port. This can be seen locally when visiting the app via a localhost subdomain. The `x-forwarded-host` header will remain as `localhost:${port}` while the actual requested host will contain the subdomain. ### Related - https://github.com/vercel/next.js/pull/57815#issuecomment-1808496790 --------- Co-authored-by:
BRKalow <bryce@clerk.dev> Co-authored-by:
Zack Tanner <zacktanner@gmail.com>
-
Zack Tanner authored
### What? When navigating between pages (via `prefetch: false`) within a dynamic segment, the shared layout is re-rendered. This can cause unexpected behavior like layout data changing when navigating between child segments. ### Why? When prefetch is false, we're currently opting into an "optimistic navigation" codepath, which will optimistically render layout-routers up to the point where data is missing, while kicking off data fetches. It attempts to determine where refetching needs to happen by traversing the router cache nodes and checking where data is missing. However, it locates these cache nodes by using "segments" obtained by [deconstructing the URL](https://github.com/vercel/next.js/blob/fix/optimistic-bailout/packages/next/src/client/components/router-reducer/reducers/navigate-reducer.ts#L142), which won't accurately contain dynamic segment data. For ex, `/en` which corresponds with `/app/[lang]/page.tsx` will have a cache node key of `lang|en|d`, not `en`. Similarly, the optimistic tree that gets constructed will also be incorrect, since it uses the URL segment. ### How? My initial fix was to match the dynamic segment against the segment constructed by the URL. But after discussion with @sebmarkbage and the team, it seems more correct to remove the optimistic case all together as there's no guarantee that the url will actually match to that segment. Fixes #50670 --------- Co-authored-by:
Tim Neutkens <tim@timneutkens.nl> Co-authored-by:
kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
-
Zack Tanner authored
### What? Using `revalidateTag` or `revalidatePath` in a route handler will not currently opt the handler into dynamic behavior. This means that if you use these APIs and don't opt into dynamic behavior by some other means, the revalidation call won't do anything as the route handler will be served statically. ### Why? During static generation, we do not currently indicate that usage of these APIs should opt into dynamic usage. ### How? This updates `revalidateTag` to throw a `DynamicUsageError` (similar to our other scenarios, such as search params bailout, headers/cookies, or fetch + revalidate/no-store) Closes NEXT-1712
-
Wyatt Johnson authored
This serves to address a few problems as it relates to headers handling within the App Page render pipeline. 1. During static generation, we should not write to the response directly as the revalidation for static responses is performed out of band from the actual request/response as a stale version can be served early. This is partially addressed by modifying the `onHeaders` to only write when there it is not during static generation, but long term I'd hope to see that we can instead pass a immutable request and `null` for the response to help indicate to the render pipeline that it should instead persist the data into the `RenderResult` objects. Alternatively, the response could use a mocked version that would then supersede the `RenderResult` and be used instead. 2. The types for rendering App Pages were merged incorrectly, so this additionally restructures the way that we initialize those renderers such that only the options that are applicable to each renderer is passed down.
-
Tom Ballinger authored
Co-authored-by:Lee Robinson <me@leerob.io>
-
rodrigo authored
Co-authored-by:Lee Robinson <me@leerob.io>
-
Joshua Santos authored
Co-authored-by:Lee Robinson <me@leerob.io>
-
ihommani authored
Co-authored-by:Lee Robinson <me@leerob.io>
-
Kom ॐ authored
-
Heloi Neto authored
-
Prince Agrawal authored
-
Sean Gray authored
-
Antonis Angelis authored
-
Mojtaba authored
-
kentobento authored
-
kentobento authored
-
kentobento authored
-
Andreas authored
-
Asad Khan authored
-
Marcos Martini authored
-
Bryn Dyment authored
-
Robbert Stevens authored
-
Maxime Richard authored
-
Asad Khan authored
-
Arham Khawar authored
-
Zack Tanner authored
This temporarily disables flushing fetch cache to disk during builds in minimal mode as some additional changes are needed to support it better. [slack context](https://vercel.slack.com/archives/C042LHPJ1NX/p1699928670252259?thread_ts=1699468188.418499&cid=C042LHPJ1NX)
-
- 15 Nov, 2023 7 commits
-
-
vercel-release-bot authored
-
Will Binns-Smith authored
Requires vercel/turbo#6388 This uses the structure implemented in vercel/turbo#6388 to support formatted text when reporting. Right now only the `Line` and basic `String` cases are handled.
-
vercel-release-bot authored
-
Will Binns-Smith authored
This applies next/font to third party code like that in `node_modules` Closes PACK-1964
-
Janicklas Ralph authored
### What? Adding a `performance.mark` for next/third-parties for feature measurement ### Why? We’re working with the Chrome Speed Metrics team to develop an API to better identify specific features used by frameworks and/or CMS platforms. Instead of a entirely new API surface, we've agreed to use `performance.mark` as the signal along with mark_use_counter as a signature. In the past, we've used HTML attributes for Next which have been helpful, but this will improve the accuracy of our feature detection. In this instance, this will better help us analyze and compare sites that use `@next/third-parties` versus those that don't, and to see if our efforts are actually improving performance. It's worth noting that this metric will have a public arm, but we're starting to incorporate its usage now to gather early data. performance.mark calls are indeed low-overhead and shouldn't affect loading/rendering performance whatsoever.
-
Delba de Oliveira authored
Sync with example updates made here: https://github.com/vercel/next.js/issues/57410
-
Shu Ding authored
### React upstream changes - https://github.com/facebook/react/pull/27694 - https://github.com/facebook/react/pull/27695 - https://github.com/facebook/react/pull/27689 - https://github.com/facebook/react/pull/27687 - https://github.com/facebook/react/pull/27677 - https://github.com/facebook/react/pull/27681
-