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

Commit
1 year ago
#[turbo_tasks::value(transparent)]: Generate docs & fail on invalid callsites (#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 https://github.com/vercel/next.js/pull/65337 . ### Testing Instructions <!-- Give a quick description of steps to test your changes. --> Closes PACK-3038
Author
bgw bgw
Parents
Loading