Skip to content

[pull] canary from vercel:canary#111

Merged
pull[bot] merged 10 commits into
code:canaryfrom
vercel:canary
May 10, 2025
Merged

[pull] canary from vercel:canary#111
pull[bot] merged 10 commits into
code:canaryfrom
vercel:canary

Conversation

@pull

@pull pull Bot commented May 10, 2025

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

SyMind and others added 10 commits May 9, 2025 14:51
<!-- 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 #

-->

let Rspack to pass the test cases it was previously able to pass.

1. update Rspack to 1.3.9
2. Moves `moduleSpansByCompilation` setting in `RspackProfilingPlugin`
from the `compilation` hook to `thisCompilation`.

`TraceEntryPointsPlugin` relies on `moduleSpansByCompilation` during its
`thisCompilation` hook. Since the `compilation` hook triggers before
`thisCompilation`, initializing the map earlier leads to:

  ```
Error: × TypeError: Cannot read properties of undefined (reading
'traceChild')
  ```
  
  relate: #78011
  
3. The test case
`test/integration/middleware-prefetch/tests/index.test.js` was failing
due to an unreliable asset name matching strategy.
  
Asset names follow the pattern:
`static/chunks/pages/[pagename]-[hash].js`.

Test was checking for `ssg-page-2-[hash].js` by looking for names
starting with `ssg-page-2`.

This could produce false positives when `ssg-page-[hash].js` happens to
have a hash starting with `2`.

4. test dev `test/e2e/app-dir/dynamic-data/dynamic-data.test.ts`

Test fails due to Rspack's lack of support for
compilation.codeGenerationResults JS API.

5.  test dev `test/e2e/app-dir/dynamic-href/dynamic-href.test.ts`

Same compatibility issue as above.

6.  test dev `test/development/acceptance-app/hydration-error.test.ts`

Same compatibility issue as above.

6. test dev `test/development/app-dir/ssr-in-rsc/ssr-in-rsc.test.ts`

Test fails due to differing error message formats between
implementations.
### Feature

Introducing a new convention `global-not-found.js`, which let you build your own 404 page within app router. This convention is similar to `global-error.js` but for not found in general case, it's similar to `not-found.js` but including the layout.

App router has an implicit convention of building the 404 route, which is composing the top-level root `layout.js` and the root `not-found.js` to build up a 404 page. Since it's so implicit so that users don't have much control over it, which also lead to some confusing errors like `/_not-found` route is build failed due to various reason.

The `global-not-found.js` convention is aimed to help users to build 404 route in App Router easily and convenience. Currently it will be bound with a flag `experimental.globalNotFound` and later it will become the stable feature in next major release as it introduces a minor breaking change that we won't use root layout and root not-found to compose the 404 page. Instead, we'll either choose the builtin 404 page or users customized `global-not-found.js` to generate the 404 page when you enable the feature.

#### Advantages

Good new that if you were having struggles with creating 404 page for the multi root layouts app, such as the case below. Then `global-not-found.js` is your choose.

```
- (2024)/
   /layout.js
   /... # routes
- (2025)/
   /layout.js
   /... # routes
```

Closes NDX-1036
Related #59180


#### Follow up

The metadata and deployment will be followed up in new PRs
Looks like we never added this after the turbopack repo migration.
This should automatically add the `Rspack` label in most cases, which should let us run the rspack CI in theses cases.

There's an issue with the current CI config where the build-and-test job isn't triggered by label changes, so I'll need to make some changes there, but this is a start.
### What?

Part of the memory usage reduction task.

### Why?

We don't need to clone the AST.
…e run more-in-parallel (#78891)

Same basic idea as #78787

This test suite has a lot of timeouts with rspack, which causes it to take a long time to run (though not quite long enough that it breaks the job).

In general, large test suites are good to break up, because they benefit from parallelism.
… local font files (#78941)

Previously, we used `anyhow::Result` for this, but this conflicts with
how we use `Error` in Turbo Tasks as system-level exceptions.

Test Plan: `pnpm test-dev-turbo
test/e2e/app-dir/next-font/next-font.test.ts`
@pull pull Bot added the ⤵️ pull label May 10, 2025
@pull pull Bot merged commit 66acc83 into code:canary May 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants