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

document canvas field on window in wasm #4683

Closed
wants to merge 1 commit into from

Conversation

mockersf
Copy link
Member

@mockersf mockersf commented May 6, 2022

Objective

  • It's very hard to discover the canvas field to use an existing canvas in wasm. Improve it

Solution

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label May 6, 2022
@mockersf mockersf added C-Docs An addition or correction to our documentation O-Web Specific to web (WASM) builds and removed S-Needs-Triage This issue needs to be labelled labels May 6, 2022
@@ -625,7 +625,8 @@ pub struct WindowDescriptor {
/// macOS X transparent works with winit out of the box, so this issue might be related to: <https://github.com/gfx-rs/wgpu/issues/687>
/// Windows 11 is related to <https://github.com/rust-windowing/winit/issues/2082>
pub transparent: bool,
#[cfg(target_arch = "wasm32")]
/// This field is only available in wasm. Can take a CSS selector to an HTML canvas
#[cfg(any(target_arch = "wasm32", doc))]
Copy link
Contributor

@bjorn3 bjorn3 May 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use #[doc(cfg(target_arch = "wasm32"))] too? That shows the cfg as part of the documentation. I'm not sure if it is stable already, but if not you could gate it to docs.rs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mockersf
Copy link
Member Author

closed in favour of #4726 which remove the wasm32 limit on the field

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Docs An addition or correction to our documentation O-Web Specific to web (WASM) builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants