Giter Club home page Giter Club logo

serde-rs.github.io's People

Contributors

academiaresf avatar ahl avatar alextmjugador avatar benaubin avatar bryanburgers avatar callum-oakley avatar canop avatar casey avatar creepyskeleton avatar dima74 avatar drojf avatar dtolnay avatar gunvirranu avatar hackaugusto avatar hywan avatar jamesmunns avatar jimmycuadra avatar joliss avatar jonasbb avatar jwilm avatar kvark avatar lachstec avatar mitsuhiko avatar nabijaczleweli avatar oli-obk avatar phlosioneer avatar rotty avatar scvalex avatar spikefoo avatar xtian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

serde-rs.github.io's Issues

Sidebar takes up most of the width on mobile

https://www.reddit.com/r/programming/comments/5jsetj/announcing_rust_114/dbj4gn0/

That show doesn't work very well on mobile; the sidebar takes up most of the screen by default. Perhaps it could be collapsed by default?

I think this is a consequence of the workaround for #28. Maybe a better heuristic should be:

  • If JavaScript is disabled, show sidebar.
  • If screen is narrower than some threshold, hide sidebar.
  • Otherwise show sidebar.

I don't know CSS or JavaScript so let me know if anyone has a better plan.

Set up analytics

I want to know what people are looking at and where they are coming from, just like GitHub gives you for repos.

Implementing custom Serialize

  • for primitives
  • for a seq
  • for a map
  • for different types of structs
    • normal struct
    • tuple struct
    • newtype struct
    • unit struct
  • for an enum

Not all of these need to be individual sections, for example seq and map are very similar. But we definitely need an explanation of the different types of struct along with examples of how various formats treat them distinctly.

Remove unneeded `extern crate serde`

Since rust-lang/rust#42588, Rust warns by default on unused extern crates. The example on the homepage, as well as possibly other examples on the website, has extern crate serde but does not refer to anything from it. It is there as a reminder that the generated code requires serde to be listed as a dependency in Cargo.toml.

I imagine we can make up for it by providing an explicit Cargo.toml snippet instead.

[dependencies]
serde = "1.0"
serde_derive = "1.0"
serde_json = "1.0"

Attributes

Basically ported from the Serde readme. I would also like some more detail about possible applications of each attribute, with links to relevant example code. For example the field attribute rename would mention serializing field names as camelCase and serializing fields with names that are reserved Rust keywords.

CSS media queries

Really helpful advice from @ssokolow on reddit:


I don't have time to work on it, but here's a quick introduction to CSS media queries, which allow you to assign different CSS rules to different viewport sizes.

https://css-tricks.com/css-media-queries/

(Optionally in concert with the CSS page-break properties, media queries also allow you to make your pages print beautifully... for example, by hiding all elements that only exist to be interacted with and replacing colour cues with other formatting.)

They're supported on all browsers with market share visible in caniuse.com's "Usage relative" mode except IE8, which is estimated to have a 0.42% global market share.

Unfortunately, support for interaction media features is not currently present in Firefox, 4.x versions of the default Android browser, or IE, so any rule you write to inflate your buttons in the presence of coarse (touch/kinect/wii) input will only apply on about 2/3rds of the browsers out there (desktop browsers included in that count).

For now, if you want to inflate your buttons for easy touch, I'd consider using interactions queries for iOS/Opera/Chrome devices and then using resolution queries (with the dpi unit for maximum compatibility) anded together with a query for a small screen size (to exclude Retina/HiDPI desktop/laptop screens) as a fallback to catch things like Firefox Mobile on smartphones.

Implementing custom Deserialize

  • for primitives
  • for a seq
  • for a map
  • for different types of structs
    • normal struct
    • tuple struct
    • newtype struct
    • unit struct
  • for an enum

Interesting deserialize_with example

@locallycompact had this use case:

assets/test-stratum.morph:

- repo: http://example.com/repo.git
  ref: aaaaaa
  bit: assets/test-bit.bit

assets/test-bit.bit:

configureCommands:
- "foodedoo"
buildCommands:
- "ladida"
installCommands:
- "dooopdedoop"

One file contains the path to another file. We can use deserialize_with to inline the contents of the second file into a struct representing the first.

security note for deriving Deserialize on types with invariants

When deriving Deserialize, it should be ensured that invariants of the types cannot be violated by deserializing untrusted data. This is especially important if the invariants are trusted by unsafe code.
I checked but couldn't find such a note in the docs currently.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.