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

Pub use JSON crate #67

Closed
dbrgn opened this issue Mar 7, 2016 · 3 comments
Closed

Pub use JSON crate #67

dbrgn opened this issue Mar 7, 2016 · 3 comments

Comments

@dbrgn
Copy link

dbrgn commented Mar 7, 2016

Could you maybe "pub use" the rustc-serialize / serde JSON library that you're using? Otherwise I have to add serde_json as an explicit dependency to my Cargo.toml which might not be the same version as the one used by handlebars.

@sunng87
Copy link
Owner

sunng87 commented Mar 7, 2016

Thanks @dbrgn ! Is this a best practice/pattern for dealing with multiple version of dependencies? I haven't used this technique in my projects. Is there any drawback for publish these crates? Is it possible to find me an example that I can follow? Thanks!

@dbrgn
Copy link
Author

dbrgn commented Mar 7, 2016

I'm not sure, but I think that's what the "pub use" feature is made for :)

I opened a similar issue in the iron project which was implemented: iron/iron#406

One of the advantages is also that a use handlebars::Json will refer to either rustc-serialize or serde, depending on the compile flags.

@sunng87
Copy link
Owner

sunng87 commented May 4, 2017

Since serde is widely used in user applications, and requires custom derive macro to generate code. I think we cannot do this for handlebars.

@sunng87 sunng87 closed this as completed May 4, 2017
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