WICG / nav-speculation

Proposal to enable privacy-enhanced preloading
https://wicg.github.io/nav-speculation/
Other
152 stars 35 forks source link

Choice of snake case for property names / keys #318

Closed jkrems closed 4 months ago

jkrems commented 4 months ago

The spec currently appears to be using "snake case", e.g. referrer_policy. I tried to think of any other case in the web platform where keys/names aren't one of:

It feels awkward to introduce yet another case variant for this spec. Since it's JSON (based on JS object notation), would it make sense to follow JS API precedent?

jeremyroman commented 4 months ago

In fact consistency was the aim here; the Web Platform Design Guidelines explicitly advise lowercase, underscore-delimited keys in JSON.

jeremyroman commented 4 months ago

Some existing examples on the web platform like this are web app manifests (e.g. background_color, file_handlers) and the report metadata in the Reporting API (e.g. user_agent).