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

distinguish between MediaStreamTrack clone, and rust Clone::clone #4182

Open
deep-gaurav opened this issue Oct 11, 2024 · 3 comments
Open

distinguish between MediaStreamTrack clone, and rust Clone::clone #4182

deep-gaurav opened this issue Oct 11, 2024 · 3 comments
Labels
breaking-change Tracking breaking changes for the next major version bump (if ever) enhancement

Comments

@deep-gaurav
Copy link

Motivation

So I was working with WebRTC Media Stream Track and was cloning with with .clone() thinking it'll do shallow clone just like how all other web-sys api does shallow clone, but MediaStreamTrack has a clone method in js too that does deep clone which is what is invoked here. It becomes very hard to debug unless you know this. maybe we can mark it somehow?

Proposed Solution

Not exactly sure what can be done but maybe rename deep clone?

Alternatives

We can also just do some linting for it?

Additional Context

NA

@daxpedda
Copy link
Collaborator

This could be easily added to the list of Rust keywords, but unfortunately it requires much more plumbing to generate duplicate methods to avoid a breaking change.

I'm happy to look over a PR, which can also deprecate the old methods.

@daxpedda daxpedda added the breaking-change Tracking breaking changes for the next major version bump (if ever) label Oct 12, 2024
@deep-gaurav
Copy link
Author

Unfortunately I dont think I've enough knowledge of how web-sys/wasm_bindgen works internally to make PR. If you can point me somewhere to getstarted on learning it, I would be willing to look into it.

@daxpedda
Copy link
Collaborator

If you can point me somewhere to getstarted on learning it, I would be willing to look into it.

I don't think we have any documentation on the internal code architecture that would help with this.
To get started you would just have to dig into the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Tracking breaking changes for the next major version bump (if ever) enhancement
Projects
None yet
Development

No branches or pull requests

2 participants