Commit Graph

64 Commits

Author SHA1 Message Date
Jiwon Choi d7aa66c345 Remove generated error codes (#97687)
### Why?

Should come up with better solution that does not block PRs with git
conflict

x-ref:
https://vercel.slack.com/archives/C02CDC2ALJH/p1785263902728189?thread_ts=1785263687.502649&cid=C02CDC2ALJH

### How?

- Delete `errors.json`, the error-code SWC plugin, generated WASM, merge
driver, and validation/build tooling.
- Stop attaching error codes to server-rendering digests, redboxes, and
telemetry; native `Error.code` and `Error.name` remain available where
applicable.
- Remove the development-overlay error feedback UI, middleware, and
telemetry event that depended on stable codes.
- Update fixtures, snapshots, and guidance for code-free errors and
numeric-only digests.

<!-- NEXT_JS_LLM -->
2026-08-21 22:45:12 +02:00
Tim Neutkens b5538511ed test: update React 18 redbox snapshot (#97415) 2026-08-15 15:11:41 +02:00
Benjamin Woodruff 727a3ffa86 [ci] Skip apt-installed dependencies in playwright install step (#95535)
The hypothesis is that this is just installing some font stuff that
isn't actually needed for Chromium to work:

```
The following additional packages will be installed:
  libnss3-tools xfonts-encodings xfonts-utils
Recommended packages:
  fonts-ipafont-mincho fonts-liberation-sans-narrow fonts-tlwg-loma
The following NEW packages will be installed:
  fonts-freefont-ttf fonts-ipafont-gothic fonts-liberation fonts-tlwg-loma-otf
  fonts-unifont fonts-wqy-zenhei xfonts-cyrillic xfonts-encodings
  xfonts-scalable xfonts-utils
The following packages will be upgraded:
  libnss3 libnss3-tools
2 upgraded, 10 newly installed, 0 to remove and 35 not upgraded.
```

`apt` is very slow, so skipping this step should significantly reduce
setup time per test shard.

It seems like this isn't always true for other browsers, so only skip
this for Chromium (that's fine, that's what most of our jobs use
anyways).

On 16 core arm runners, "Install Playwright Browsers" typically took
18-24 seconds. Now it takes 5-6s.

Let's estimate that saves about 15s per Linux job that installs
Chromium. Claude estimates that there are 73 chromium-only Linux jobs on
this PR:

<img width="891" height="148" alt="Screenshot 2026-07-06 at 10 30 16 PM"
src="https://github.com/user-attachments/assets/725893fa-9f6f-4806-a3b4-9858ab0ebe66"
/>

So that's 15*73/60=18.25 minutes saved per PR push (the average PR gets
many pushes). At the public (before any volume discounts) price of
$0.026/minute for the 16 core arm runners, that comes out to $0.4745 per
PR push saved.

This workflow has had 3,894 runs in the last 30 days, so that could be
$1,847/mo saved, but many of those workflow runs were canceled, and some
likely failed before getting to these jobs, so the actual savings are
probably somewhere around half of that -- scroll through
https://github.com/vercel/next.js/actions/workflows/.github/workflows/build_and_test.yml
and see that a little less than half of the workflow runs end up
canceled.
2026-07-07 09:48:46 +02:00
Tim Neutkens e860cec656 test: migrate webdriver callers to next.browser (#93941)
### What?

Migrate remaining direct `next-webdriver` test callers that have a
`NextInstance` to `next.browser()`, and expose the shared `Playwright`
browser type from `e2e-utils`.

### Why?

`NextInstance.browser` should be the supported browser-opening interface
for test fixtures, with `next-webdriver` kept as the private
implementation detail.

### How?

Updated affected development, e2e, and production tests to call
`next.browser()` directly, passing `baseUrl` where tests intentionally
target a manually spawned or proxied server. Shared helpers now receive
browser callbacks from the test context, and browser types import
`Playwright` from `e2e-utils` instead of deriving from `next.browser` or
importing from private paths.

<!-- NEXT_JS_LLM_PR -->
2026-05-22 14:01:58 +02:00
Tim Neutkens 4588a73542 Convert tests using createNext -> nextTestSetup (#93767)
## What?

Converts existing `createNext()` usage into `nextTestSetup()`. 

`createNext()` was the setup step we had before `nextTestSetup()` was
added.

This PR focused on the simple conversion cases. There will be a
follow-up to complete the last few.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-12 13:16:31 +02:00
Hendrik Liebau d2e6b6c0e4 Preserve __NEXT_ERROR_CODE across the /_error page handoff (#93183)
When SSR fails in development — whether the failing page is in the App Router or the Pages Router — Next.js falls back to rendering the Pages Router `/_error` page and serializes the original error into `__NEXT_DATA__.err`. The client bootstrap in `packages/next/src/client/ index.tsx` later re-throws a fresh `new Error(initialErr.message)` so that the dev overlay picks it up. The error-code SWC plugin stamps that new `Error` with the generic code mapped to `%s` in `errors.json` because the message argument is an identifier, not a statically-known string, which is how the overlay ended up showing the wrong code for errors like `UseCacheTimeoutError`.

The pipeline has two problems on the way to the overlay. First, `errorToJSON` in `packages/next/src/server/render.tsx` only copies the error's standard fields (`name`, `source`, `message`, `stack`, `digest`) into `__NEXT_DATA__.err`, so the real `__NEXT_ERROR_CODE` attached to the thrown error never reaches the client. Second, the subsequent rewrap in `getServerError` at `packages/next/src/server/dev/node-stack- frames.ts` creates yet another `new Error(...)` that the plugin stamps with the same generic code, clobbering anything the caller might have set on the rewrapped instance.

This change plumbs the code through. `errorToJSON` now also emits `__NEXT_ERROR_CODE` using `extractNextErrorCode` so the value survives JSON serialization into `__NEXT_DATA__.err`; the type in `packages/next/src/shared/lib/utils.ts` is updated to match. Both rewrap sites — the client bootstrap and `getServerError` — copy the code from the source error onto the fresh `Error` via `Object.defineProperty` with `enumerable: false` and `configurable: true`, matching how the plugin itself stores the property, which overrides the generic code the plugin stamped on the rewrapped instance. The `use-cache-hanging` e2e test snapshot is updated from `E394` to `E236` now that the real code surfaces in the dev overlay.
2026-04-27 18:53:19 +02:00
Sebastian "Sebbie" Silbermann fe1c1c3fb2 [test] Deflake shallow-routing (#93006)
Rarely flakes because the Router hasn't updated yet.

[`@test.source.file:test/development/pages-dir/client-navigation/shallow-routing.test.ts -@test.status:pass `](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.source.file%3Atest%2Fdevelopment%2Fpages-dir%2Fclient-navigation%2Fshallow-routing.test.ts%20-%40test.status%3Apass&agg_m=count&agg_m_source=base&agg_q=%40test.name&agg_q_source=base&agg_t=count&currentTab=overview&eventStack=&fromUser=false&index=citest&top_n=10&top_o=top&viz=toplist&x_missing=true&start=1776022337626&end=1776627137626&paused=false)

<img width="2496" height="906" alt="CleanShot 2026-04-19 at 21 32 45@2x" src="https://github.com/user-attachments/assets/50d6af2f-8dfe-4765-ab92-3e42985a9da4" />
2026-04-20 01:21:02 +02:00
Hendrik Liebau 4693685be1 [test] Fix flaky url-hash tests (#91649)
[Flakiness
metric](https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40git.repository.id%3A%22github.com%2Fvercel%2Fnext.js%22%20%40test.name%3A%22Client%20navigation%20with%20URL%20hash%20when%20hash%20changes%20with%20state%20when%20passing%20state%20via%20hash%20change%20should%20increment%20the%20history%20state%20counter%22%20%40test.type%3A%22turbopack%22%20%40test.status%3A%22fail%22&agg_m=count&agg_m_source=base&agg_t=count&fromUser=false&index=citest&start=1773314950142&end=1773919750142&paused=false)
(for one of them)

Another case where the Playwright upgrade exposed missing `retry`s.
2026-03-19 20:08:59 +00:00
Tobias Koppers 4494261bd7 Remove devCacheControlNoCache experimental option (hard-code no-cache) (#91503)
### What?

Removes the `experimental.devCacheControlNoCache` config option entirely
and hard-codes `no-cache, must-revalidate` as the dev server
`Cache-Control` header value.

Previously the option controlled whether the dev server responded with:
- `no-store, must-revalidate` (default, `false`)
- `no-cache, must-revalidate` (opt-in, `true`)

This PR first flips the default to `true`, then removes the option
altogether — making `no-cache, must-revalidate` unconditional in all dev
code paths.

### Why?

`no-cache` is strictly better than `no-store` for the dev server:
- `no-cache` allows the browser to revalidate (conditional
`If-None-Match`/`If-Modified-Since` requests), letting the server
respond with `304 Not Modified` when nothing changed → faster page loads
during development.
- `no-store` forces a full re-fetch every time, discarding valid cached
responses.

Since `no-cache` is the correct behavior for all dev users, the toggle
has no remaining value and can be removed to simplify the codebase.

### How?

**Two commits:**

1. `bcec825` — Flip the default from `false` → `true`; update
tests/fixtures/manifest to reflect the new default.

2. `e6e919f` — Remove the option entirely:
- Deleted `devCacheControlNoCache?: boolean` from `ExperimentalConfig`
interface, `config-schema.ts` Zod schema, `defaultConfig`,
`NextConfigRuntime`, and `getNextConfigRuntime()`.
- Replaced all four conditional ternaries in `base-server.ts`,
`router-server.ts`, `pages-handler.ts`, and `app-page.ts` with the
hard-coded string `'no-cache, must-revalidate'`.
- Deleted the `dev-cache-control-no-cache-disabled` test suite (was
testing the `false` path which no longer exists).
- Simplified the remaining `dev-cache-control-no-cache` test (removed
experimental framing).
   - Synced `rspack-dev-tests-manifest.json`.

---------

Co-authored-by: Tobias Koppers <sokra@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
2026-03-17 20:13:01 +01:00
Sebastian "Sebbie" Silbermann 7d98e0b534 [test] Include error code in Redbox snapshot (#90497) 2026-02-26 11:01:25 +00:00
Sebastian "Sebbie" Silbermann 93cf074e38 [test] Move off of as much url.parse as possible (#87286)
`url.parse` is deprecated in favor of WHATWG URLs. 

Almost all tests don't actually test integration with `url.parse`.

The remaining places test integration with the Next.js request handler
which does accept `url.parse` values.

We may deprecate that specific signature in favor of accepting WHATWG
URLs instead.
2025-12-26 14:00:28 -07:00
Cong-Cong Pan affb52dafc chore: update rspack 1.6.5 (#86853)
update @next/rspack-core version to 1.0.2 and update the snapshot

other changes:

- packages/next/src/build/webpack-config.ts
Adjusted configuration to account for differences in default node config
between Rspack and Webpack.

- packages/next/src/shared/lib/format-webpack-messages.ts
Added a fallback to moduleIdentifier in cases where Rspack does not
correctly populate moduleName.
2025-12-17 05:07:52 +00:00
Cong-Cong Pan ed41ac1a74 chore: upgrade rspack 1.6.0 (#84210)
1. Fixed the incremental update bug in buildChunkGraph.
2. Fixed a bug in Rspack's built-in CssChunkingPlugin.

For detailed release information, please see
https://github.com/web-infra-dev/rspack/releases.

Note: All the faulty Rspack test cases on GitHub, from what I can see,
either time out or also produce errors in Rspack version 1.5.0.

---------

Co-authored-by: Benjamin Woodruff <benjamin.woodruff@vercel.com>
2025-11-06 01:29:04 +00:00
Sebastian "Sebbie" Silbermann 0b58a32c45 [test] assert* -> waitFor* when the util is not instant (#85450) 2025-10-30 14:44:08 +01:00
Tobias Koppers 3567c153b3 Turbopack: improve module evaluation name (#84633)
### What?

We can use the demangled name directly, which is much easier and applies to more cases.
2025-10-20 14:03:50 -07:00
Sebastian "Sebbie" Silbermann 6feaddf73e Remove unused eslint-disable directives (#84797)
Co-authored-by: Hendrik Liebau <mail@hendrik-liebau.de>
2025-10-12 23:17:08 +02:00
Jiwon Choi c388db43dc CI: Enable experimental.isolatedDevBuild for test-dev (#84562)
Enabling `experimental.isolatedDevBuild` required many changes to the
current workflow, so we will incrementally roll out to the tests.

Enabling on test-dev instead of test-experimental-dev because
`-experimental` CIs are filtered via `experimental-tests-manifest.json`
and they don't cover all tests. We want to enable this feature by
default so we should ensure this incremental rollout is covered on all
test cases.

The flag was enabled for `test-experimental-dev` at
https://github.com/vercel/next.js/pull/84099, and this PR moves the flag
to the `test-dev` job.

1. ~~test-experimental-dev
([link](https://github.com/vercel/next.js/pull/84099))~~
2. test-dev (here)
3. test-prod
4. test-integration
5. test-unit
6. Enable by default, remove the flag, and update the rest

x-ref: https://github.com/vercel/next.js/pull/84043
2025-10-07 00:44:08 +02:00
Cong-Cong Pan 5712c05c55 fix(Rspack): resolve HMR unresponsiveness or unexpected full reload & update dev snapshot (#83480)
This commit addresses the bugs where Hot Module Replacement (HMR) was
not functioning correctly in Rspack mode. Component edits would often
result in no update or a full page reload instead of a fast,
state-preserving refresh.

This commit implements a new, custom React Refresh plugin and runtime
specifically for Rspack, which correctly orchestrates the HMR lifecycle.
2025-09-16 01:26:36 +00:00
Cong-Cong Pan 45b4a985c5 chore: update Rspack test cases snapshot (#83202) 2025-09-03 14:08:13 +00:00
Hendrik Liebau 4b66771895 Remove deprecated legacyBehavior and passHref prop from Link component (#83003)
The `legacyBehavior` prop of the `Link` component has been deprecated
since #77473. For Next.js 16, we're finally removing support for it.
Consequently, we're also removing support for the `passHref` prop, which
was only useful in conjunction with the `legacyBehavior` prop.

A [codemod is
available](https://nextjs.org/docs/app/guides/upgrading/codemods#new-link)
to help you automatically upgrade your codebase.

reverts #77473

---------

Co-authored-by: Sebastian Sebbie Silbermann <sebastian.silbermann@vercel.com>
2025-08-26 14:04:27 +02:00
Luke Sandberg da7cbb13be [turbopack] Use Arrays instead of objects to bootstrap chunks (#81877)
### Improve performance of chunk bootstrapping leveraging arrays and maps

Currently we bootstrap the set of the modules in a chunk by passing an object to the runtime, this is suboptimal for a few reasons:

* The runtime just wants to iterate the object and copy it into a runtime datastructure and iterating objects is relatively slow
* The browser needs to spend time computing the 'shape' of this object and possibly changing internal representations

The solution to both these problems is of course, Arrays!.  so instead of an object like

```
{ [moduleId]: (__turbopack_context__) => {},...}
```

we use an array like this

```
[ moduleId, (__turbopack_context__) => {}]
```
* a non-empty sequence of module ids come first
   - we may have more than one to support scope hoisted modules
* the factory function

Because these objects are temporary this should make both constructing and iterating them faster.

Finally, in the runtime what we want to do is copy these modules into a global map that is represented as an `Object`.  Because we are constantly inserting new keys, this is a suboptimal case and a `Map` should be faster for both insertions and lookups.  So this adapts the moduleFactory type to use an es6 `Map` which is more optimized for this particular usecase.

Ideally we would do the same for the moduleCache but that would complicate `require.cache` usecases.  We could perhaps leverage a `Proxy` to maintain support but this is left as future work.

### Aside: why are arrays faster than objects?

Arrays are faster to parse because they incur fewer 'shape transitions' (background reading: https://v8.dev/blog/fast-properties vs https://v8.dev/blog/elements-kinds).  Basically for every new property v8 parses on the object literal it changes the hidden type (or 'shape').  For arrays the same thing happens but the process is much simpler as there is a fixed set of possible shapes and the browser will hit the terminal one after evaluating the second element.

Also arrays are simply faster to iterate than objects (but this is generally a non-controversial statement).

### Performance
Based on the `module-cost` benchmark this is a consistent win in all scenarios


| Scenario | Metric | HEAD (ms) | CHANGE (ms) | Delta (ms) | % Change |
|----------|--------|-----------|-------------|------------|----------|
| **Pages API ESM** | Load Duration | 33.46 | 27.87 | -5.59 | -16.7% ✅ |
| | Execution Duration | 63.22 | 62.54 | -0.68 | -1.1% ✅ |
| **Pages API CommonJS** | Load Duration | 44.11 | 33.76 | -10.35 | -23.5% ✅ |
| | Execution Duration | 32.05 | 25.70 | -6.35 | -19.8% ✅ |
| **Client ESM** | Load Duration | 34.74 | 27.65 | -7.09 | -20.4% ✅ |
| | Execution Duration | 46.13 | 40.35 | -5.78 | -12.5% ✅ |
| **Client CommonJS** | Load Duration | 30.43 | 24.48 | -5.95 | -19.6% ✅ |
| | Execution Duration | 25.15 | 17.18 | -7.97 | -31.7% ✅ |

### Risks

The biggest risk of this change is subtle bugs introduced due to `string` vs `number` confusion.   I found one subtle issue in how we rewrite `new Worker()` constructors, there could be more not covered by tests.
2025-08-02 11:47:23 -07:00
Tobias Koppers 825753a284 Turbopack: name the module factory function (#73553)
### What?

In development give the module factory a useful name, so it's clear in stack traces that this is the module evaluation part of the execution.

This also fixes some bugs with the stack trace parser, which seems to struggle if function names contain brackets. The automatically inferred function name would be the module id, which contains brackets.
2025-08-02 10:15:24 -07:00
Sebastian "Sebbie" Silbermann f0bf674e72 Remove experimental.strictNextHead (#81882) 2025-07-21 20:12:43 +02:00
Zack Tanner 63090e20f1 fix: pages router metadata bugs with React 19 (#81733)
When we updated `experimental.strictNextHead` to be true in #65418, we
did not update all spots that would default to true in the case where
the value was omitted entirely.

This led to the default value not being correctly applied in pages
router, which resulted in duplicate metadata w/ React 19.

Since we made the flag the default, we can also probably clean up this
flag all together, but that can be done separately.

Fixes #81655
Fixes #81689
2025-07-16 14:25:01 -07:00
Sebastian "Sebbie" Silbermann 8d78992557 [sourcemaps] Ignore-list sources whose sourcemaps ignore-list everything (#81231)
webpack-only at the moment since I have no easy stack to test this on in Turbopack until we sourcemap the Turbopack runtime.

This applies the same heuristic Chrome uses. For sources whose associated sourcemap ignores everyone of its sources, we ignore-list that source even if we didn't find a mapping. This is similar to other common heuristic where the closest mapping is used when no exact mapping exists.
2025-07-04 21:23:50 +02:00
Sebastian "Sebbie" Silbermann 7ed2d23ae5 [devtools] Omit line/col numbers for anonymous sources (#81223) 2025-07-03 15:23:27 +02:00
Benjamin Woodruff 837e086479 chore(CI): Break pages-dir client-navigation dev tests into smaller parallelizable files/suites (#78787)
Jest can run different suites in parallel, but tests within the same suite must run sequentially in the same worker.

You don't want suites that are too small, because each suite requires relatively expensive repository setup, but you also don't want suites that are too large because it inhibits parallelism.

This is a big problem for arewerspackyet, where many of these test cases are currently failing. Each test can take up to 4 minutes to time out, so we easily time out the entire 90 minute long test runner job.

## Test plan

Tested by running all these tests in parallel with:

```
NEXT_TEST_MODE=dev HEADLESS=true node_modules/.bin/jest test/development/pages-dir/client-navigation
```

It completes in about 2m40s minutes on my machine.
2025-05-05 17:10:56 -07:00
Sebastian "Sebbie" Silbermann 8ea7d4bb35 [dev-overlay] Move error.name to label (#78198) 2025-04-25 11:00:58 +02:00
Sebastian "Sebbie" Silbermann c334056eeb [dev-overlay] Add dedicated label for recoverable errors (#78186) 2025-04-16 09:49:35 +02:00
Sebastian "Sebbie" Silbermann b9d65b8afe [test] Assert on all errors in Redbox matchers (#77907) 2025-04-10 10:00:42 +02:00
Tim Neutkens 6e51845ac4 Rename process.env.TURBOPACK to process.env.IS_TURBOPACK_TEST for tests (#77892)
Preparation for removing `process.env.TURBOPACK` being added to
Turbopack tests. That way we can properly test `next start` without
`process.env.TURBOPACK` being set.

<!-- 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 #

-->
2025-04-07 14:07:55 +02:00
Sebastian "Sebbie" Silbermann 855670e836 [dev-overlay] Remove "Unhandled Runtime Error" label (#77484) 2025-03-25 14:10:35 -07:00
Sebastian "Sebbie" Silbermann 372d02d588 [test] Use new Redbox matchers in pages/ client-navigation/rendering (#76798) 2025-03-09 14:33:28 +01:00
Sebastian "Sebbie" Silbermann 48c58434bd [test] Use next.browser instead of webdriver in pages/ client-navigation (#76867) 2025-03-06 18:38:19 +01:00
Sebastian "Sebbie" Silbermann 059c255c37 [dev-overlay] Always show relative paths (#76742) 2025-03-04 09:32:17 +00:00
Sebastian "Sebbie" Silbermann d4919b317d [test] Fix flaky error-recovery test (#76753)
Fixes
https://github.com/vercel/next.js/actions/runs/13628820428/job/38093524162
2025-03-03 13:14:44 +01:00
Jiachi Liu 7a0d1b4923 [test] fix client navigation error count in react 18 (#76442) 2025-02-24 20:42:14 +01:00
Sebastian "Sebbie" Silbermann 871ca31e60 [app] Send errors not handled by explicit error boundaries through reportError (#76101) 2025-02-24 17:59:22 +01:00
Sebastian "Sebbie" Silbermann 034972215c Consolidate next/link error tests (#76214) 2025-02-19 23:34:04 +01:00
Jiwon Choi f0887fa068 test: replace explicit padding-bottom with devIndicators: false for scroll position testing (#76105)
### Why?

There were explicit `paddingBottom: 60` set to fixtures due to the dev
indicator blocking the scroll position. Since an option to disable it
was added at https://github.com/vercel/next.js/pull/76079, this PR
replaced them with `devIndicators: false`.

x-ref:
https://github.com/vercel/next.js/pull/76077#discussion_r1957164641
2025-02-18 06:03:58 +09:00
Sebastian "Sebbie" Silbermann c02bca2322 Current behavior for reportError (#76115) 2025-02-17 22:02:08 +01:00
Zack Tanner 1c85b755b5 [DevOverlay]: enable by default (#75882)
- `newDevOverlay: true` by default (enables experimental React builds on
canary until owner stacks progress further)
- `run-tests` now sets the env var for tests that were relying on it for
forking behavior
- PPR runners now run with the flag disabled to help catch regressions
in the old overlay until we remove it
- Fixed a number of tests that had outdated snapshots or missed forking
behavior because they weren't running in CI
- Disabled a test that was failing in Turbopack + Experimental React
that is unrelated to the overlay (see:
https://github.com/vercel/next.js/pull/75989)

---------

Co-authored-by: devjiwonchoi <devjiwonchoi@gmail.com>
2025-02-13 10:57:32 -08:00
Niklas Mischkulnig d3529bad5d Turbopack: next/dynamic use transitions instead of AST analysis (#73627)
- Before, there was a separate AST traversal that collected `next-dynamic` imports
- Now, we use transitions (which are inserted by the existing next-custom-transform) to tell Turbopack about the next-dynamic imports
	- Unlike Webpack (where the react-loadable identifiers are `path/to/parent-module -> ./imported-client`), Turbopack just uses the module id: `[project]/path/to/imported-client.js [app-client] (ecmascript, next/dynamic entry)`
	- the `next-dynamic` transition only inserts the marker module (i.e. for the SSR `import()`) 
	- the `next-dynamic-client` transition inserts the marker module and changes the module context (used to get the client module name)
- Now, we use the correct `AvailabilityInfo` for the next/dynamic chunks to preload, and they are not explicitly emitted. If they are for some reason not the same chunks that are actually emitted for the dynamic import, you get a hard error. (Previously, they didn't use the same `AvailabilityInfo` as the real async chunks, so they usually bundled another copy of React, and also had a different chunk name hash)
- For Turbopack, react-loadable manifests are now scoped per page instead of globally
2024-12-19 12:34:25 +01:00
Sebastian "Sebbie" Silbermann 1cb6faaee1 Extend support of Pages router to React 18 (#70219) 2024-09-25 19:08:13 +02:00
Tim Neutkens 69f07b680c Revert "Support React 18 in Pages Router" (#69911)
Reverts vercel/next.js#69484
2024-09-10 10:20:27 +02:00
Sebastian "Sebbie" Silbermann 0f2845d2d8 Support React 18 in Pages Router (#69484)
Pages router (`/pages`) will continue to support React 18 not the React
19 RC. Current thinking is that we'll add support for React 19 in Pages
Router once 19 is stable.

This does not affect App Router (`/app`) which continues to use the
latest React Canary (i.e. React 19).

https://github.com/vercel/next.js/pull/65058 is required reading to
understand the changes in this PR

---------

Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com>
2024-09-09 15:26:08 -07:00
omahs d1f934f001 Fix typos (#69568)
Fix typos

---------

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2024-09-03 20:41:29 +00:00
Sebastian Silbermann fe8d953e2d Replace hasRedbox() (#67025)
...with `assertHasRedbox` and `assertNoRedbox`.

`hasRedbox()` has a hardcoded timeout of 5s that is only required for
the negative assertion.
Instead, we now have dedicated assertions for the positive
(`assertHasRedbox`) and negative case (`assertNoRedbox`).
The negative assertion still has the hardcoded timeout.
But the positive assertion just retries until we find the Redbox.

This speeds up tests using the positive assertion.
Removing `hasRedbox` also uncovered some unused expressions e.g. `await
hasRedbox(browser)`.
These expressions probably wanted to use `expect(await
hasRedbox(browser)).toBe(true)
2024-06-20 10:37:32 +02:00
Hendrik Liebau 994d8ee2c3 Fix broken BrowserInterface type (#66461) 2024-06-03 12:56:49 +00:00
hrmny 64b718c661 chore: update prettier to 3.2.5 (#65092) 2024-05-08 21:47:14 +02:00