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

Remove mandatory serde dependency #539

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Remove mandatory serde dependency #539

wants to merge 17 commits into from

Conversation

mitsuhiko
Copy link
Owner

@mitsuhiko mitsuhiko commented Jul 18, 2024

This PR makes serde optional in MiniJinja. The way to use this is to disable default features which also turns off serde. Unfortunately this is not semver compatible as it means that anyone currently using MiniJinja without serde will experience breakage.

Additionally it changes the behavior of context! to take things by value. The benefit of this is that the macro can now support both Into<Value> and Serialize as conversions.

This will have to go into a new major version.

Fixes #528

@mitsuhiko
Copy link
Owner Author

Another option entirely is to no longer use serde in public interfaces at all and force people to use Value::from_serialize explicitly. Then context! and other functions could use Into<Value> instead. I'm not convinced that this is an amazing idea but it would make the interface potentially simpler. That however would definitely require a major.

@mitsuhiko mitsuhiko changed the title Add an optional mode without serde Remove mandatory serde dependency Jul 21, 2024
@hanna-kruppe
Copy link

FYI just in case you weren't aware and it affects the decision when/how to do this: the warning added in #541 only shows up when using minijinja as a path dependency. Cargo uses rustc ... --cap-lints=allow to silence lints in dependencies (except rustc future-compat warning) when building crates from registries and even from git repositories. So it's very unlikely that the users who need to see it have ever seen it.

@dtolnay
Copy link

dtolnay commented Nov 30, 2024

You can use https://docs.rs/build-alert for warnings that show up inside ordinary crates.io dependencies.

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.

Drop Serde Dependency
3 participants