- 21 Oct, 2024 16 commits
-
-
vercel-release-bot authored
-
vercel-release-bot authored
-
Zack Tanner authored
We're going to land this after 15. Reverts vercel/next.js#71526
-
vercel-release-bot authored
-
Steven authored
This PR adds missing documentation for the supported src image types. The input format support is determined my `sharp` and can be found here: https://sharp.pixelplumbing.com/api-constructor
-
Jiwon Choi authored
### Why? The prompts selection for React codemods were using "toggle", whereas other prompts using "confirm". Use "confirm" for consistency.
-
vercel-release-bot authored
-
JJ Kasper authored
This ensures we properly clean up workers even if an error is thrown before our normal `.end()` call is done. This can be verified currently by building `pnpm next test/e2e/app-dir/dynamic-io` which should encounter an error and fail but the workers were previously being kept and using lots of CPU, now they are properly cleaned up.
-
Steven authored
chore(docs): remove recommendation about using `priority` over `loading=eager` with `next/image` (#71562) This recommendation to use `priority` instead of `loading=eager` is a little confusing. We don't want `priority` to be overused because it can hurt performance so we can remove this recommendation from the documentation. TLDR: - use `priority` for LCP like a hero image above the fold - use `loading=eager` for other images above the folder - use `loading=lazy` (default) for everything below the fold - use `fetchPriority=high` if you want to load an image out of order that its found in the document
-
Janka Uryga authored
just applying the good old typescript trick that prevent a `'a' | 'b' | string` union from collapsing into `string`, and thus preserving the autocomplete we'd get for `'a' | 'b'` before: <img width="246" alt="Screenshot 2024-10-16 at 21 48 25" src="https://github.com/user-attachments/assets/5bc9c078-fb8a-4aeb-93c5-9ee02854f3f9"> after: <img width="296" alt="Screenshot 2024-10-16 at 21 47 06" src="https://github.com/user-attachments/assets/6b87cc47-ef2b-4124-9dc4-b628b19a4fe3">
-
Hendrik Liebau authored
With this PR, we're assigning names to the transformed `"use cache"` functions, using the same rules as in #71478. Since we can't use named function expressions here, we're using `Object.defineProperty` instead, which we already used in #71478 for server actions with default export expressions. In addition, this PR fixes source mapping of `"use cache"` functions, which was slightly off before, due to the wrong spans being assigned to the new expressions. **Before:** <img width="943" alt="before" src="https://github.com/user-attachments/assets/f7cf674c-32d4-4f0d-a304-d5de5637a6a1"> **After:** <img width="943" alt="after" src="https://github.com/user-attachments/assets/8edda482-a666-4431-bfad-7e21987331eb">
-
Tobias Koppers authored
### What? trace make task dirty add tracing why tasks are marked as dirty report reason when a page is reloaded
-
Jiachi Liu authored
-
JJ Kasper authored
This ensures we properly pass thru expired tags to cache handlers `receiveExpiredTags` methods for `use cache`. These are called per-request as each request can receive tags
-
Sebastian Markbåge authored
This way you can see inline what it really means in terms of numbers with descriptions. Also, document inline CacheLife values. Also fixed a bug where we weren't transferring defaults when a custom was defined. <img width="733" alt="Screenshot 2024-10-20 at 8 48 39 PM" src="https://github.com/user-attachments/assets/420db267-343b-4dc8-9efa-13b0befe8efa"> <img width="700" alt="Screenshot 2024-10-20 at 8 48 48 PM" src="https://github.com/user-attachments/assets/0628b716-b906-49df-a016-65cd9c0b49bf">
-
Josh Story authored
Previously our rules for allowed dynamic were only enforced in builds. This is not tenable for serious adoption because you can't spend all day working on your site and then find out its broken when you build / deploy. To address this I've added a simulated prerendering during dev that should enforce the same rules for rendered routes in dev that would apply during a build. There is no way to avoid doing additional work to implement this feature because we need the abort mechanism of SSR to actually find the dynamic holes that should be disallowed. I was able to avoid completely duplicating the RSC render however by capturing the stream chunks available before the first task completes and stashing them away as a simulated halted RSC payload. I did have to introduce prospective renders to the RSC render and the validating SSR render however to work around issues of lazy module initialization where functions like Math.random and new Date() in module scope would incorrectly trigger dynamic validation when you would not expect them to.
-
- 20 Oct, 2024 14 commits
-
-
vercel-release-bot authored
-
JJ Kasper authored
This ensures we properly normalize the cache handler paths in the manifest since absolute paths can't go in the serialized config as the path might not match where the server is deployed to.
-
Craig authored
<!-- 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 # --> I noticed this typo on https://nextjs.org/docs/messages/prefetch-true-deprecatedCo-authored-by:
JJ Kasper <jj@jjsweb.site>
-
vercel-release-bot authored
-
JJ Kasper authored
This ensures even if there are multiple module instances of the tags-manifest module we have one global tags manifest in memory that is used as the source of truth to prevent drift from revalidateTag and various cache handlers.
-
Sebastian "Sebbie" Silbermann authored
-
Jiachi Liu authored
-
Sebastian Markbåge authored
Stacked on #71528 Thanks to the serverModuleMap option added in https://github.com/facebook/react/pull/31300 we don't need to double decode anymore to load server references when parsing the payload.
-
Sebastian Markbåge authored
-
Sebastian Markbåge authored
-
Eng Zer Jun authored
Currently only the code block in the first section of the ISR page has both TypeScript and JavaScript code. This PR updates the remaining code blocks to include TypeScript code. /cc original author of ISR page @leerob --------- Co-authored-by:
Lee Robinson <lee@leerob.com> Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
JJ Kasper authored
This ensures we properly include this in our traces for output standalone. x-ref: https://github.com/vercel/next.js/actions/runs/11418733317/attempts/2
-
Philippe Serhal authored
Since the `/rsc-cookies-delete` path has a side effect (it runs a middleware code path that deletes client cookies), prefetching this link leads to unpredictable behaviours and possible failures in tests that use this fixture, [such as this one](https://github.com/vercel/next.js/blob/047baaba7d53326f157adc3aaf4b3fb3e13813c2/test/e2e/app-dir/app-middleware/app-middleware.test.ts#L126). I fixed this with `prefetch={false}` but [per the docs](https://nextjs.org/docs/pages/api-reference/components/link#prefetch) it might be preferable to just use a plain `<a>` tag? I'm happy to make that change if you prefer. Alternatively, maybe a `GET` shouldn't have side effects; we could use a form here, fetch, or Server Action or something instead. Here's an example race when running the fixture manually (cookie 1 has been unset by the `/rsc-cookies-delete` prefetch):  Co-authored-by:
JJ Kasper <jj@jjsweb.site>
-
- 19 Oct, 2024 10 commits
-
-
vercel-release-bot authored
-
Josh Story authored
This updates our logging to use Error objects to provide stacks to better locate where sync access of Request APIs is happening
-
Jiachi Liu authored
-
Sebastian Markbåge authored
Not current time. `revalidatedAt` should always be lower than the current time. Otherwise it's some kind of drift or bug.
-
Zack Tanner authored
This logs an error in dev and fails a build when using incompatible segment configs (`dynamic`, `fetchCache`, `runtime`, `dynamicParams`) with dynamicIO. It will point to all discovered pages that contained the invalid segment config at the end of the build.  In dev, it will show the error in an overlay. The invalid segment configs must be removed to build.  Note: This removes all incompatible test cases that were previously part of the `dynamic-io` test suites, and disables one that was using a fetchCache workaround until it's properly handled.
-
Josh Story authored
Currently dynamicIO is implemented without a prospective render of the SSR portion. This is fine in most cases because we don't expect there to be dynamic IO in SSR and you can't use cache APIs in this layer. However the module scope of a lazily loaded module is semantically a static scope but as implemented it woudl execute like it was dynamic. This means things like triggering dynamic on reading the current time can happen even when we would expect it not to. The solution implemented here is to look at whether the SSR render has synchronously dynamic results. If it does we perform the render a second time. We only log during the second render. this way you see the warnings once and only if they persist across render attempts. If you read something like the current time in module scope during the first render it won't log but on the second render the module is already loaded so it also won't log and it won't abort the render early.
-
Hendrik Liebau authored
When importing a server action module from a client component, we've already opted into the server layer, so defining inline `"use cache"` annotated functions should be allowed.
-
Hendrik Liebau authored
Follow-up to #71497, adding support for exporting a function from a `"use cache"` module using a default export expression, e.g.: ```ts "use cache" const foo = async () => {} export default foo ``` -
vercel-release-bot authored
-
Hendrik Liebau authored
-