- 21 Nov, 2024 26 commits
-
-
vercel-release-bot authored
-
Jude Gao authored
- The waitFor function now supports a predicate. Unlike retry, waitFor does not include a timeout. Use it only when the predicate is guaranteed to evaluate to true before proceeding to the next test. If it runs indefinitely, Jest enforces a 120-second timeout per test. - The getCliOutputFromHere utility provides a convenient string getter that captures CLI output in between.
-
Jiachi Liu authored
-
Zack Tanner authored
When handling a redirect through a server action, we pass in the current href rather than the destination href to `handleExternalUrl`, which is incorrect since that won't reflect the updated URL from a server action's redirect response. While looking into this, I noticed a handful of server action branches that weren't properly rejecting or resolving the action promises. This would cause the transitions to stall until they were fulfilled, so I updated all of the existing branches where we early return to also resolve the promise. Fixes #72842
-
Tobias Koppers authored
### What? The bench need to run in the correct directory
-
Lee Robinson authored
Reverts vercel/next.js#72988 Right now, we're focused on making sure the examples linked are guaranteed to work and placed inside the Next.js community GitHub organization.
-
Zack Tanner authored
This prop is a no-op in app router. This removes the code that handled it for the App Router link, and adds a warning for apps that are attempting to use it in an app router context.
-
Sebastian "Sebbie" Silbermann authored
-
Hyungji authored
Hi, Team. The path of route handler seems to be missing `api` and I'd like to fix it. (`middleware.ts` above the route handler file, it requests to `/api/redirects..`) <img width="650" alt="image" src="https://github.com/user-attachments/assets/f9ff3034-de36-42ec-8d85-a4a923005fdf"> Thank you :) ### Improving Documentation - correct route handler path --------- Co-authored-by:
hyungji <hj@doodlin.co.kr> Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
-
kevinmitch14 authored
Fix mdx formatting. Previously MDX was not formatted correctly. (see image - `prefetch=`) https://nextjs.org/docs/app/api-reference/next-config-js/staleTimes <img width="659" alt="Screenshot 2024-11-19 at 15 11 57" src="https://github.com/user-attachments/assets/44f77fd4-657e-409a-9190-9430fd96d5f8"> --------- Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
-
Sam Ko authored
## Why? The default fetch behavior, which is shown as `auto no cache` when you set the config [logging](https://nextjs.org/docs/app/api-reference/next-config-js/logging) to `true`, essentially means fetch once on `next build` to prerender the page. But, when a [Dynamic API](https://nextjs.org/docs/app/building-your-application/rendering/server-components#dynamic-rendering) is used, it will fetch from the resource on every request. This is different from `{ cache: 'no-store' }`, which regardless of whether Dynamic APIs are used, will de-op the page from prerendering.
-
Tobiloba Adedeji authored
This pull request adds the Next.js template for Fleek. Users can use it to get started using full-stack Next.js on Fleek. This template is directly from the official Fleek community templates' collection. ### What? This adds to the templates references within the docs to get Fleek on the Next.js documentation. ### Why? Community templates of Next.js are great to help spread the word that Next.js can be deployed anywhere. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # --> Co-authored-by:
Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
-
🍪 Matt Mayfield authoredThis is meant to add a bit more clarity of why we can't set cookies to the browser in a server component even if it's through a server action or route handler. Co-authored-by:Delba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
-
Jiachi Liu authored
-
Zack Tanner authored
This follows up the work from #73019 to update the implementations for the forked Link components to remove Pages specific handling in the App link, and App specific handling in the Pages link.
-
Tim Neutkens authored
Adds a separate bench for Turbopack build enabled. <!-- Thanks for opening a PR! Your contribution is much appreciated. To make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below. Choose the right checklist for the change(s) that you're making: ## For Contributors ### Improving Documentation - Run `pnpm prettier-fix` to fix formatting issues before opening the PR. - Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide ### Adding or Updating Examples - The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md - Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md ### Fixing a bug - Related issues linked using `fixes #number` - Tests added. See: https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ### Adding a feature - Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. (A discussion must be opened, see https://github.com/vercel/next.js/discussions/new?category=ideas) - Related issues/discussions are linked using `fixes #number` - e2e tests added (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs) - Documentation added - Telemetry added. In case of a feature if it's used or not. - Errors have a helpful link attached, see https://github.com/vercel/next.js/blob/canary/contributing.md ## For Maintainers - Minimal description (aim for explaining to someone not on the team to understand the PR) - When linking to a Slack thread, you might want to share details of the conclusion - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues - Add review comments if necessary to explain to the reviewer the logic behind a change ### What? ### Why? ### How? Closes NEXT- Fixes # -->
-
Zack Tanner authored
There's significant drift between how Link is implemented in pages vs app dir, and we're planning to make even more changes. (For example, we want to change the intersection observer prefetch behavior, but only in app router) To simplify this drift in behavior, this will alias `next/link` to `client/app-dir/link.tsx` in app dir bundles. There is no change in behavior to the `link` component in this PR. The next PR in the stack will remove the current forked handling to remove things that are irrelevant to the router it's rendered in.
-
Donny/강동윤 authored
### What? Enable single-incoming-edge optimization for module fragments with `ModulePart::Export`. ### Why? It will reduce the number of modules greatly. ### How? Closes PACK-3481
-
Sebastian "Sebbie" Silbermann authored
-
Hyungji authored
-
Hyungji authored
-
vercel-release-bot authored
-
Jiwon Choi authored
### Why? This PR added an indication of where the env was loaded from when `experimental.typedEnv` was enabled. Also, it allows the user to set `NODE_ENV=production` to enable the `typedEnv` feature for `.env.production*` files.  ### How? Modified `@next/env` to pass parsed envs along with the `loadedEnvFiles` value and used the location to indicate via JSDoc.
-
Tobias Koppers authored
### What? * make invalidation more granular * fix untagged enum serialization * fixes ppr config option serialization * fix typo * improve tracing * less aggressive persisting * fix verify_serialization feature -
Sebastian "Sebbie" Silbermann authored
-
Tobias Koppers authored
### What? Allow KeyValueDatabase to implement to variants of WriteBatches * Serial: It's not Send+Sync and writing takes a `&mut self` * Concurrent: It's Send+Sync and writing takes a `&self` When using the concurrent variant we can avoid buffering the intermediate results and write that directly to the write batch. But the database need to take care of handling concurrency.
-
- 20 Nov, 2024 14 commits
-
-
vercel-release-bot authored
-
Benjamin Woodruff authored
Dead code strikes again. https://github.com/est31/warnalyzer has been updated for recent rust toolchains, so I might give that a shot soon to see if I can clean up all of our dead functions.
-
Sam Ko authored
## Why? There's a typo in the note—Route Handler should be singular.
-
Jude Gao authored
-
Niklas Mischkulnig authored
The edge runtime does `await self._ENTRIES["middleware_..."].default.call(...)`, so instead export a Proxy that hides that the module object itself is a promise. Partial revert of https://github.com/vercel/next.js/pull/62141
-
Andrew Clark authored
Based on: - #72874 - #72890 - #72872 --- This adds an initial implementation of the client Segment Cache, behind the experimental `clientSegmentCache` flag. (Note: It is not anywhere close to being ready for production use. It will take a while for it to reach parity with the existing implementation.) I've discussed the motivation in previous PRs, but I'll share a brief summary here again: The client Segment Cache is a rewrite of App Router's client caching implementation, designed with PPR and "use cache" in mind. Its main distinguishing feature from the current implementation is that it fetches/caches/expires data per route segment, rather than per full URL. An example of what this means in practical terms is that shared layouts are deduplicated in the cache, resulting in less bandwidth. There are other benefits we have in mind but that's the starting point. I've tried to extract the work here into reasonably-sized commits (many of which have already landed) but this one here is sorta unavoidably large. Here are the main pieces: - [segment-cache/cache.ts](https://github.com/acdlite/next.js/blob/initial-implementation-client-segment-cache/packages/next/src/client/components/segment-cache/cache.ts): This module is where the cache entries are maintained in memory. An important design principle is that you must be able to read from the cache synchronously without awaiting any promises. We avoid the use of async/await wherever possible; instead, async tasks write their results directly into the cache. This also helps to avoid race conditions. Currently there's no eviction policy other than stale time, but eventually we'll use an LRU for memory management. - [segment-cache/scheduler.ts](https://github.com/acdlite/next.js/blob/initial-implementation-client-segment-cache/packages/next/src/client/components/segment-cache/scheduler.ts): This module is primarily a task scheduler. It's also used to manage network bandwidth. The design is inspired by React Suspense and Rust Futures — tasks are pull-based, not push-based. The backing data structure is a MinHeap/PriorityQueue, to support efficient reprioritization of tasks. - [segment-cache/navigation.ts](https://github.com/acdlite/next.js/blob/initial-implementation-client-segment-cache/packages/next/src/client/components/segment-cache/navigation.ts): This module is responsible for creating a snapshot of the cache at the time of a navigation. Right now it's mostly a bunch of glue code to interop with the data structures used by the rest of the App Router, like CacheNodeSeedData and FlightRouterState. The long term plan is to move everything to using the Segment Cache and refactoring those data structures. Additional explanations are provided inline.
-
Steven authored
The `<Image>` component doesn't optimize SVG images since they are vector images and can already scale up and down to any width. Therefore, the component will try to detect SVG images based on the file name to avoid sending them to the Image Optimization API at all. This is because the default behavior of the Image Optimization API is to error for SVG images due to the security implications of `<svg>` with nested `<script>`, etc (unless `dangerouslyAllowSVG` is enabled. However, we don't want users to reach for `dangerouslyAllowSVG` because it is not usually what they intended. So instead, we can improve the heuristic for detecting SVG in the `<Image>` component by ignoring the query string. Related to https://github.com/nodejs/nodejs.org/pull/7244
-
Andrew Clark authored
Based on: - #72874 --- The <head> does not belong to any particular segment; it represents the entire page. Except in the case where two URLs rewrite to the same result, it's very unlikely to benefit from deduplication, so there's no benefit to caching it separately from the route tree. So we'll send it in the same response. Since the head may contain dynamic data, the route tree response may now contain hanging promises, so we'll need to use the same AbortController trick that we use for the segments.
-
Andrew Clark authored
When generating the segment responses, we should use the `prerender` API instead of the `renderToReadableStream` API to ensure that when we abort the stream, dynamic access is encoded as a hanging reference, rather than as an error. I didn't notice this was wrong until I managed to get an initial version of the client Segment Cache running locally and the errors were surfaced in the app. No tests yet since it's not really possible to test until the client is implemented, which I'm working on now. But you can look at the build output and notice that the errors are no longer present.
-
Andrew Clark authored
In the Segment Cache implementation of prefetching, during a navigation, it's possible that the prefetch for a segment may already be in-progress, but we haven't received its data yet. In that case, since the prefetch is very likely to load faster than the dynamic request, we might as well use the result, if we can. This updates type CacheNode.loading to accept a promise for the loading module data, and updates the LayoutRouter to conditionally unwrap it if needed. We already use this same strategy in other places, like for streaming in the main segment data.
-
Jude Gao authored
Reverts vercel/next.js#72966
-
Oskar Radziewicz authored
Co-authored-by:Jiachi Liu <inbox@huozhi.im>
-
Sebastian "Sebbie" Silbermann authored
No significant changes to runtime detected.
-
Alexander Lyon authored
- `__turbopack_external_require__("node:buffer")` becomes `__turbopack_external_require__("node:buffer", () => require("node:buffer"))`. - This way, running esbuild on the Turbopack output will correctly detect usage of Node builtins and is able to polyfill them - To make that `require` the global (non-shadowed) one, change the previous `t: require` item from `__turbopack_context__` to `t: __turbopack_require_real__` and the fake require added in https://github.com/vercel/next.js/pull/70255 to `__turbopack_stub_require_` Closes PACK-3389 --------- Co-authored-by:Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
-