Skip to content

ping webhook #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 98 commits into from
Closed

ping webhook #35

wants to merge 98 commits into from

Conversation

xusd320
Copy link

@xusd320 xusd320 commented Jul 15, 2025

No description provided.

eps1lon and others added 30 commits July 9, 2025 15:11
…cache'` (vercel#81431)

When passing server actions or nested `'use cache'` functions inside of
cached components as props to client components, we need to make sure
that those are registered as server references, even when restoring the
parent component from the cache, e.g. during the resume of a partially
static shell. Otherwise, React would throw a runtime error while trying
to serialize the props.

<details>
<summary>Example</summary>

```tsx
import { connection } from 'next/server'
import { Suspense } from 'react'

export default function Page() {
  return (
    <div>
      <Suspense fallback={<h1>Loading...</h1>}>
        <Dynamic />
      </Suspense>
      <CachedForm />
    </div>
  )
}

const Dynamic = async () => {
  await connection()
  return <h1>Dynamic</h1>
}

async function CachedForm() {
  'use cache'

  return (
    <form
      action={async () => {
        'use server'
        console.log('Hello, World!')
      }}
    >
      <button>Submit</button>
    </form>
  )
}
```
</details>

Previously, for inline server functions, the Next.js compiler placed the
`registerServerReference` calls where the server function was originally
declared. When the enclosing function was restored from a cache, this
call was skipped and the reference was not registered, leading to the
serialization error. To fix it, we can hoist the
`registerServerReference` call into the module scope, where the
reference itself also has been hoisted to. For simplicity, we're doing
this now generally, regardless of whether the server function is inline
or top-level.

Note: Since `registerServerReference` uses `Object.defineProperties` to
mutate the given reference, we don't need to assign the result to
anything. We already did this for exported functions of a module with a
top-level `'use server'` directive.

closes NAR-167
Don't attatch the resolve request's affecting sources to the external module itself. This list wasn't part of the module ident and would lead to duplicate modules.
…ercel#81422)

We had this reference which caused all locals to be used:
```
node_modules/@react-spring/core/dist/react-spring-core.esm.js [app-client] (ecmascript) <module evaluation>
->
node_modules/@react-spring/core/dist/react-spring-core.esm.js [app-client] (ecmascript) <locals>
with
export_usage=all
```

So for
```js
import {config, useSpring} from "@react-spring/core";
```
the output was
```js
"[project]/node_modules/.pnpm/@react-spring[email protected][email protected]/node_modules/@react-spring/core/dist/react-spring-core.esm.js [app-client] (ecmascript) <locals>": ((__turbopack_context__) => {
__turbopack_context__.s({
    "BailSignal": ()=>BailSignal,
    "Controller": ()=>Controller,
    "FrameValue": ()=>FrameValue,
    "Interpolation": ()=>Interpolation,
    "Spring": ()=>Spring,
    "SpringContext": ()=>SpringContext,
    "SpringRef": ()=>SpringRef,
    "SpringValue": ()=>SpringValue,
    "Trail": ()=>Trail,
    "Transition": ()=>Transition,
    "config": ()=>config,
    "easings": ()=>easings,
    "inferTo": ()=>inferTo,
    "interpolate": ()=>interpolate,
    "to": ()=>to,
    "update": ()=>update,
    "useChain": ()=>useChain,
    "useSpring": ()=>useSpring,
    "useSpringRef": ()=>useSpringRef,
    "useSprings": ()=>useSprings,
    "useTrail": ()=>useTrail,
    "useTransition": ()=>useTransition
});
```
instead of only listing the used exports
```js
"[project]/node_modules/.pnpm/@react-spring[email protected][email protected]/node_modules/@react-spring/core/dist/react-spring-core.esm.js [app-client] (ecmascript) <locals>": ((__turbopack_context__) => {
"use strict";

__turbopack_context__.s({
    "config": ()=>config,
    "useSpring": ()=>useSpring
});
```
Avoid the `let _ = task().resolve().await?` pattern.
Instead use the `task().as_side_effect().await?` pattern.

This is much better, because the compiler will yell at you if you miss
out the `as_side_effect()` or the `await?` due to `must_use`. In the old
pattern forgetting the `.resolve()` or the `await?` did not trigger any
warning but silently ignored errors.

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

-->
…el#81451)

Previously, we had separate fixtures for each test case because it's
complicated to assert on build errors when multiple pages have errors.
This meant that running those tests, and especially updating their
snapshots, took forever because each test case needed to be installed
and built separately.

We can consolidate the cases into a single fixture (and test suite) by
leveraging the internal `NEXT_PRIVATE_APP_PATHS` environment variable to
prerender individual pages, along with `--experimental-build-mode
generate`. The compilation is done upfront for all tests using
`--experimental-build-mode compile`. Dev mode also profits, by sharing a
single dev server instance across all tests.

For convenient updating of the snapshots for all modes and bundlers,
we're also adding a small script at
`test/e2e/app-dir/dynamic-io-errors/update-snapshots.sh`.

closes NAR-183
…sts (vercel#81465)

When opting into caching a POST request with the `revalidate` option, or
when the Server Components HMR Cache implicitly caches a POST request,
the body of the request is now correctly handled if it is a
`Uint8Array`. Previously, we logged `Failed to generate cache key for
...` and the cache was bypassed.

closes NAR-180
fix: Input image name and output image name is different and causes
confusion.

---------

Co-authored-by: Joseph <[email protected]>
### What?

Reduce allocation size a little bit.
This package needs to be externalized to have it's wasm dependencies
traced properly for node runtime so this adds it to the default list.
This auto-generated PR updates the production integration test manifest used when testing Rspack.
This auto-generated PR updates the development integration test manifest used when testing Rspack.
…analyzer report (vercel#81372)

### Issue

When `analyzerMode` is selected as `json`, the bundle analyzer still
emits a `.html` file.

### Fix

Added a check for `analyzerMode` === `json` to determine file extension.

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
…ies, fix non-nextest execution testing (vercel#81479)

This PR fixes two bugs I ran into while trying to add a test case.

## Empty Snapshot Tests With No Input

Git tracks files, not directories, so it doesn't track or delete empty directories. This can lead to broken behavior in our test cases:

1. Somebody deletes a test case, git no longer has any files in that directory to track. They push this to canary.
2. Somebody else runs `git pull` and git deletes the files, but leaves behind a directory structure.
3. Later, they run the snapshot tests with `UPDATE=1`. The snapshot test script sees the directory and tries running the test.
4. There's no input files, so it just tries to do a compilation with no files, which of course fails, but generates some output of the failure.
5. We accumulate these broken tests with an output directory but no input directory.

## Tracing Subscriber Init in Execution Tests

- You can only call tracing-subscriber's `init()` once per-process as it sets global state.
- We need each tracing-subscriber to be configured with a different output directory.
- `cargo test` runs multiple tests in parallel inside the same process.

Therefore, our use of `tracing-subscriber` is unfortunately incompatible with `cargo test`.

In contrast, `cargo nextest` runs every test case in an isolated process.

The use of `tracing-subscriber` here is just as a debugging tool (we don't commit these traces), so only enable it when we're running under `cargo nextest`.

I tested running the execution tests with both `cargo test` and `cargo nextest` and observed the trace file was written out only when using `nextest`.
…ion construction lazier (vercel#81434)

This is an alternate attempt at solving vercel#81424 without macros.

The extra laziness desired can be accomplished with an outer wrapping
`FnOnce`. It's a bit confusing, but I think it causes less problems than
a macro does?

Checked compilation and lints with:

```
cargo clippy --all-targets
cargo clippy --all-targets --features turbo-tasks/hanging_detection
```

// TODO: Find somewhere else to insert a closure so that we can have a
factory factory factory!
### What?

* Improve fuzz testing to test tasks becoming active and inactive.
* Improve the verify_aggregation_graph feature to panic to allow running
it during fuzz testing
…cel#81457)

### What?

More granular invalidation to improve incremental builds with Skew Protections (modifies chunking context as it includes `chunk_suffix_path`).
Use `chunking_context.minify_type().await?` just as JS does
Fixing a couple of code snippets annoyances
This ensures that `fetch` is shown in stack traces (in collapsed
ignore-listed frames), instead of `patched`.
eps1lon and others added 29 commits July 14, 2025 11:54
### What?

Fix a hanging compilation in a specific case when reexports modules in a cycle.

Fix reported issues for tree shaken modules
Format line format: `<segment> [<files,>]`

This will help visualize the rendered segment explorer panel easier by checking the snapshot. e.g.

```
app/ [layout.tsx]
parallel-routes/ [layout.tsx, page.tsx]
@bar/ [layout.tsx, page.tsx]
@foo/ [layout.tsx, page.tsx]
```
Updates the docs to include the new options in 15.4. 

- `prefetch="auto"` option: vercel#78689
- `next build` new `--debug-prerender option`:
vercel#80667

---------

Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
This PR fixed two typos that affected isHeadPartial logic.
…cel#81635)

Previously this was only parsing the first line of input

```
cargo run -p swc-ast-explorer <turbopack/crates/turbopack-tests/tests/snapshot/comptime/assignment/input/index.js | less
```
)

It should be equivalent, but it's clearer that the LHS is always visited
…erse_edges_from_entries_dfs` (vercel#81481)

## Rename `traverse_edges_from_entries_topological` to `traverse_edges_from_entries_dfs`

This PR renames the `traverse_edges_from_entries_topological` method to `traverse_edges_from_entries_dfs` to better reflect its actual behavior. The method performs a depth-first search traversal rather than a topological sort.

The PR also:
- Updates the method documentation to clarify that it performs a DFS traversal
- Makes `ClientReferenceMapType` derive `Copy` for better ergonomics
- Removes unnecessary `ResolvedVc::upcast` call in client references mapping
- Renames some variables for clarity (`actions` → `client_references`)
- Removes unused `module_graph_for_entries` function
- Adds some tests for the traversal routine.  Not very interesting for this traversal but should make it easier to test future traversals.

These changes improve code clarity and correctness by ensuring the method name accurately describes its behavior.
…cel#81577)

This allows us to introduce more work unit store types with confidence.

closes NAR-203
This auto-generated PR updates the development integration test manifest used when testing Rspack.
…sult (vercel#81627)

Historically anything dynamic in a prerender would result in a partially
static shell that resumes at runtime. With this change, now partial
shells are only possible when RSC is dynamic. If your client prerender
has any IO but your RSC tree was entirely prerenderable then Next.js
will produce a complete static result and not perform a resume at
runtime. This simplifies how you reason about what will and wil not make
a static page. It also means that anything dynamic in the client layer
will only render in browser.

---------

Co-authored-by: Hendrik Liebau <[email protected]>
dynamicIO does not rely on Postponing for any prerender reason. This is
an experimental only API with no clear path to stailization. To make
dynamicIO supportable with stable React we should eliminate use of this
API.

This change replaces the postpone value when aborting the resume of a
prerender we want to complete even when it had a postponed state with
the already existing BailoutToCSRError error subclass.

We already have plumbing in place to ignore this error on the client
when hydrating which is exactly what we want to achieve here.
This PR updates the devtool overlay to use a new detachable panel based
system for rendering content. Each panel can be configured to:
- drag
- resize
- close on click outside
- have min/max sizes if resizable, size if fixed


https://github.com/user-attachments/assets/982ecee3-5ef0-424e-8fcc-4c54dfadcb25
* feat(turbopack): apply utoo patches to canary

* chore: update external code

---------

Co-authored-by: zoomdong <[email protected]>
…mpile time define env (#28)

* feat(turbopack): support more types of compile time define env

* fix: should use Syntax::Es for evaluate define env parsing
* feat(turbopack): externalType support umd

* fix: clippy

* fix: use CompileTimeDefineValue::Evaluate

---------

Co-authored-by: xusd320 <[email protected]>
Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com>
@xusd320 xusd320 closed this Jul 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.