Skip to content

[pull] canary from vercel:canary#787

Merged
pull[bot] merged 3 commits intocode:canaryfrom
vercel:canary
Feb 13, 2026
Merged

[pull] canary from vercel:canary#787
pull[bot] merged 3 commits intocode:canaryfrom
vercel:canary

Conversation

@pull
Copy link

@pull pull bot commented Feb 13, 2026

See Commits and Changes for more details.


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

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

mmastrac and others added 3 commits February 12, 2026 19:12
…#89788)

## What

Add a `#[derive(ValueToString)]` proc macro and convert ~45 manual `ValueToString` implementations across turbopack crates to use it (-660 lines of boilerplate, 49 files touched).

## Why

Nearly every `ValueToString` impl follows the same pattern: format some fields into a string, possibly awaiting `Vc` values first. These hand-written impls are noisy boilerplate that obscure the actual format string.

## How

The derive macro generates the `#[turbo_tasks::value_impl] impl ValueToString` block automatically. A helper trait `ValueToStringify` with a blanket impl for `Display` and specializations for `Vc<T>`/`ResolvedVc<T>` handles async resolution of fields.

### Supported forms

- **No attribute** — delegates to `Display::to_string(&self)`
- `#[value_to_string("constant")]` — emits `rcstr!` directly
- `#[value_to_string("{field} text {other_field}")]` — auto-resolves named/positional fields via `ValueToStringify`
- `#[value_to_string("fmt {}", expr1, expr2)]` — explicit expressions as format args
- `#[value_to_string(expr)]` — single expression delegation

Enums support per-variant attributes (defaulting to variant name) or a single top-level attribute.
This fixes a bug introduced in d77eb04 where
installCompressedModuleFactories would skip installing factories for an
entire group of module IDs if any ID in the group already had a factory
registered.

Test Plan: build
https://github.com/vercel/workflow/tree/main/workbench/nextjs-turbopack
@pull pull bot locked and limited conversation to collaborators Feb 13, 2026
@pull pull bot added the ⤵️ pull label Feb 13, 2026
@pull pull bot merged commit 8b2b0a6 into code:canary Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments