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

#[turbo_tasks::value(transparent)]: Generate docs & fail on invalid callsites #8087

Merged
merged 2 commits into from
May 8, 2024

Conversation

bgw
Copy link
Member

@bgw bgw commented May 3, 2024

Description

Most #[turbo_tasks::value(transparent)] types leave their inner value as private. I think this okay, but because rustdoc hides private fields by default, it makes it hard to understand at a glance the contained value, without scrolling down to the impl of VcValueType. This PR generates documentation for these.

Screenshot 2024-05-02 at 10 27 47 PM

Also checked that it works if there's an existing doc comment, extending rather than replacing the existing documentation.

Screenshot 2024-05-02 at 10 25 06 PM

Alternative: We could fail if the field is non-pub, and update the callsites. Let me know if this is preferred. The contained fields are basically public anyways, as they can be accessed via Vc's APIs.

While modifying this code, I realized that we don't generate an error if #[turbo_tasks::value(transparent)] would be a no-op. The second commit in this PR adds an error and updates the callsites. This also exposed some issues in the next.js repository, which are fixed in vercel/next.js#65336 .

Testing Instructions

Closes PACK-3038

Most `#[turbo_tasks::value(transparent)]` types leave their inner value
as private. I think this okay, but because rustdoc hides private fields
by default, it makes it hard to understand at a glance the contained
value, without scrolling down to the `impl` of `VcValueType`.

This auto-generates documentation for these types.
Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-nonmonorepo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 9:24pm
rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 3, 2024 9:24pm
8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 9:24pm
examples-designsystem-docs ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 9:24pm
examples-gatsby-web ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 9:24pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 9:24pm
examples-native-web ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 9:24pm
examples-svelte-web ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 9:24pm
examples-tailwind-web ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 9:24pm
examples-vite-web ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 9:24pm

Copy link
Member Author

bgw commented May 3, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @bgw and the rest of your teammates on Graphite Graphite

@bgw bgw changed the title Generate docs for the field contained in a transparent value Generate docs for the field contained in a transparent value & fail on May 3, 2024
@bgw bgw changed the title Generate docs for the field contained in a transparent value & fail on Generate docs for the field contained in a transparent value & fail on invalid callsites May 3, 2024
@bgw bgw changed the title Generate docs for the field contained in a transparent value & fail on invalid callsites #[turbo_tasks::value(transparent)]: Generate docs & fail on invalid callsites May 3, 2024
Copy link
Contributor

github-actions bot commented May 3, 2024

🟢 Turbopack Benchmark CI successful 🟢

Thanks

Copy link
Contributor

github-actions bot commented May 3, 2024

✅ This change can build next-swc

Copy link
Contributor

github-actions bot commented May 3, 2024

⚠️ CI failed ⚠️

The following steps have failed in CI:

  • Turbopack Rust tests (mac/win, non-blocking)

See workflow summary for details

@bgw bgw requested review from kwonoj and sokra May 3, 2024 21:10
@bgw bgw marked this pull request as ready for review May 3, 2024 21:10
@bgw bgw requested a review from a team as a code owner May 3, 2024 21:10
@sokra
Copy link
Member

sokra commented May 8, 2024

While modifying this code, I realized that we don't generate an error if #[turbo_tasks::value(transparent)] would be a no-op. The second commit in this PR adds an error and updates the callsites. This also exposed some issues in the next.js repository, which are fixed in vercel/next.js#65337 .

Yeah, I noticed that too. Good that you fixed that.

@bgw bgw merged commit 3c64d6d into main May 8, 2024
48 of 50 checks passed
@bgw bgw deleted the bgw/value-macro-transparent branch May 8, 2024 19:30
Neosoulink pushed a commit to Neosoulink/turbo that referenced this pull request Jun 14, 2024
…allsites (vercel#8087)

### Description

Most `#[turbo_tasks::value(transparent)]` types leave their inner value as private. I think this okay, but because rustdoc hides private fields by default, it makes it hard to understand at a glance the contained value, without scrolling down to the `impl` of `VcValueType`. This PR generates documentation for these.

![Screenshot 2024-05-02 at 10 27 47 PM](https://github.com/vercel/turbo/assets/180404/c3929d1f-7d96-4908-a91a-83b32c8b380a)

<details>
<summary>Also checked that it works if there's an existing doc comment, extending rather than replacing the existing documentation.</summary>

![Screenshot 2024-05-02 at 10 25 06 PM](https://github.com/vercel/turbo/assets/180404/0614d96b-f715-4eb2-b555-0fea18d14474)
</details>

**Alternative:** We could fail if the field is non-`pub`, and update the callsites. Let me know if this is preferred. The contained fields are *basically* public anyways, as they can be accessed via `Vc`'s APIs.

While modifying this code, I realized that we don't generate an error if `#[turbo_tasks::value(transparent)]` would be a no-op. The second commit in this PR adds an error and updates the callsites. This also exposed some issues in the next.js repository, which are fixed in vercel/next.js#65337 .

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->


Closes PACK-3038
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
…allsites (vercel/turborepo#8087)

### Description

Most `#[turbo_tasks::value(transparent)]` types leave their inner value as private. I think this okay, but because rustdoc hides private fields by default, it makes it hard to understand at a glance the contained value, without scrolling down to the `impl` of `VcValueType`. This PR generates documentation for these.

![Screenshot 2024-05-02 at 10 27 47 PM](https://github.com/vercel/turbo/assets/180404/c3929d1f-7d96-4908-a91a-83b32c8b380a)

<details>
<summary>Also checked that it works if there's an existing doc comment, extending rather than replacing the existing documentation.</summary>

![Screenshot 2024-05-02 at 10 25 06 PM](https://github.com/vercel/turbo/assets/180404/0614d96b-f715-4eb2-b555-0fea18d14474)
</details>

**Alternative:** We could fail if the field is non-`pub`, and update the callsites. Let me know if this is preferred. The contained fields are *basically* public anyways, as they can be accessed via `Vc`'s APIs.

While modifying this code, I realized that we don't generate an error if `#[turbo_tasks::value(transparent)]` would be a no-op. The second commit in this PR adds an error and updates the callsites. This also exposed some issues in the next.js repository, which are fixed in #65337 .

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->


Closes PACK-3038
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…allsites (vercel/turborepo#8087)

### Description

Most `#[turbo_tasks::value(transparent)]` types leave their inner value as private. I think this okay, but because rustdoc hides private fields by default, it makes it hard to understand at a glance the contained value, without scrolling down to the `impl` of `VcValueType`. This PR generates documentation for these.

![Screenshot 2024-05-02 at 10 27 47 PM](https://github.com/vercel/turbo/assets/180404/c3929d1f-7d96-4908-a91a-83b32c8b380a)

<details>
<summary>Also checked that it works if there's an existing doc comment, extending rather than replacing the existing documentation.</summary>

![Screenshot 2024-05-02 at 10 25 06 PM](https://github.com/vercel/turbo/assets/180404/0614d96b-f715-4eb2-b555-0fea18d14474)
</details>

**Alternative:** We could fail if the field is non-`pub`, and update the callsites. Let me know if this is preferred. The contained fields are *basically* public anyways, as they can be accessed via `Vc`'s APIs.

While modifying this code, I realized that we don't generate an error if `#[turbo_tasks::value(transparent)]` would be a no-op. The second commit in this PR adds an error and updates the callsites. This also exposed some issues in the next.js repository, which are fixed in #65337 .

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->


Closes PACK-3038
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
…allsites (vercel/turborepo#8087)

### Description

Most `#[turbo_tasks::value(transparent)]` types leave their inner value as private. I think this okay, but because rustdoc hides private fields by default, it makes it hard to understand at a glance the contained value, without scrolling down to the `impl` of `VcValueType`. This PR generates documentation for these.

![Screenshot 2024-05-02 at 10 27 47 PM](https://github.com/vercel/turbo/assets/180404/c3929d1f-7d96-4908-a91a-83b32c8b380a)

<details>
<summary>Also checked that it works if there's an existing doc comment, extending rather than replacing the existing documentation.</summary>

![Screenshot 2024-05-02 at 10 25 06 PM](https://github.com/vercel/turbo/assets/180404/0614d96b-f715-4eb2-b555-0fea18d14474)
</details>

**Alternative:** We could fail if the field is non-`pub`, and update the callsites. Let me know if this is preferred. The contained fields are *basically* public anyways, as they can be accessed via `Vc`'s APIs.

While modifying this code, I realized that we don't generate an error if `#[turbo_tasks::value(transparent)]` would be a no-op. The second commit in this PR adds an error and updates the callsites. This also exposed some issues in the next.js repository, which are fixed in #65337 .

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->


Closes PACK-3038
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
…allsites (vercel/turborepo#8087)

### Description

Most `#[turbo_tasks::value(transparent)]` types leave their inner value as private. I think this okay, but because rustdoc hides private fields by default, it makes it hard to understand at a glance the contained value, without scrolling down to the `impl` of `VcValueType`. This PR generates documentation for these.

![Screenshot 2024-05-02 at 10 27 47 PM](https://github.com/vercel/turbo/assets/180404/c3929d1f-7d96-4908-a91a-83b32c8b380a)

<details>
<summary>Also checked that it works if there's an existing doc comment, extending rather than replacing the existing documentation.</summary>

![Screenshot 2024-05-02 at 10 25 06 PM](https://github.com/vercel/turbo/assets/180404/0614d96b-f715-4eb2-b555-0fea18d14474)
</details>

**Alternative:** We could fail if the field is non-`pub`, and update the callsites. Let me know if this is preferred. The contained fields are *basically* public anyways, as they can be accessed via `Vc`'s APIs.

While modifying this code, I realized that we don't generate an error if `#[turbo_tasks::value(transparent)]` would be a no-op. The second commit in this PR adds an error and updates the callsites. This also exposed some issues in the next.js repository, which are fixed in #65337 .

### Testing Instructions

<!--
  Give a quick description of steps to test your changes.
-->


Closes PACK-3038
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.

2 participants