- 15 Oct, 2024 21 commits
-
-
vercel-release-bot authored
-
Jiachi Liu authored
Co-authored-by:eps1lon <sebastian.silbermann@vercel.com>
-
Janka Uryga authored
Fixes an issue where using `after` in a `runtime = "edge"` page would throw an error saying that `waitUntil` is missing. This was because we weren't correctly passing `waitUntil` into the edge runtime sandbox. (More precisely, the WebServer we run for those app-page/app-route handlers wasn't receiving `waitUntil` -- middleware goes through a different codepath and thus was fine) This PR (ab)uses the `"@next/request-context"` global ALS (intended for platforms to provide `waitUntil` to Next.js) to fix this -- it works because the wrapped WebServer will read `"@next/request-context"` and thus use the correct `waitUntil`.
-
JJ Kasper authored
-
JJ Kasper authored
-
Zack Tanner authored
-
JJ Kasper authored
-
vercel-release-bot authored
-
Jimmy Lai 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 # -->
-
JJ Kasper authored
Small follow-up to https://github.com/vercel/next.js/pull/71263 this should be `Symbol.for` so we use the same reference instead creating a new Symbol.
-
vercel-release-bot authored
-
Zack Tanner authored
This re-adds the gate that verifies canary is being used before allowing certain experimental features to be enabled. This is because these features are undergoing frequent changes where we want to make sure that the latest iterations are being validated.
-
Hendrik Liebau authored
With the default debug console: <img width="1075" alt="Screenshot 2024-10-15 at 13 22 12" src="https://github.com/user-attachments/assets/5f87b1da-1ac1-4483-bf2e-4903b43b33d9"> With the integrated terminal: <img width="1075" alt="Screenshot 2024-10-15 at 13 22 20" src="https://github.com/user-attachments/assets/a7cb6b80-c028-46fe-9afc-5f4eceaf172a">
-
Hendrik Liebau authored
Same as #70897, but for the Edge runtime. The changes are based on what we're already doing for app pages that are using the Edge runtime.
-
Jiwon Choi authored
-
Jiwon Choi authored
### Why? Is not experimental, but has some restrictions (module resolution to CJS, incompatible with ESM-only packages or syntax).
-
Jiachi Liu authored
Co-authored-by:eps1lon <sebastian.silbermann@vercel.com>
-
Tobias Koppers authored
### Why? Avoiding allocations
-
Sebastian Markbåge authored
The cacheScope needs to contain the full CacheEntry, not just the stream, so that it can transfer tag/life to the parent scope when it's used. I needed to do some refactoring. The tricky bit is that we want to store a Promise into both the cacheHandler and the cacheScope as early as possible to ensure they can dedupe and future requests while it's still pending.
-
Zack Tanner authored
The static indicator shouldn't show for pages that are opted into dynamic rendering via `export const dynamic = 'force-dynamic'`.
-
Sebastian Markbåge authored
This marks it as dynamic but not "sync abort" since these are not sync APIs. A new heuristic here is that if the `expire` time is low, then we also treat that as dynamic for the purpose of prerendering since it's not worth including if it's supposed to change frequently but it is still possible to temporarily cache it or client-cache it.
-
- 14 Oct, 2024 19 commits
-
-
vercel-release-bot authored
-
Andrew Clark authored
When sending a statically generated response, the server includes the stale time of the data as a response header. This updates the client prefetch cache to use this value to determine when the data is stale. When available, the stale time sent by the server takes precedence over all other existing heuristics. In the future, when PPR is enabled, the server-generated value should *always* be available during a prefetch, unless the server prefetch hasn't received any data by the time the navigation happens, in which case we should skip the prefetch anyway.
-
Sebastian Markbåge authored
That way the client router can use it to inform its cache. This is only done during prerender which is typically the only things we prefetch (other than loading.tsx). I add it to `.meta` but this applies to both the RSC and HTML payloads I believe. I'm not sure if there's away to only add it to the RSC payload. For static parts of the HTML document we need a different strategy than the head so this doesn't work for initial load.
-
Jiachi Liu authored
-
Sebastian "Sebbie" Silbermann authored
Just noticed this on Front but couldn't figure out how to repro.
-
Jiachi Liu authored
-
Josh Story authored
When prerendering pages and routes errors with dynamicIO enabled, errors during the prospective render may be supressed from logging. Normally this is expected and ok because the dynamic portion of a render may be expected to error during prerendering. However some codepaths are not hit the same between the prospective and final renders and so it can be useful to have the ability to get additional insight into the runtime behavior of the prospective render. This change adds extra logging when `process.env.NEXT_DEBUG_BUILD` is enabled. When this environment variable is set we log errors that throw during the prospective render.
-
Sebastian Markbåge authored
This should really be a global config but we don't have an easy way to get the config from a module. Might need a loader. So this just plumbs it through a bunch of contexts. I'm also generate the enum type based on the config.
-
Jiwon Choi authored
> [!WARNING] > **Breaking Change:** Now uses `eslint-plugin-react-hooks@5.0.0` which has a new violation disallowing Component names starting with anything but an uppercase letter. See https://github.com/facebook/react/releases/tag/eslint-plugin-react-hooks%405.0.0 for more details. Adds support of ESLint v9 to `eslint-plugin-next`, `eslint-config-next` and `next lint`. Does not require using the new flat config format. `next lint` will automatically ensure the old config format can be used. ### Why? As `eslint-plugin-react-hooks` has been updated for ESLint v9 support and is a helpful package for Next v15 upgrade, unblock the restrictions to upgrade to ESLint v9. Also, ESLint v8 is [End of Life](https://eslint.org/blog/2024/09/eslint-v8-eol-version-support/#:~:text=ESLint%20v8.-,x%20end%20of%20life%20is%20October%205%2C%202024,x%20on%20October%205%2C%202024.) support since Oct 5th, so is good to unblock v9 now. Plugins bumped: - [x] [@rushstack/eslint-patch](https://github.com/microsoft/rushstack/pull/4719) ([v1.10.3](https://www.npmjs.com/package/@rushstack/eslint-patch/v/1.10.3?activeTab=versions) no release post, confirmed on NPM) - [x] [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/pull/9002) ([v8.0.0](https://github.com/typescript-eslint/typescript-eslint/pull/9002#issuecomment-2106424400)) - [x] [eslint-plugin-import](https://github.com/import-js/eslint-plugin-import/pull/2996) ([v2.31.0](https://github.com/import-js/eslint-plugin-import/releases/tag/v2.31.0)) - [x] [eslint-plugin-jsx-a11y](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/1009) ([v6.10.0](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/releases/tag/v6.10.0)) - [x] [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react/pull/3759) ([v7.35.0](https://github.com/jsx-eslint/eslint-plugin-react/releases/tag/v7.35.0)) - [x] [eslint-plugin-react-hooks](https://github.com/facebook/react/pull/28773) ([v5.0.0](https://github.com/facebook/react/releases/tag/eslint-plugin-react-hooks%405.0.0)) We have to switch to ESLint v9 in our repo due to a pnpm bug where it automatically uses ESLint v9 even though we only installed it via `eslint-v9: npm:eslint@9.0.0`. This is a pnpm bug that wouldn't happen with Yarn v1, v4 nor NPM. Closes https://github.com/vercel/next.js/issues/64409 Closes https://github.com/vercel/next.js/issues/64114 Closes https://github.com/vercel/next.js/issues/64453 Closes NEXT-3293 --------- Co-authored-by:
Sebastian "Sebbie" Silbermann <sebastian.silbermann@vercel.com>
-
Mo Beigi authored
-
Hendrik Liebau authored
When using Turbopack, after a client-side navigation, the source map for a client chunk might be requested using an URL-encoded pathname, e.g. `/_next/static/chunks/%5Bproject%5D__48591b._.js` instead of `/_next/static/chunks/[project]__48591b._.js`. When trying to look up the source map this would fail with: ``` Failed to get source map: [Error: chunk/module is missing a sourcemap] { code: 'GenericFailure' } ``` To fix this, we're now decoding the filename. ## Test Plan - start `pnpm next dev --turbo test/development/app-dir/source-mapping` - go to `http://localhost:3000` - click on "client component page" link - open React DevTools Components view - select `Form` - click on `bar()` action (requires version 6.0) - you should end up in the the `actions.ts` source file -
JJ Kasper authored
This moves this out of the request context as it can be it's own global symbol instead.
-
Jiachi Liu authored
-
Sebastian Markbåge authored
This doesn't yet use them. That'll be a follow up. Another follow up is to handle propagation of timestamps.
-
Tobias Koppers authored
### What? * introduce and use use FxIndexMap and FxIndexSet everywhere instead of IndexMaps * use FxHashing in DashMaps
-
Tobias Koppers authored
### What? It was rounding a bit too much to be useful
-
Niklas Mischkulnig authored
I pulled out the core change from https://github.com/vercel/next.js/pull/71155 - Refactor resolve functions to accept a `is_optional` boolean instead of an explicit severity - Add `ResolveOptions::loose_errors` to only emit warnings instead of errors Not sure if `loose_errors` is the best name. `warn_instead_of_errors`, `emit_warnings_only` ?
-
Donny/강동윤 authored
### What? Make `EcmascriptModulePartAsset::is_async_module` specify `ModulePart` correctly while analyzing ### Why? The previous code makes all dependencies of a module to be loaded. ### How?
-
Sebastian "Sebbie" Silbermann authored
-