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

Drop serde_json #1

Open
bheisler opened this issue Jan 19, 2019 · 2 comments · May be fixed by #24
Open

Drop serde_json #1

bheisler opened this issue Jan 19, 2019 · 2 comments · May be fixed by #24
Labels
Enhancement New feature or request Help Wanted Input and ideas requested. Intermediate Interemediate difficulty.

Comments

@bheisler
Copy link
Owner

bheisler commented Jan 19, 2019

TinyTemplate converts the context structure to serde_json::Value internally so that it can look up values by string keys. This introduces a dependency on serde_json even though we don't really do any JSON serialization. If TinyTemplate had its own version of Value which could be constructed by a custom serde serializer, we could drop serde_json and only depend on serde.

This is not a high priority for Criterion.rs (which depends on serde_json anyway). I would be happy to accept a pull request though.

@bheisler bheisler added Enhancement New feature or request Intermediate Interemediate difficulty. Help Wanted Input and ideas requested. labels Jan 19, 2019
@Legend-of-iPhoenix
Copy link

Here's my solution for this from a similar project- you're welcome to use it of course: https://github.com/Legend-of-iPhoenix/microtemplate/blob/1dff2cc818ed144ef74f3062ecea7bf7d4c7bb8d/microtemplate_derive/src/lib.rs

@bheisler
Copy link
Owner Author

bheisler commented Jul 17, 2021

Hello! I think the benefits of that approach would be minimal, honestly. The main goal for this ticket is to reduce clean-compile time and code bloat. This would require a new proc-macro and all of the associated machinery so the dependency tree isn't that much smaller (and the macro itself is less likely to already be in the user's dependency tree than serde-derive), and it adds a new derive that users need to apply and a new data model (which would be an API-breaking change in a couple of ways). Thanks for your interest, but I don't think I want to move forward with that approach.

npmccallum added a commit to npmccallum/TinyTemplate that referenced this issue Aug 12, 2021
This implements an internal `Value` type which functions like
`serde_json::Value`.

Resolves: bheisler#1

Signed-off-by: Nathaniel McCallum <[email protected]>
npmccallum added a commit to npmccallum/TinyTemplate that referenced this issue Aug 12, 2021
This implements an internal `Value` type which functions like
`serde_json::Value`. Note that because this commit changes the `Error`
type, this is an API-breaking change.

Resolves: bheisler#1

Signed-off-by: Nathaniel McCallum <[email protected]>
@npmccallum npmccallum linked a pull request Aug 12, 2021 that will close this issue
npmccallum added a commit to npmccallum/TinyTemplate that referenced this issue Aug 12, 2021
This implements an internal `Value` type which functions like
`serde_json::Value`. Note that because this commit changes the `Error`
type, this is an API-breaking change.

Resolves: bheisler#1

Signed-off-by: Nathaniel McCallum <[email protected]>
npmccallum added a commit to npmccallum/TinyTemplate that referenced this issue Aug 12, 2021
This implements an internal `Value` type which functions like
`serde_json::Value`. Note that because this commit changes the `Error`
type, this is an API-breaking change.

Resolves: bheisler#1

Signed-off-by: Nathaniel McCallum <[email protected]>
npmccallum added a commit to npmccallum/TinyTemplate that referenced this issue Aug 12, 2021
This implements an internal `Value` type which functions like
`serde_json::Value`. Note that because this commit changes the `Error`
type, this is an API-breaking change.

Resolves: bheisler#1

Signed-off-by: Nathaniel McCallum <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request Help Wanted Input and ideas requested. Intermediate Interemediate difficulty.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants