Skip to content
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

Fix wildcard typo in scopes docs #193

Merged

Conversation

KarelVerschraegen
Copy link
Contributor

@KarelVerschraegen KarelVerschraegen commented Dec 11, 2021

According to Wikipedia, Microsoft and NextJS, wildcard is the correct writing.

(Sorry for all the typo PR's 🙈 )

@vercel
Copy link

vercel bot commented Dec 11, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/vercel/turbo-site/yosw6YXhvXGt5wAG1XoSTts48tT1
✅ Preview: https://turbo-site-git-fork-karelverschraegen-fix-wild-card-wild-5e35e9.vercel.sh

@jaredpalmer jaredpalmer merged commit 6f183ff into vercel:main Dec 11, 2021
@KarelVerschraegen KarelVerschraegen deleted the fix-wild-card-wildcard-typo branch December 11, 2021 18:16
sokra pushed a commit that referenced this pull request Oct 25, 2022
This PR builds our own `Debug`-like derive-macro machinery for formatting structs, relying on `std::fmt::Formatter` for the actual formatting.

### Usage

A new `ValueDebug` trait is automatically implemented for all `#[turbo_tasks::value]`s, which has a single `.dbg()` method which resolves to a debug representation that can then be printed to the screen. `#[turbo_tasks::value_trait]` also implement the `.dbg()` method directly.

```rust
dbg!(any_vc.dbg().await?);
```

If you have a `#[turbo_tasks::value]` struct with a field that doesn't implement `Debug`, you'll want to declare that field as `#[debug_ignore]`. For instance:

```rust
#[turbo_tasks::value(ContentSource, serialization: none, eq: manual, cell: new, into: new)]
pub struct TurboTasksSource {
    #[debug_ignore]
    #[trace_ignore]
    pub turbo_tasks: Arc<TurboTasks<MemoryBackend>>,
}
```

### Why not use `Debug` directly?

We can't use `Debug` because our values are resolved asynchronously and can nest `Vc`s arbitrarily. I tried using `futures::executor::block_on` to resolve them synchronously in a `Debug` implementation but that causes deadlocks.
jridgewell pushed a commit to vercel/next.js that referenced this pull request Mar 10, 2023
This PR builds our own `Debug`-like derive-macro machinery for formatting structs, relying on `std::fmt::Formatter` for the actual formatting.

### Usage

A new `ValueDebug` trait is automatically implemented for all `#[turbo_tasks::value]`s, which has a single `.dbg()` method which resolves to a debug representation that can then be printed to the screen. `#[turbo_tasks::value_trait]` also implement the `.dbg()` method directly.

```rust
dbg!(any_vc.dbg().await?);
```

If you have a `#[turbo_tasks::value]` struct with a field that doesn't implement `Debug`, you'll want to declare that field as `#[debug_ignore]`. For instance:

```rust
#[turbo_tasks::value(ContentSource, serialization: none, eq: manual, cell: new, into: new)]
pub struct TurboTasksSource {
    #[debug_ignore]
    #[trace_ignore]
    pub turbo_tasks: Arc<TurboTasks<MemoryBackend>>,
}
```

### Why not use `Debug` directly?

We can't use `Debug` because our values are resolved asynchronously and can nest `Vc`s arbitrarily. I tried using `futures::executor::block_on` to resolve them synchronously in a `Debug` implementation but that causes deadlocks.
sokra pushed a commit to vercel/next.js that referenced this pull request Mar 13, 2023
This PR builds our own `Debug`-like derive-macro machinery for formatting structs, relying on `std::fmt::Formatter` for the actual formatting.

### Usage

A new `ValueDebug` trait is automatically implemented for all `#[turbo_tasks::value]`s, which has a single `.dbg()` method which resolves to a debug representation that can then be printed to the screen. `#[turbo_tasks::value_trait]` also implement the `.dbg()` method directly.

```rust
dbg!(any_vc.dbg().await?);
```

If you have a `#[turbo_tasks::value]` struct with a field that doesn't implement `Debug`, you'll want to declare that field as `#[debug_ignore]`. For instance:

```rust
#[turbo_tasks::value(ContentSource, serialization: none, eq: manual, cell: new, into: new)]
pub struct TurboTasksSource {
    #[debug_ignore]
    #[trace_ignore]
    pub turbo_tasks: Arc<TurboTasks<MemoryBackend>>,
}
```

### Why not use `Debug` directly?

We can't use `Debug` because our values are resolved asynchronously and can nest `Vc`s arbitrarily. I tried using `futures::executor::block_on` to resolve them synchronously in a `Debug` implementation but that causes deadlocks.
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.

None yet

2 participants