Skip to content

Add support for serde 0.9 #273

Closed
Closed

Description

@mhristache

Serde 0.9 was just released and has some nice new features.

Missing support in the rust-url stops me from upgrading. Is there any work ongoing to add support for it?

Thanks

Activity

  1. SimonSapin commented on Jan 25, 2017

    @SimonSapin
    Member

    I’m not sure what’s the best way to approach this. Serde support is part of the public API exposed by the url crate, so I think that upgrading to 0.9 is a breaking change. That means it’ll have to be in url version 2.0.0, which would be disruptive as upgrades will need to be coordinated through Servo’s dependency graph.

  2. mhristache commented on Jan 25, 2017

    @mhristache
    ContributorAuthor

    I have the implementation ready. Should I update the version to 2.0.0?

  3. SimonSapin commented on Jan 25, 2017

    @SimonSapin
    Member

    @nox mentioned an alternative: having serde support in a separate crate, similar to this one: https://docs.rs/hyper_serde/0.2.0/hyper_serde/

  4. mhristache commented on Jan 25, 2017

    @mhristache
    ContributorAuthor

    Wouldn't it still be a breaking change to remove serde from rust-url? Or you want to have only the new serde versions in the url-serde or whatever will be called and keep old serde versions as optional feature in rust-url?

  5. SimonSapin commented on Jan 25, 2017

    @SimonSapin
    Member

    I don’t know, both are options.

  6. mhristache commented on Jan 26, 2017

    @mhristache
    ContributorAuthor

    Let me know how you want to have it and I am happy to do the implementation.

  7. SimonSapin commented on Jan 26, 2017

    @SimonSapin
    Member

    Alright. In that case, please send a PR to this repository that adds a new url_serde crate (in a sub-directory) that does something similar to https://github.com/nox/hyper_serde/blob/master/src/lib.rs (but with serde 0.9). Look at https://github.com/servo/rust-url/blob/bb1100baf0/src/lib.rs#L1735-L1756 for the body of the impls, in particular to deal with errors from Url::parse.

    This should allow you to use rust-url and serde 0.9 together, though admittedly in a way that’s not as convenient as if this support had been directly in the url crate. You’ll also end up with two versions of serde in your Cargo.lock file, but only one of them will be built as long as the serde feature of the url crate is not enabled.

    When the time comes to make other breaking changes to the url crate and publish version 2.0.0, we’ll also remove support for serde 0.8.

  8. added a commit that references this issue on Jan 28, 2017
  9. SimonSapin commented on Jan 28, 2017

    @SimonSapin
    Member

    Fixed in #274.

  10. added a commit that references this issue on Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions