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

[improvement] Allow overriding default serializer used in to_value #60

Closed
JorritSalverda opened this issue Dec 18, 2023 · 1 comment
Closed

Comments

@JorritSalverda
Copy link

Cloudflare's Queue and Key Value implementations rely on this crate. But they both use the default serializer because of their usage of to_value:

It would be nice if the Serializer::new() used in https://github.com/RReverser/serde-wasm-bindgen/blob/main/src/lib.rs#L77-L80 could return an overridable serializer. This can be done using a mutable static.

@RReverser
Copy link
Owner

It's not a good idea to change global state in ways that will affect all 3rd-party code in non-obvious and, likely, breaking ways.

If you want those libraries to use a different or configurable serializer, it's better to add that to libraries themselves.

@RReverser RReverser closed this as not planned Won't fix, can't repro, duplicate, stale Dec 28, 2023
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

No branches or pull requests

2 participants